Jens L. Nedregård

Results 13 comments of Jens L. Nedregård

Well said

In Crystal, you can define methods using things like this, like this: ```crystal put_line def put_line(line=__LINE__) puts "Called from line #{line}" end ``` Which outputs: `Called from line 1` (https://play.crystal-lang.org/#/r/3xak)....

Maybe some sort of tag however can make this `callinfo` avaible, like ```crystal @[WithCallInfo] def put_line STDOUT.puts(callinfo[:line]) end ``` (This example was just the first thing that popped into mind,...

> `__LINE__` is replaced by the line number that the token appears on, _except when it's in a method definition, where it means the caller's line number_. I have always...

Oh god, please not `__CALLER__` 😄 it’d look absolutely terrible.

Im all for the `r/[A-Z][a-z]*/` approach. In this examle i'll call it sigil because I've no better name atm. It'd be better if we came up with some cool name...

Wow, that's quite some error-message. And I love having such specific targets!

Or maybe instead of ``... for `before` (of type `Time`) ...``, we can do: ``` ... for `before:Time` ... ``` or even: ``` ... for `before (Time)` .. ``` The...

I think the `DT2017-06-26 4:15:30Z-05:00` is a bit unclear. It just seems disjunct, the `DT` prefix is understandable ─ *once you see it*, which is not quite easy enough IMO....