New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ValueList as a 6.e feature in core #5510
base: main
Are you sure you want to change the base?
Conversation
Raku needs a value-type object for lists. This copies the ValueList ecosystem module https://raku.land/zef:lizmat/ValueList verbatim and makes it part of 6.e. It does *NOT* provide any additional syntactic sugar to easily create ValueLists, so ValueList.new(...) is the way to go now.
As syntactic sugar for
Allowing I would propose to implement this in RakuAST only: this would allow it to be properly handled at compile time and produce |
I don't think discussing a new operator here would be a good idea. And I anticipate a dispute because First, it's a Unicode which is barely easy to use. A no good thing for something that is likely to be used on a very regular basis. Second, the pair resembles array operator which is, apparently, has quite the opposite semantics. |
I see it as brain-storming at this point, as any real discussion will be moot without this PR (or a functional equivalent thereof) being merged.
Perhaps use ValueList;
sub circumfix:<(( ))>(\a) { ValueList.new(a) };
dd ((1,2,3)).WHICH; # ValueObjAt.new("ValueList|C97F62DE1BA14379F6F017F3DFCBF16FB199D041")
dd Map.new(("a",42)); # Map.new((:a(42))) |
((1 + 2) * 3)
…On Thu, Jan 4, 2024 at 8:14 AM Elizabeth Mattijsen ***@***.***> wrote:
I don't think discussing a new operator here would be a good idea
I see it as brain-storming at this point, as any real discussion will be
moot without this PR (or a functional equivalent thereof) being merged.
anticipate a dispute because ⁅ ⁆ pair has two major drawbacks
Perhaps ((...)) would be good syntactic sugar. With ⸨...⸩ as the Unicode
equivalents.
use ValueList;sub circumfix:<(( ))>(\a) { ValueList.new(a) };dd ((1,2,3)).WHICH; # ValueObjAt.new("ValueList|C97F62DE1BA14379F6F017F3DFCBF16FB199D041")
dd Map.new(("a",42)); # Map.new((:a(42)))
—
Reply to this email directly, view it on GitHub
<#5510 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHSYXB2TIKMR3SCBUGTMLYM3IOFAVCNFSM6AAAAABBMZ3ECCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZXGM3DONRZGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
use ValueList;
sub circumfix:<(( ))>(\a) { ValueList.new(a) };
say ((1 + 2) * 3);
meh :-) So |
I can't concentrate on this matter deep enough to come out with a worthwhile proposal, but what I currently see is that the entire field of de-/containerization is not covered by unified Raku syntax. Basically, all we currently have are ops for itemizing with The direction I'm looking at is based on
Apparently, |
Raku needs a value-type object for lists. This copies the ValueList ecosystem module https://raku.land/zef:lizmat/ValueList verbatim and makes it part of 6.e. It does NOT provide any additional syntactic sugar to easily create ValueLists, so ValueList.new(...) is the way to go now.