6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today
Set by moderator on 3 April 2015.
07:49 Ven joined 08:47 Ven joined 10:30 Ven joined 11:11 Ven joined 15:38 Ven joined 15:52 Ven joined 16:19 Ven joined 16:29 Ven joined 17:08 Ven joined 19:03 vendethiel joined
vendethiel I checked, it's indeed the book I read 21:15
I also remembered something, f# has code quoting as well
<@ CODE @>
you can then manipulate it 21:16
and do stuff like match (with their amazing "active patterns")
match code with | SpecificCall <@ (OP) @> (?, ?, [lhs; rhs]) -> do stuff 21:17
masak ooh, I kinda like the look of <@ @> 21:18
masak thinks he wants destructuring in Perl 6, at least in the form of a macro-driven module 21:19
vendethiel the AST types are under Expr 21:20
and they have a .Eval() method
masak so far so good
vendethiel (yeah, f# is a mess with method-vs-functions-vs-OTHER-STUFF and all that...)
so, you can say:
let conv = <@ fun (x: string) -> x.ToUpper() @>.Eval() in conv "hey" 21:21
masak I see. 21:23
vendethiel I don't know much f#, but computational expressions, type providers, quotes and active patterns are good features 21:26
masak ok. 21:40