Days since Jon created a new library: 0
-
-
-
And these days he even manages to publish them to Maven Central on day 0
- Show replies
New conversation -
-
-
No, but it's an interesting idea. In extractor position, I would need to distinguish between "substitutions" and "extractions" (certainly possible). In expression position (not yet implemented, but it's trivial), that would be even easier, but not quite so useful.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Great work, Jon! But please consider using of concurrent hash map for the cache instead of a synchronized block: https://github.com/propensive/kaleidoscope/blob/master/core/src/main/scala/kaleidoscope/kaleidoscope.scala#L80 …
-
It is reminded me a nasty bug of scala.Enumaration, with blocking during each .withName() and .toString() call. BTW could you, please, help to make W/A for it using Scala macros? https://github.com/scala/scala/blob/2.13.x/src/library/scala/Enumeration.scala#L203 …
- Show replies
New conversation -
-
-
Do you think it's possible without changing the compiler? I don't know about you, but I'm imagining some unholy hack which makes my regexes temporarily look like strings. But I've been interested in more general "constant" folding for a while. Hoping SIP-23 could be a first step.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I have some ideas about how this might work. I think you're right that literal types would be the only sensible way to get the information to flow from a nested extractor to the enclosing one, but I would need to experiment too...
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This isn't an issue I've ever encountered by chance (though Magnolia contorts itself to wrest control of recursive expansions). But extractor macros are a new domain for my whimsical experiments, and I'm not sure my mental model features any sort of expansion order yet.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
As we're probably talking about whitebox macros, I wouldn't be surprised if they expanded 2ⁿ times, once for the type, once for the AST, recursively on each level of nesting...
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Whatever you capture is still stringly-typed though, which was always my own personal frustration with regex. Hence I've long favoured FastParse over regex's ASCII soup for anything non-trivial
-
Sure, but this is the means to get your input data out of stringly-typedness and into something better as soon as possible! By the way, I'll be adding typed extraction next, e.g. case r"${hour: Int}@(.*):${min: Int}@(.*)" => hour*60 + min Typeclass-based, of course.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.