Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2015-03-20

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
07:49 Ven joined #6macros
08:18 Ven joined #6macros
11:50 Ven joined #6macros
11:51 masak this would be a good place to hash out various possible syntaxes for all the things we want macros to do.
11:51 masak (I'm teaching today, so I don't have loads of time to do it.)
11:51 masak (just wanted to share the idea.)
11:52 masak I'm experiencing some degree of "idea overload" from having seen macros and similar things in other languages. I would appreciate much more seeing macros in Hypothetical Perl 6.
11:53 masak and concrete things like, "I have this string here. how do I create a function of that name?"
11:53 Ven masak: something like my "MATCH" macro?
11:53 masak yeah, things like that.
11:53 masak what my grant really should amount to is arriving at a consistent set of "tools" (syntax, APIs, mechanisms) for doing common macro use cases.
11:55 masak the only reason I explore other languages is to get a sense of how they cover the use cases.
11:55 Ven mmh
11:55 masak after that, I/we still need to find our own path in Perl 6.
11:55 Ven perl6 has a huge issue tho
11:56 masak just one? :)
11:56 Ven the operators stuff, say
11:56 Ven I'm just talking about a specific one here ;)
11:56 masak go on.
11:56 Ven in elixir, I have this macro "ADT.define foo | bar | baz"
11:56 masak *nod*
11:56 Ven it gets called with foo | (bar | baz)
11:57 Ven so, I need to "flatten" these
11:57 Ven to get [foo, bar, baz]
11:57 Ven I *cannot* do that in perl6 because of how the operators things work.
11:57 masak um.
11:57 masak there's chaining operators.
11:57 Ven no, it won't work. only "is parsed" would work here
11:57 masak did you consider those?
11:57 Ven yes, but I can't define infix:<|> is assoc(<list>
11:58 Ven what'd be the operand types?
11:58 masak oh, I see what you mean
11:58 Ven Any? but then, it'd override the "real" | operator
11:58 masak right, it'd have to be "is parsed"
11:58 * masak will ponder this
11:58 masak thanks for your input.
11:59 Ven macro define-adt($/) is parsed /<call> + % '|'/ { for $<call> { die "invalid operand" unless $_ ~~ Callable; ... } }
12:00 Ven that's *one* example :)
12:00 Ven I actually think we don't really need a MATCH macro, as given/when+signatures *should* work
12:01 Ven HOWEVER, I'd really love to have, say, `fun NAME { when :($a, 5) { ... } }`
12:01 Ven (or function, if I want it to feel ml-ish)
12:07 Ven ...
12:08 Ven tbh, doing that with "is parsed" makes me feel like we're reinventing a beast we tamed
12:21 Ven joined #6macros
12:53 masak yes, exactly
16:14 Ven joined #6macros

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary