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 28 July 2015.
02:25 FROGGS_ joined 02:48 ilbot3 joined 04:00 vendethiel joined 12:57 vendethiel joined 12:59 Ven joined
masak if we did get a `do` keyword (which allows a statement to occur inside of an expression) -- which statements should have a value apart from None ? 13:40
well, Q::Statement::Expr, of course, since that's the main idea.
I think cogent arguments could be made for these: Q::Statement::Sub, Q::Statement::Macro, Q::Statement::BEGIN 13:42
vendethiel foo(do return 3); <- wat do?
masak vendethiel: return and cede control to caller before a value can be formed. 13:43
vendethiel troo
masak vendethiel: so it's a kind of "tree in the woods and no-one hears" situation
vendethiel: in case someone ever found out a way to get a value from a Q::Statement::Return object, I'd say it should be None 13:44
vendethiel "seems fair" :) 13:48
masak I especially want to avoid semantics like "last statement of conditional/loop", which is fraught 13:50
vendethiel that's because you didn't embrace it for the last-statement of a sub already ;-) 13:51
masak much easier to train the user to go `result;` at the end
vendethiel: yeah, taking a leaf from Python there :)
I like (and use) implicit returns a lot in Perl 6 (and miss it in JavaScript), but it feels like too much magic in 007 13:52
vendethiel magic? 14:03
it's magic in coffee-and-the-like where we "implicitly do", but otherwise...
masak I don't know how to express it clearly. but I like the idea that `return` is the only mechanism to return values from a routine. 14:46
we could postulate a `leave` mechanism from blocks (which would immediately abort the block and optionally hand back a value), but that would be a second mechanism, working just like return does for routines, but for blocks. 14:47
vendethiel well, i dislike "return" in general 14:48
might be the lispish part of my brain speaking ;-) 14:49
masak heh :) 14:58
yeah
I need to design a language that is more Perlish than Lispish, though. otherwise the research part is pretty meaningless
vendethiel
.oO( surely you already opened the door to the devil by adding python stuff )
15:03
masak :P 15:04
I'm not all that invested in language "wars", sorry... :) 15:05
I think at this point I could take on a consulting gig that was all Python, and like it
vendethiel :D 15:09
masak g'ah. broke the build. 15:27
(by committing only parts of a change)
15:33 vendethiel joined 17:48 FROGGS joined
masak today's question: what existing feature of 007 stands out as *unnecessary* for its stated goals? (so we can un-implement it before v1.0) 18:03
18:14 Ven joined 18:31 Ven joined 18:45 vendethiel joined 20:59 Ven joined
Ven cool refactoring. 21:33
masak fairly straightforward. 21:40
the test suite is great at capturing thinkos at this point -- it covers enough that I can just whip something up and re-run `prove` to see if I got it right 21:41
I'm also running the fuzzer in the background, which gives me some ideas of where we still have weak coverage
heh -- it looks more fancy in the diff than it felt to do in code ;) 21:42