Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-09-06

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:39 [particle]1 joined #perl6
01:39 Maghnus joined #perl6
01:58 pugs_svn r22166 | lwall++ | [rx.t] fix pugs fudging
02:04 meppel-san joined #perl6
02:05 justatheory joined #perl6
02:09 bacek joined #perl6
02:23 hercynium_ joined #perl6
02:43 meppel-san good night
03:03 elmex_ joined #perl6
03:49 justatheory joined #perl6
04:14 lambdabot joined #perl6
04:31 alester joined #perl6
05:00 eternaleye joined #perl6
05:01 aindilis joined #perl6
05:31 Psyche^ joined #perl6
06:17 viklund joined #perl6
06:18 viklund perl6: say :foo<>.perl
06:18 p6eval rakudo 30809: OUTPUT[("foo" => [])␤]
06:18 p6eval ..elf 22166: OUTPUT[Odd number of elements in anonymous hash at ./elf_f line 19.␤Pair.new(!!!)␤]
06:18 p6eval ..pugs: OUTPUT[*** Named argument found where no matched parameter expected: (foo,Syn "," [])␤    at /tmp/kGq5mr0wii line 1, column 1 - line 2, column 1␤]
06:19 viklund hmm, that looks like a bug in rakudo to me, shouldn't the output be ("foo" => "")
06:19 viklund irhd++ found it while hacking on november
06:19 TimToady well, pugs actually has it right :)
06:20 viklund ok
06:20 TimToady but in general, :foo<bar baz> is short for :foo{'bar', 'baz'}
06:21 TimToady or maybe :foo['bar', 'baz'] really
06:21 TimToady but the question is whether the [] is constructed by the infix:<,>, which I suspect it is
06:21 viklund should they all work without params?
06:22 viklund perl6: say :foo[].perl
06:22 p6eval rakudo 30810: OUTPUT[("foo" => [])␤]
06:22 p6eval ..elf 22166: OUTPUT[Undefined subroutine &Main::ARRAY called at (eval 117) line 3.␤ at ./elf_f line 3861␤]
06:22 p6eval ..pugs: OUTPUT[*** Named argument found where no matched parameter expected: (foo,Syn "\\[]" [Syn "," []])␤    at /tmp/JaCAAIDPeZ line 1, column 1 - line 2, column 1␤]
06:22 TimToady it ought to be equivalent to "foo" => ()
06:22 TimToady since <> is really qw//
06:22 viklund yes
06:23 viklund hmm
06:24 TimToady but () in scalar context is likely to be some kind of undef
06:24 viklund rakudo: ("foo" => ()).perl
06:24 p6eval rakudo 30810: RESULT["(\"foo\" => [])"]
06:24 viklund rakudo: ("foo" => (1)).perl
06:24 p6eval rakudo 30810: RESULT["(\"foo\" => 1)"]
06:24 TimToady pugs: ("foo" => ()).perl
06:24 p6eval pugs: RESULT["\\(\"foo\", ())"]
06:25 TimToady pugs: ("foo" => (1)).perl
06:25 p6eval pugs: RESULT["\\(\"foo\", 1)"]
06:25 TimToady pugs: ("foo" => (1,2)).perl
06:25 p6eval pugs: RESULT["\\(\"foo\", (1, 2))"]
06:26 TimToady pugs: say ("foo" => (1,2)).perl
06:26 p6eval pugs: OUTPUT[\("foo", (1, 2))␤]
06:26 TimToady pugs: say (:foo(1,2)).perl
06:26 p6eval pugs: OUTPUT[\("foo", (1, 2))␤]
06:27 TimToady pugs seems to be representing pairs as captures of 2 positionals
06:28 TimToady that aside, I think pugs is behaving more sanely on () probably
06:28 viklund ;)
06:29 TimToady I think it could be bad to promote () to [] in general
06:33 viklund yes, probably.
06:53 Alias_ joined #perl6
06:55 eternaleye joined #perl6
07:23 alanhaggai joined #Perl6
07:49 zamolxes joined #perl6
07:52 eternaleye joined #perl6
07:53 moritz_ TimToady: are you aware that rx.t isn't runnable by rakudo?
08:35 jferrero joined #perl6
08:46 moritz_ TimToady: and where is method Match.produces defined?
08:46 alanhaggai_ joined #Perl6
09:06 Tene pugs: (foo => 2)
09:06 p6eval pugs: RESULT[\("foo", 2)]
09:06 Tene pugs: (foo => 2, bar => 3)
09:06 p6eval pugs: RESULT[(\("foo", 2), \("bar", 3))]
09:06 Tene pugs: {foo => 2, bar => 3}
09:06 p6eval pugs: RESULT[(\("foo", 2), \("bar", 3))]
09:07 Tene TimToady: if we have (a => 1,b => 2), what do we need the {} form of the same thing for?
09:10 moritz_ the difference is that (..) interpolates, {...} doesn't
09:13 Tene Ah, right.
09:13 Tene pugs: [foo => 2, bar => 3]
09:13 p6eval pugs: RESULT[\(\("foo", 2), \("bar", 3))]
09:13 Tene What about that?
09:14 iblechbot joined #perl6
09:14 moritz_ that's a list of pairs, not a hash
09:15 Tene Hm.
09:15 pugs_svn r22167 | moritz++ | [t/spec] fudged rx.t for rakudo
09:17 moritz_ rakudo: "a" !~~ /b/ && say "yes"
09:17 p6eval rakudo 30812: OUTPUT[Null PMC access in set_pmc_keyed()␤current instr.: 'parrot;Code;ACCEPTS' pc 5633 (src/gen_builtins.pir:3735)␤]
09:17 moritz_ anybody willing to fix this? blocks a few dozens regex tests
09:19 rakudo_svn r30813 | moritz++ | [rakudo] added bool.t to spectest_regression, and s/pge-tests/rx/
09:20 Tene in set_pmc_keyed?  Weird.
09:20 * Tene looks
09:26 Tene Huh.  Code::ACCEPTS tries to set $/ in somewhere inappropriate...
09:26 Tene Yeah, in CALLER
09:27 Tene Why isn't that working here?  That's weird.
09:29 moritz_ !~~ should be Code::REJECTS
09:29 Tene REJECTS calls ACCEPTS
09:29 moritz_ that's bad
09:29 Tene then negates the result
09:29 moritz_ because REJECTS shouldn't set $/
09:29 moritz_ (IMHO)
09:30 moritz_ maybe we could add a REJECTS method that doesn't set $/
09:30 Tene Probably.
09:30 moritz_ how can I coerce to bool in pir?
09:31 Tene assign to int, or use a small shrub of goto ... if ...
09:32 Tene Anyway, it's src/classes/Code.pir:36
09:32 moritz_ yes
09:32 Tene Which I guess you found.
09:32 Tene I'm a bit too asleep to swap in enough to figure out why that's null in this case.
09:33 Tene rakudo: sub foo { 'a' !~~ /b/ && say "yes" }; foo()
09:33 p6eval rakudo 30814: OUTPUT[Null PMC access in set_pmc_keyed()␤current instr.: 'foo' pc 140 (EVAL_13:63)␤]
09:33 Tene rakudo: sub foo { 'a' ~~ /b/ && say "yes" }; foo()
09:33 moritz_ I think I've got it working
09:33 p6eval rakudo 30814: RESULT[{}]
09:33 barney joined #perl6
09:34 Tene Oh, is that because ACCEPTS is being called from REJECTS?  I think so.
09:34 moritz_ well, not quite
09:34 moritz_ yes
09:34 Tene Except REJECTS doesn't get a lexpad?
09:34 moritz_ dunno what's the cause it
09:34 moritz_ but match could be NULL if the match fails
09:35 moritz_ anyway, I've got a solution here locally
09:35 moritz_ will run tests and then commit
09:36 Tene fantastic
09:36 moritz_ thanks for your help Tene
09:36 Tene btw, moritz++ for tests
09:41 Tene moritz_: also, always feel free to harass me by name for rakudo stuff.  I'll help if I'm awake.
09:41 moritz_ Tene: ok, will do (gladly ;)
09:43 Tene I'll work on anything anyone is willing to ask me about.
09:43 rakudo_svn r30815 | moritz++ | [rakudo] implement Code::REJECTS that doesn't set $/ and doesn't die.
09:43 rakudo_svn r30815 | moritz++ | I don't really know if that's correct, though. Will ask p6l for clarification
09:44 Tene moritz_: you didn't change the POD in that copy/paste
09:44 Tene Formally, you should look up and return Bool::True/False, I think.
09:45 moritz_ thanks
09:46 moritz_ no other method seems to look up Bool::True/False (from a quick ack)
09:46 Tene Or, no, maybe you just return whatever the function returns...
09:46 Tene for:
09:46 Tene unless ... -> $n { ... }
09:47 Tene Or is that not allowed?
09:47 Tene Bah, specs.
09:47 moritz_ it is allowed
09:47 moritz_ but I'd have to negate a match object
09:47 moritz_ which is kinda... weird
09:48 Tene Just leave it until someone writes a failing test.  That's what I always do.  ;)
09:48 rakudo_svn r30816 | moritz++ | [rakudo] fix POD in Code.pir
09:48 moritz_ TDD++
09:48 Tene (other people doing work for you)++
09:58 larsen_ joined #perl6
10:15 pugs_svn r22168 | moritz++ | [t/spec] rx.t: unfudged, use double quotes where stuff should be interpolated
10:20 moritz_ currently 3281 tests pass, which is an improvement over yesterday ;)
10:28 pugs_svn r22169 | moritz++ | [t/spec] some more corrections and unfudging in rx.t
10:33 ludan joined #perl6
10:34 meppl joined #perl6
10:36 abra joined #perl6
10:42 Grrrr joined #perl6
10:56 iblechbot joined #perl6
11:17 dr_df0 joined #perl6
11:18 Chillance joined #perl6
11:30 pmurias joined #perl6
11:30 pmurias is get a lot of Couldn't match expected type `Buf.ByteString' against inferred type `ByteString'
11:30 pmurias when building pugs, it used to build before
11:33 pmurias seen a warning at the top which seems to explain the error
11:43 rindolf joined #perl6
12:09 kane_ joined #perl6
12:22 Lichtkind joined #perl6
12:25 charsbar joined #perl6
12:34 sri_work joined #perl6
12:36 pim joined #perl6
12:36 pim Hi, how can i write this perl5 code easyly in perl6 : my @files=`ls -1tr`; ....?
12:37 moritz_ @files = qx{ls -1tr};
12:37 lambdabot Unknown command, try @list
12:37 moritz_ but I doubt that rakudo or pugs implement that
12:37 moritz_ pugs: say qx{ls}
12:37 p6eval pugs: OUTPUT[*** Unsafe function 'Pugs::Internals::runShellCommand' called under safe mode␤    at /tmp/T4wn7xZceC line 1, column 5 - line 2, column 1␤]
12:37 moritz_ well, maybe pugs does ;)
12:38 pim thanks
12:38 pim i try...
12:39 moritz_ works here
12:40 preflex joined #perl6
12:42 pim joined #perl6
12:42 pim sorry i have been disconnected.
12:43 pim for me this does not work a all : qx{$command};
12:44 pim no.
12:47 pim left #perl6
13:12 jrockway joined #perl6
13:20 abra_ joined #perl6
13:21 aindilis joined #perl6
13:26 larsen_ joined #perl6
13:35 larsen__ joined #perl6
13:37 moritz_ qx doesnt interpolate
13:37 moritz_ qq:x would
13:49 iblechbot joined #perl6
14:09 alanhaggai joined #Perl6
14:36 jrockway joined #perl6
14:37 alester joined #perl6
14:38 pmurias joined #perl6
14:51 araujo joined #perl6
15:02 pugs_svn r22170 | pmurias++ | [pugs] pre-working (ugly) start of the m0ld pugs backend
15:03 pmurias @tell ruoso what do you thing of the top-level m0ld block receiving and $interpreter and $scope?
15:03 lambdabot Consider it noted.
15:03 pmurias * think
15:12 TimToady moritz_: .produces is just a placeholder for however those results should be evaluated; it's just modelled on the notion that Match and Failure both have a .produces tester, neither of which do.
15:13 TimToady probably really wants to be a multi rather than a method
15:13 TimToady but I didn't know if parrot already had some way of testing against those particular specs
15:14 TimToady anyway, my job is to make sure it parses under STD, not under anything else :)
15:18 pmurias are there any reasons for not making lots of small commits instead of a few big ones?
15:21 PerlJam pmurias: committing in conceptual units?
15:23 jrockway joined #perl6
15:26 TimToady small commits usually make it easier to back out something broken as long as consistency is maintained, but a partial patch breaks things too, so as usual "it depends"
15:29 pmurias thanks
15:32 pugs_svn r22171 | pmurias++ | [pugs-m0ld] replace ? with generated identifiers
15:33 moritz_ TimToady: it would be nice if the method used in the test suite were somehow specced; at least I try to work in that direction
15:34 TimToady we're talking about building the basic tests into the language so you can just start with plan
15:34 moritz_ ok ;)
15:34 TimToady maybe "produces" should be a very low precedence infix
15:34 TimToady so we can multi it
15:35 TimToady originally I was just going to write "ok produces(...)" but that was kinda ugly
15:35 pmurias TimToady: "building the basic tests into the language", you mean having plan and ok in the Prelude?
15:36 TimToady yes
15:36 TimToady and any others we deem common enough
15:36 TimToady and all easily overridden by a real "use Test::FooBar"
15:36 TimToady but just basic functionality
15:37 TimToady the idea being that we make it easy to write TAP the way we made it easy to write POD
15:38 moritz_ well, we can always write class Match is also { method produce ... }
15:38 TimToady (this was discussed on Wed's conf call, and was generally approved of)
15:39 TimToady we could do that to
15:39 TimToady though it forces you to do "is also" on non-cooperative classes
15:40 TimToady or put it into Object and redispatch to a multi
15:40 TimToady but if we're building in ok and friends, we could also build in an assertion that could be appied "en passant" to values
15:41 TimToady and an infix "produces" would work pretty well for that
15:41 moritz_ what do you want the semantics of "procudes" to be? I somehow can't associate useful semtantics with it
15:41 TimToady it would depend on the types of both the left and right args
15:41 TimToady you check Match objects differently than Failure objects
15:42 moritz_ so it's another "smart match", but not ~~ ?
15:42 TimToady yes, because ~~ notionally returns boolean, not the left arg
15:43 TimToady it's like a POST block on a value expression
15:43 TimToady open to better words for than than "produces"
15:44 TimToady on the other hand, we're using it as a boolean inside "ok"...
15:44 TimToady so kinda ignore what I just said :)
15:46 moritz_ so basically you want another matcher that's not limited to return a boolean?
15:46 moritz_ well, I'll ignore what you jsut said ;)
15:46 TimToady it's okay for "produces" to return Failure if it's checking a Match that fails, but it's not okay for it to return the left object if it it happens to be Failure tha you're crosschecking
15:47 pmurias TimToady: if the builtin subset is too basic, and most things require a real test module it won't save much typing
15:47 TimToady but maybe that just means that checking for appropriate failure turns some kind of true object
15:47 moritz_ pmurias: if we can test the prelude and the language with it, it can't be *that* basic
15:48 TimToady I'd say, pretty much everything that the test suite is currently using
15:48 TimToady but, oddly, perhaps not "is"
15:48 TimToady since it's almost always better to specify the exact comparison with "ok"
15:48 moritz_ well, is() in the test suite is *very* basic, and often abused
15:49 TimToady most of those should be "ok $a ~~ 42"
15:49 TimToady which is only, what, 2 characters longer than "is $a, 42"
15:50 TimToady and hopefully has pretty much the same DWIM semantics
15:50 moritz_ well, is() doesn't DWIM
15:50 moritz_ it eq's instead
15:51 moritz_ (as it currently is)
15:51 TimToady the same DWIM semantics that "is" *ought* to have, I should say
15:51 pmurias given macros ok can prints as good a error message as is
15:51 TimToady yes
15:51 [particle] joined #perl6
15:51 TimToady I can see a class of macro-like subs that just happen to remember the text of their 1st arg
15:52 TimToady assert() for instance
15:52 TimToady sub ok ($bool, $mess) is assertion {...}
15:53 TimToady not sure how you get at the text though...
15:54 moritz_ can user defined operators catch execptions of one of its arguments somehow?
15:55 TimToady depends on what kind of exception you're talking about
15:55 moritz_ thrown ones
15:55 TimToady user-defined ops can be macros, but can only influence parsing on the right
15:56 TimToady however, they can do anything they like with the existing AST on the left, so yes, you could wrap the left arg with an eval node
15:56 TimToady well, a try node
15:57 TimToady presumably the AST on the left can return its text too
15:57 TimToady of course, a prefix macro can do anythig it likes, even with the parsing
15:58 TimToady but macros are kinda hard, so I wouldn't really want to enforce full macro support onto a budding implementation
15:58 moritz_ aye
15:58 TimToady hence the proposal for "assertion" subs that can just get the text of 1st arg magically
16:00 moritz_ sounds good
16:00 TimToady or, I suppose, any arg, once you've declared "assertion" good enough for the parse to see it
16:02 TimToady maybe it's an attribute of a parameter instead
16:02 TimToady and causes the argument value to be annotated with a text property
16:02 moritz_ but I still haven't really understood what the 'produces' thingy is needed for
16:02 a-jing joined #perl6
16:02 a-jing left #perl6
16:02 abra_ joined #perl6
16:02 moritz_ I mean ~~ doesn't have to return a boolean, just a thing that boolifies correctly
16:03 TimToady and Failure doesn't boolify correctly inside ok()
16:03 moritz_ but 'Failure ~~ $stuff' could boolify correctly, can't it?
16:03 TimToady so we can't just return the left arg anyway
16:04 TimToady sure
16:04 abra_ joined #perl6
16:04 pugs_svn r22172 | pmurias++ | [pugs-m0ld] pattern matching is done with case instead of multiple function definitions
16:05 TimToady since ~~ is determined by the type of the right value, we need to distinguish patterns that will work correctly against whatever left types we want to test
16:06 TimToady obviously if we're going to test match objects with the "mob" notation, something has to interpret that notation
16:06 TimToady I just threw the info in there as a string for now, but that obviously won't work directly
16:07 TimToady arguably Failure ~~ /text/ can be taught to work, but is also somewhat perilous in forcing particular error messages
16:08 TimToady though I suppose standard error messsages aren't such a bad thing...
16:08 TimToady currently though they're just parrots idea of what messages should be, which are unlikely to match what other implementations are doing so far
16:09 TimToady *parrot's
16:09 TimToady we probably need to work out message identities that are independent of what language is emmitted
16:10 TimToady *emitted
16:12 TimToady so Failure ~~ messid("F_42") or some such
16:13 moritz_ Failure ~~ Error::Parse?
16:13 TimToady would like granularity down to individual messages sometimes
16:14 TimToady so only if every exception has it's own type... :/
16:14 moritz_ it could be a collection of enums
16:14 TimToady which are types
16:14 moritz_ yes
16:15 moritz_ and you don't like the idea ;)
16:15 TimToady well, I'm just worried about the poor guy who just wants to write a simple 'die "my message"' without adding an id of some sort
16:16 moritz_ well, it's enough if "builtin" errors have their types
16:17 TimToady we probably allow that, but make it easy to add the id: MyId.die("my message")
16:17 moritz_ there's nothing wrong with using a simple string for an exception if you don't want language independant ways to check against it
16:18 TimToady actually, given that types are coercions, just MyId("my message")
16:18 TimToady assuming exception types know how to coerce from Str
16:19 TimToady I've alway thought that the built-in exceptions should live in package X
16:20 TimToady X::Parsefail("oopsie")
16:20 TimToady well, parse failures are something else really
16:20 TimToady but X::DomainError and such
16:22 SamB joined #perl6
16:22 TimToady if we put them all in Exception or even Error, that discourages people from using them
16:23 TimToady especially in exception handlers
16:24 TimToady or maybe we could put them all into the >< package  :)
16:26 TimToady anyway, feel free to mung .produces into anything else; as I said, it's just a placeholder really
16:30 moritz_ if I knew what you'd want to test against, I could :/
16:30 moritz_ anyway, dinner &
16:45 Maghnus joined #perl6
16:58 larsen_ joined #perl6
17:11 alanhaggai_ joined #Perl6
17:20 zamolxes joined #perl6
17:39 ludan joined #perl6
17:39 Maghnus joined #perl6
17:41 alester joined #perl6
18:04 eternaleye joined #perl6
18:25 rakudo_svn r30828 | pmichaud++ | [rakudo]: Revert r30815 and r30816.
18:26 apeiron_ joined #perl6
18:44 pugs_svn r22173 | lwall++ | [rx.t] use ~~ and subset matching instead of .provides
18:50 eternaleye joined #perl6
18:59 Myoma joined #PERL6
19:02 alester joined #perl6
19:05 bradb joined #perl6
19:11 pugs_svn r22174 | lwall++ | [STD] allow 'where' clauses on bare type names (mostly for ~~ matching)
19:36 IRSeekBot joined #perl6
19:48 pmurias moritz_: language independence for exception only matters if they are relevant to the user
19:58 yahooooo joined #perl6
19:59 ruoso joined #perl6
20:05 alester joined #perl6
20:09 pmurias ruoso: hi
20:11 ruoso hi pmurias
20:11 lambdabot ruoso: You have 1 new message. '/msg lambdabot @messages' to read it.
20:12 ruoso pmurias, do you mean by you having special $interpreter and $scope variables available in m0ld?
20:13 meppl good night
20:14 rakudo_svn r30832 | pmichaud++ | [rakudo]: spectest-progress.csv update: 156 files, 2798 passing tests
20:16 allbery_b joined #perl6
20:17 pmurias ruoso: not just having my $interpreter;my $scope in the top m0ld block and passing them the same way as in Code
20:18 ruoso oh... you mean defining that as a calling convention?
20:18 ruoso that looks fine to me
20:18 pmurias yes
20:19 pmurias once we have a lexical scope we don't have to use ¢
20:22 pmurias ruoso: if you don't implement map in terms of gather/take what do you want to use to create the lazy list/iterator
20:22 pmurias or do you plan to implement map in C?
20:24 ruoso pmurias, it cannot be implemented in C because it has too much recursion...
20:24 ruoso pmurias, have you seen the wiki page?
20:24 ruoso it mostly explains how it's going to work without gather/take
20:25 ruoso and it also should serve as a initial concept model for gather/take
20:25 ruoso it's going to be implemented in C+m0ld, btw
20:29 pmurias why not implement it it terms of gather and take?
20:29 ruoso how does it solve the problem?
20:30 ruoso I mean...
20:31 ruoso this problem might look simple at the beginning, but when you try to figure out how it's going to be translated to actual method calls, it becomes pretty tricky
20:31 Auzon joined #perl6
20:31 pmurias what is the problem?
20:32 ruoso how to iterate the input list without causing eager evaluation?
20:32 ruoso and mix with that what slice context adds in complexity
20:33 ruoso (have you read the wiki page about the SMOP map operator?)
20:33 pmurias yes
20:34 ruoso gather take only solves the part on how the map itself will be lazy
20:34 pmurias twice ;)
20:34 ruoso but not on how to consume the input list lazily
20:38 ruoso pmurias, do you see where the problem is now?
20:38 pmurias yes
20:39 pmurias sub map(@array,&code) { gather {my $i=0;while @array.exists($i) {take code(@array[$i]);$i++} }
20:42 ruoso pmurias, well.. you have an iterator... but you're still using a two-phase iterator API (like the Java api)...
20:42 pmurias pugs: my $sub = sub {say 3};$sub.(3);
20:42 p6eval pugs: OUTPUT[3␤]
20:42 ruoso while you still makes the life of cursor-based iterators harder...
20:42 pmurias pugs: my $sub = sub {say 3};$sub(3);
20:42 p6eval pugs: OUTPUT[3␤]
20:43 ruoso and the other half of what's described on the wiki explains how gather/take would work
20:43 pmurias actually it's sub map(Code $expression,*@values) { gather {my $i=0;while @values.exists($i) {take $expression(@array[$i]);$i++} } }
20:44 ruoso making index-based access is something I'm trying to avoid...
20:44 pmurias ruoso: handling cursor based iterators specialy is just an optimalisation
20:45 ruoso but you're still accessing the iterator making two calls
20:45 ruoso .has_next => .exists and .next => .[]
20:46 ruoso cursor based iterator is not the exception, but the common case, since Perl 6 is mostly lazy
20:47 ruoso feed operators point in that direction too
20:47 pmurias ruoso: i used .exists and .[] because prefix:<=> is not sufficiently specced
20:48 ruoso pmurias, that's the part the wiki page is discussing
20:48 ruoso the other part explains how gather/take would work
20:49 ruoso but when you get to low-level...
20:49 broquaint joined #perl6
20:49 pmurias ruoso: how do you know that prefix:<=> has no more items
20:50 ruoso because prefix:<=> returns a capture
20:50 ruoso or a failure
20:50 pmurias ok
20:51 ruoso when you get to the low-level, implemeting map directly is even simpler than using gather/take
20:52 ruoso because you can have a generic lazy list type that consumes whatever iterator
20:52 pmurias directly means in C/m0ld?
20:52 ruoso yes
20:52 ruoso and gather would also return an iterator
20:52 pmurias are there other lazy imperative languages?
20:53 ruoso heh... I think that's a very unique characteristic of Perl (5 or 6)
20:53 ruoso (not that perl 5 is lazy, but it does inherit functional characteristics in an unique way)
20:56 pmurias only list context is lazy, so we might just stick to item context if it turn out a very bad idea
20:57 ruoso pmurias, that's not really true
20:57 ruoso TimToady agreed that only Void is actually specially eager
20:58 ruoso in item context it can return a lazy scalar that implements prefix:<=>
20:58 yahooooo joined #perl6
20:59 * pmurias searches the spec
20:59 * ruoso dinner &
21:00 pmurias i wonder what inspired all the lazyiness in Perl 6
21:00 PerlJam pmurias: haskell :)
21:02 pmurias haskell is extremly strict when it comes to side effects,
21:03 pmurias it forces my $a=side_effect();other_side_effect($a) style
21:03 Myoma hehe
21:03 Myoma @remember pmurias haskell is extremly strict when it comes to side effects
21:03 lambdabot Okay.
21:04 pmurias by typo is remembered ;(
21:04 Myoma lol
21:04 pmurias * my
21:06 ludan joined #perl6
21:09 alester joined #perl6
21:10 pmurias a dialect of haskell which implicitly added monads would be fun
21:13 lambdabot joined #perl6
21:16 pmurias g'night
21:34 rakudo_svn r30835 | pmichaud++ | [rakudo]:  Restore Code.REJECTS, but have it set $/ like Code.ACCEPTS does.
21:34 rakudo_svn r30835 | pmichaud++ | This is a workaround until we have infix_prefix_meta_operator:<!> implemented.
23:07 bradb left #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo