Giter Site home page Giter Site logo

Comments (9)

kepkin avatar kepkin commented on June 23, 2024

Oh I was terribly wrong!
When I write

val x = 3 seconds // type inference says it's a com.github.nscala_time.time.DurationBuilder

So I need an implicit conversion from DurationBuilder, but it's a private class! So the following just won't compile

package implicit_vs_private

import scala.concurrent.duration.{Duration => ScalaDuration}
import com.github.nscala_time.time.Imports._
import com.github.nscala_time.time.DurationBuilder

object Test {
  implicit def NscalaDurationBuilder2Duration(x: DurationBuilder) : ScalaDuration = ScalaDuration.fromNanos(x.standardDuration.getMillis * 1000000)
}

from nscala-time.

kmizu avatar kmizu commented on June 23, 2024

Hi. There are another request to make DurationBuilder public already. Whether we accept your proposal, to implicit converion to nscala-time, or not, I'd like to make DurationBuilder public. Since DurationBuilder is mostly internal representation, it's not so good to make it public, but I'd like to do it for convenience.

What do you think? /cc: @gakuzzzz @xuwei-k @tototoshi

from nscala-time.

gakuzzzz avatar gakuzzzz commented on June 23, 2024

I'm your side, @kmizu. I's not so good to make it public
However, we dont have more better solution... mmm

from nscala-time.

kmizu avatar kmizu commented on June 23, 2024

Today, I decided to make DurationBuilder public since another elegant solution could not be found.
I'll create the PR to do it.

from nscala-time.

kmizu avatar kmizu commented on June 23, 2024

Fixed via #64

from nscala-time.

yokomizor avatar yokomizor commented on June 23, 2024

What you think about to include @kepkin conversion's into nscala-time?

I think it would be very useful.

from nscala-time.

kmizu avatar kmizu commented on June 23, 2024

@yokomizor OK. I think it's a good idea to add @kepkin conversion's into nscala-time. Since I'm a little busy, it helps us if you create the PR to add @kepkin conversion's into nscala-time. Or please wait a while for creating the PR.

from nscala-time.

kmizu avatar kmizu commented on June 23, 2024

@yokomizor Note that Since nscala-time is simple sbt project, I think that you can edit nscala-time code easily via text editors or IDEs (Especially, IntelliJ IDEA + Scala Plugin).

from nscala-time.

kmizu avatar kmizu commented on June 23, 2024

@yokomizor I'm sorry to late response. After I create the PR #69 and the PR's badness is point outed, I found it bad idea that @kepkin conversions are included into nscala-time. Then, I close this issue.

from nscala-time.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.