pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: irc.pugscode.org/
Set by Tene on 29 July 2008.
ruoso realises that he's working too much when he unconsciously types __HELP__ when he was trying to type __END__ 02:52
ruoso sleep & 03:02
TimToady @tell pmurias yes, void context is a special kind of scalar context, and map/for both eagerly return a list object in scalar context (lazily in list context), and either can be used only for its side effects; they are isomorphic. see S04:279 06:10
lambdabot Consider it noted.
TimToady @tell pmurias a useless-use-of warning results if you use a non-side-effective operation within either map or for in void context, but the map/for don't themselves care 06:13
lambdabot Consider it noted.
TimToady @tell pmurias and of course, the array object need not actually be constructed if it is known that void context will throw it away; in fact, it may well be the void context optimizer that emits the warnings about useless-use as it propagates void context inward 06:21
lambdabot Consider it noted.
TimToady ruoso: see above 06:26
moritz_ good morning 07:20
does anybody know how I can submit a link to the perl section of reddit?
pugs_svn r22080 | lwall++ | [STD] fix enum parsing (again) 07:49
r22080 | lwall++ | [Cursor] minor speedups
Ehtyar anyone know where to find a current pugs build for windows? 08:26
pugs_svn r22081 | moritz++ | [t] fixed use of do as a function in statements/redo.t 08:51
Ehtyar why do i get revision 16464 from svn and i'm seeing revision 22081 here? 08:54
moritz_ svn up -r 16464
but if you have a new ghc installed, the latest version *should* work 08:55
pugs_svn r22082 | moritz++ | [t] moved last.t and redo.t to spec/
Ehtyar on win32? 08:56
moritz_ I think so, yes
(but haven't tested)
Ehtyar so how can i checkout 22082? 08:58
up gives me no such revision
:S
moritz_ what does 'svn up' update to?
Ehtyar 16464
moritz_ which repository are you using? 08:59
(svn info; search for Repository Root)
Ehtyar svn.openfoundry.org/pugs/
lambdabot Title: Revision 16464: /
moritz_ use svn.pugscode.org/pugs instead
lambdabot Title: Revision 22082: /
moritz_ the one you use is outdated
Ehtyar ah ty 09:00
pugs_svn r22083 | moritz++ | [t] merged statements/grepa-and-sort-in-for.t into spec/S04-statements/for.t
Ehtyar ok, checking out latest, ty moritz 09:03
pugs_svn r22084 | moritz++ | [t/spec] initialize a variable to make rakudo happy 09:03
pugs_svn r22085 | moritz++ | [t] simplified blocks/recurse.t a bit, used is() instead of ok() 09:14
r22086 | moritz++ | [t] moved blocks/recurse.t to spec/ 09:19
pugs_svn r22087 | moritz++ | [t/spec] recurse.t: use numeric comparison where appropriate, fudged for 09:23
r22087 | moritz++ | rakudo
pugs_svn r22088 | moritz++ | [t] moved blocks/pointy.t to spec/ 09:26
rakudo_svn r30688 | moritz++ | [rakudo] add recursion tests to spectest_regression.data 17:45
pmurias ruoso: hi, turned out Array.map is enough ;) 20:46
lambdabot pmurias: You have 3 new messages. '/msg lambdabot @messages' to read them.
ruoso pmurias, yeah... I saw it...
it's weird to think that Array.Void() will eagerly evaluate a lazy array...
pmurias it will only extract it's side effects 20:48
pmurias i'm convinced more and more that we should take the context is part of the method call route 20:50
ruoso hmm 20:52
I still can only think on contextual information as optimization...
moritz_ want() 20:53
ruoso want() is something that cannot always be answered, iirc
moritz_ well, sometimes you have to fake answer 20:55
ruoso that's why I'd rather use lazy contextualization...
by calling methods on the returned value
(that's how "sub foo is rw" is implemented in SMOP, btw) 20:56
moritz_ that's the recommended approach, but not the only allowed
ruoso sure... that's why I think on "context on the stack frame" as optimization...
and that we could stick to method calls on the returned values for now...
pmurias shower& 20:57
ruoso because instead of doing if (want() ~~ Scalar), I can return an object that knows how to perform in the different contexts... 20:58
pmurias like Contextual::Return?
ruoso yeah 20:59
I think that should improve the overall lazyness of the code...
which IMHO, is a good thing... 21:00
ruoso I could even think about dropping "want" entirely.... ;) 21:00
geez... have to run 21:01
ruoso home &
ruoso will backlog... as usual...
pugs_svn r22089 | lwall++ | [STD] Add Bool::True and Bool::False as valid typenames 22:08
ruoso back 23:20
pugs_svn r22090 | lwall++ | [t] clean up various calls to try, system, etc 23:21
ruoso btw... if for returns the elements returned by each iteration... what is the difference from map? 23:31
pugs: my @a = for (1,2,3) { $_ * 2 }; say @a 23:32
p6eval pugs: OUTPUT[*** ␤ Unexpected "@a"␤ expecting "=", context, ":" or "("␤ postfix op␤ at /tmp/L16H25MEQV line 1, column 4␤]
ruoso perl6: my @a = for (1,2,3) { $_ * 2 }; say @a 23:33
p6eval rakudo 30693: OUTPUT[Statement not terminated properly at line 1, near "{ $_ * 2 }"␤␤current instr.: 'parrot;PGE::Util;die' pc 119 (runtime/parrot/library/PGE/Util.pir:82)␤]
..elf 22090: OUTPUT[Parse error in: /tmp/f7iVqGrfPJ␤panic at line 1 column 20 (pos 20): Statement not terminated properly␤WHERE: my @a = for (1,2,3) { $_ * 2 }; say @a␤WHERE: /\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:355:in `eat_terminator'␤
..STD_red/std.rb:26...
..pugs: OUTPUT[*** ␤ Unexpected "@a"␤ expecting "=", context, ":" or "("␤ postfix op␤ at /tmp/1HLusRMsnQ line 1, column 4␤]
ruoso nobody seems to like the idea of "for" returning a list...
ruoso implementing "Void method for ($code)" in Array in the meanwhile 23:37
pugs_svn r22091 | ruoso++ | [smop] implementing the test for the "for" operator 23:40
TimToady perl6: my @a = do { for 1..3 { $_ * 2 }}; say @a 23:47
p6eval pugs: OUTPUT[␤]
..elf 22091: OUTPUT[Useless use of multiplication (*) in void context at (eval 119) line 4.␤␤]
..rakudo 30693: OUTPUT[-1␤]
wknight8111 ...neither of those answers look right 23:48
TimToady well, at least that parses :)
you can't just use a statement where a term is expected
ruoso TimToady, but is there really a use to my @a = for?
I mean...
isn't that the use of "map"? 23:49
TimToady map is just another way to write the same thing
you'll note the args come in a different order
TimToady map is even more redundant with list comprehensions 23:49
ruoso I know that it will benefit from optimizations depending on the context... 23:50
but it's a shame that it needs to be optimized... IMHO... 23:51
TimToady I'd much rather keep the semantics of statement for and modifier fo the same 23:52
*for
and modifier for is essential for list comprehension syntax
which has to return its values
ruoso and turn the "modifier for" into a map, actually 23:53
TimToady they're all maps, really 23:53
ruoso but a for that doesn't return is simpler than a map 23:54
I'm arguing that we should keep at least one option that simply doesn't return any value
TimToady I know you're arguing that, and I'm ignoring you. :) 23:55
ruoso he
:P
TimToady void context propagation has to happen anyway--I don't really consider it an optimizaiton 23:56
*tion
ruoso alright... so for is just a synonym for map... and both are evaluated lazily... 23:59
TimToady in list context...
ruoso void context causes eager evaluation...