Re:Raku vs. Perl
by riffraff on Saturday April 18, 2020 @09:36AM
(#22907606)
you would define values like
[ Parent
| on HN ]
Re:Raku vs. Perl
by wodenokoto on Saturday April 18, 2020 @10:02AM
(#22907779)
My imaginary units library would have been like
Unit(float, unit_as_string)
The free text version is pretty cool thoughI would parse the free text version into something like your version. It could be used for user input from a text input field or the command line.
Re:Raku vs. Perl
by iso-8859-1 on Monday April 20, 2020 @11:13PM
(#22931468)
But what does strings have to do with it? Why can't those expressions be plain Perl, maybe with some overloaded operators?
For example,
import week, custom, si, type from stdlib.units
weight = 10 * si.kg
speed = 2.5 * (custom("furlong", type.LENGTH) / week)this is also important - but imo, and in practice from perl5, the Units library experience is a lot richer if you can do both - especially for entry level programmers such as high school students - more on this to come in v2
Even further, presumably things like kg·m·s⁻², which (perhaps) this library can equate to Newtons.