Check your feather email | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com | www.treehugger.com/files/th_images/paradigm.jpg
Set by rodi on 29 September 2006.
00:01 Psyche^_ joined 00:03 theorbtwo joined 00:06 Psyche^__ joined 00:09 Psyche^__ is now known as Patterner 00:10 rashakil joined 00:11 mjk joined 00:12 Psyche^ joined
mjk sshshushurshuru􏿽xCA􏿽xE4􏿽xC8􏿽xEBzzhzhozhonzhongzhongwzhongwezhongwen􏿽xD6􏿽xD0􏿽xCE􏿽xC4zzozonzongzongszongshzongshi􏿽xD7􏿽xDC􏿽xCA􏿽xC7zzhzhezheyzheyazheyanzheyang􏿽xD5􏿽xE2􏿽xD1􏿽xF9, 00:17
sshshi􏿽xCA􏿽xC7sshsheshemsheshenshenmʲôyyuyuayuanyuanyyuanyiyuanyinԭ􏿽xD2􏿽xF2 ?
00:18 Psyche^ is now known as Patterner 00:22 mjk joined 00:26 rodi joined 00:36 Aankhen`` joined
pasteling "TimToady" at 64.0.7.8 pasted "bad dispatch at #XXX from yaml data, doesn't notice missing class defs!!!" (51 lines, 1K) at sial.org/pbot/20064 00:48
TimToady audreyt: see previous
the Container has a list of kids, but when I call $kid.visit() it ends up calling the parent's visit method, albeit with the kid as invocant. 00:49
I wonder if eval(:lang<yaml>) is defaulting to the last dispatcher class it saw. The bogus classes are properly named via .WHAT, but dispatch to Container despite not being derived from Container in any way. 00:51
anyway, I was tearing my hair out trying to understand how Perl 6 was reading my mind and installing derivations for me. :) 00:52
wolverian is the syntax for defining coercion for your class specced? 00:53
00:53 SubStack joined
TimToady huh? 00:56
wolverian I meant to ask: how do I declare that my class Foo should coerce to True in boolean context? 00:58
audreyt TimToady: methods were installed as subs and valid as failover 00:59
lambdabot audreyt: You have 1 new message. '/msg lambdabot @messages' to read it.
TimToady even when explicitly smd with extra arg? 01:00
audreyt the sub/method distinct dispatch system will be swapped in
the thing is in the sub failover case
it shouldn't even see methods in scope 01:01
TimToady but even with MMD failover, it should have tied between Leaf::visit and Container:visit
audreyt those become totally irrelevant
since it should only consider subs at that point
let me see if there's a simple fix...
TimToady but even without the failover it's calling the wrong visit on the first Item. 01:02
because Item is explicitly derived from Leaf. 01:03
wolverian: something like method true () is deeply { Bool::True } 01:07
wolverian hm. how about saying it's 5 in numeric context? am I right in thinking they're the same class of behaviour? 01:08
TimToady maybe it's multi Bool (MyType $x) { Bool::True } 01:10
and multi Num (MyType $x) { 5 } 01:11
with maybe some "is deeply"s thrown in there
wolverian multi context (MyType $x --> Num) { 5 } # heh 01:12
anyway, thanks :)
TimToady yeah, that's maybe a different approach to "is deeply"
my Foo $x = context($y); # explicitly do some coercion implicitly :) 01:20
my Foo $x = force($y);
my Foo $x = dwim($y)
my Foo $x = *($y)
multi * (MyType $x --> Num) { 5 } 01:21
that's almost cool.
decommutationalizing & 01:24
audreyt TimToady: the dispatch bug is fixed 01:31
clkao hi audreyt
audreyt: will be in pdx 21-26 01:33
audreyt greetings
cool! 01:35
01:44 svnbot6 joined
TimToady yay 01:44
audreyt and even tested :) 02:02
svnbot6 r13739 | audreyt++ | * t/oo/inheritance.t: Add test case for the dispatch bug 02:04
r13739 | audreyt++ | found by TimToady++.
02:06 snowstalker joined
snowstalker Hi, Can you please tell me how long it takes to build pugs? I had started a build yesterday night (in my time zone) and it's been 7 hours and it's still going on... :/ 02:08
Patterner depends on your system... 02:09
snowstalker Patterner, it's a 1.7 GHz machine. 02:11
02:11 revision17_ joined
Patterner i'll time mine and get back to you :) 02:11
snowstalker Patterner, thanks :)
Patterner 1 minute 35 seconds. 02:12
(for svn update :) 02:13
snowstalker Patterner, oh, I was referring to the 'make' 02:15
Patterner i was joking :)
"make" or "make fast"?
snowstalker Patterner, hehe
Patterner, 'make' 02:17
Patterner, Should I try 'make fast' instead?
Patterner it depends. personally i would like to know how many hours make would take. Do you need it compiled right now?
(even "make fast" takes some time) 02:18
snowstalker Patterner, no, I don't have any time constraints, just wanted to spend some time learning Perl 6 this weekend :) 02:20
but if I start 'make', it takes over the whole system and the computer is unusable for me.
Patterner install more RAM 02:22
snowstalker Patterner, yeah, I guess I'll have to do that some time 02:23
Patterner GHC needs more than 640KB :) 02:24
mjk audreyt:can you move to #perlchina channel, i have a question to learn from you 02:29
audreyt mjk: sure I can but, I need to run for a while
please type away 02:30
bbl
mjk audreyt:i wait you
audreyt mjk: mail question to audreyt at audreyt dot net = easier 02:41
Patterner snowstalker: 26 minutes 23 seconds for "make" 02:48
7 hours is far too long for 1.7GHz...
mjk audreyt:thanks, i will email to you
02:50 mauke_ joined 02:54 hikozaemon joined
snowstalker Patterner, hmm, I don't know what's wrong, perhaps I can try make fast 02:54
mjk audreyt:i have email my question to [email@hidden.address] 03:00
audreyt:thank you very much! 03:01
03:05 mauke_ is now known as mauke
Khisanth now for the torrent of spam :) 03:08
03:10 lollan joined 03:21 frederico joined 03:51 Sal joined 04:11 Salzh joined 04:16 Salzh joined
snowstalker Hello folks, is perlcabal.org down? 04:17
(trying to look up www.perlcabal.org/syn/S02.html) 04:18
lambdabot Title: S02
Patterner IT'S ALIVE! 04:37
05:15 BooK__ joined 05:16 rashakil_ joined 05:37 shobadobs joined 05:44 norageek joined 05:55 avar joined 06:09 ^^MAg^^ joined, ^^MAg^^ left 06:26 evil3y3 joined 06:51 norageek joined 07:04 penk joined 07:06 masak joined 07:47 mj41_ joined
audreyt @seen TimToady 07:55
lambdabot TimToady is in #perl6. I last heard TimToady speak 6h 11m 15s ago.
audreyt @tell TimToady I implemented << 'foo' "bar" >> by reparsing 'foo' and "bar" as separate literals; I wonder if we should generally allow all undecorated quote forms inside :ww, that is << `foo` <bar> <<baz>> >> should be legal 07:56
lambdabot Consider it noted.
08:06 iblechbot joined 08:08 Psyche^ joined
audreyt @tell TimToady also, should << foo'$bar'baz >> be one element? 08:08
lambdabot Consider it noted.
08:13 shobadobs_ joined 08:14 Psyche^ is now known as Patterner 08:18 mdiep_ joined 08:22 xerox joined
TimToady audreyt: I'm more inclined to try to keep the insides of <<...>> as close as possible to shell quoting so that it's easier to write portable "shell" scripts even on Windows and such. 08:25
lambdabot TimToady: You have 2 new messages. '/msg lambdabot @messages' to read them.
TimToady back to zzz & 08:27
08:34 marmic joined 08:35 crem joined 08:42 mjk joined
audreyt TimToady: hm, but 08:45
<< "@x[]" >>
interpolates @x, which is not in shell
but ok, I'll admit only "" and '' in q:ww for now 08:46
(though `` may be useful there... not sure)
also, << :!foo >> parsing as a Pair is troubling me
I think
enum << :Mon(1) Tue Wed >>
is better written as 08:47
enum :Mon(1), << Tue Wed >>
08:48 idiotmax joined
audreyt @tell agentzh all of operators/quoting.t now passes except for pair inside <<>> -- I don't feel comfortable with that feature, so will discuss more beore impl 08:54
lambdabot Consider it noted.
08:58 weinig_ joined 09:09 buetow joined
svnbot6 r13740 | audreyt++ | * Much improved quoting handling: 09:21
r13740 | audreyt++ | (t/operators/quoting.t all passes except for :p inside <<>>)
r13740 | audreyt++ | - <<'$foo'>> now never interpolates '$foo'.
r13740 | audreyt++ | - <<"$bar">> now never splits $bar.
r13740 | audreyt++ | - <<$baz>> now splits $baz, but respects non-breaking space as non-breaking.
r13740 | audreyt++ | - q:to/END/ heredocs is now parsed properly.
09:22 lichtkind joined
svnbot6 r13741 | audreyt++ | * Massive cleanup: qw() and q() is no longer quotes but functions, 09:24
r13741 | audreyt++ | and q:to/END/ is now expression-level construct.
r13742 | audreyt++ | * earendil_translations: update version number.
r13743 | audreyt++ | * Pugs.Parser.Program: If the incoming source code did not
r13743 | audreyt++ | end with "\n", append one for it anyway.
r13744 | audreyt++ | * In m:g/(1)|(2)/, only return the successfully matched subcaptures, 09:27
r13744 | audreyt++ | not the unsuccessful ones. This is such that "1212" matched against
r13744 | audreyt++ | the regex will evaluate to ('1', '2', '1', '2'), instead of
r13744 | audreyt++ | ('1', '', '', '2', '1', '', '', '2').
r13745 | audreyt++ | * Nuke t/pil/. The PIL swap-in as the new AST will use MO/Moose's
r13745 | audreyt++ | bootstrap code (which is the nth logical successor to src/PIL/),
r13745 | audreyt++ | not the 0th prototype.
r13746 | audreyt++ | * Detect hsc2hs a bit more correctly. 09:28
09:43 yts joined 10:08 chris2 joined 10:21 penk joined 10:32 count_leto joined
count_leto hi :) 10:32
10:45 jiing joined 10:48 Southen joined 11:01 jferrero joined
masak audreyt: am I interpreting the change in r13741 correctly as qw() and q() no longer being quoting constructs? 11:05
is there a rationale preceding that change? (just curious) 11:09
11:18 tretboot joined 11:23 xinming__ joined 11:35 tretboot left 11:37 wilx joined 11:49 chris2 joined 11:52 elmex joined 12:02 iblechbot joined
audreyt masak: I don't quite feel strongly about that change 12:38
in fact I find it mildly surprising coming rom p5
but it's consistent.
masak audreyt: I see
audreyt I don't know of the rationale behind the S02 change
running "svn praise S02"... 12:39
masak audreyt: skimming the logs for a rationale, I discovered the probable reason for having been given an admin bit for pugs the other day :)
and I also figured out what I'm supposed to do with it
audreyt yeah, because you're around a lot :) 12:40
cool!
12:40 lisppaste3 joined
audreyt r15371 (orig r9733): larry | 2006-07-02 04:55:09 +0800 12:41
Clarification of differences between quote and macro declarations, Markus++.
apparently malaire++ is to blame
I mean, to praise
masak :)
audreyt or to annotate
masak *lol* 12:42
I see. well, qw() is less needed now when we have <>
audreyt indeed
masak still, it is surprising to p5ers
audreyt and a somewhat handy and well-implemented << >>
masak is << >> to < > as "" is to ''?
audreyt ?eval << a b 'c d {1+1}' "e f g {1+1}" >>
12:43 evalbot_r13730 is now known as evalbot_r13746
evalbot_r13746 ("a", "b", "c d \{1+1}", "e f g 2") 12:43
audreyt it's even more magickal
masak oh, in what way?
audreyt see the treatment of '' and "" above
shellish quoting
masak hm. not sure i grok the implications 12:44
audreyt ?eval my $x = "two words"; << $x '$x' "$x" >>
evalbot_r13746 ("two", "words", "\$x", "two words")
masak ah!
masak sees now
I think
audreyt you think correctly :)
or rather, you thunk correctly
masak so, I'd use "$x" within << >> when I don't want to split an interpolated string into several elements... 12:46
audreyt exactly
even more magically:
?eval my $x = "two words"; << !$x! !'$x'! !"$x"! >>
evalbot_r13746 ("!two", "words!", "!\$x!", "!two words!")
audreyt as you can see it's very handy :) 12:47
masak hm :)
I can see how it's a nice feature, it's just that it's several layers of abstraction beyond what I use on a daily basis, so I'm in a bad spot to evaluate its use
it's not like: "I know, a 'switch' is the perfect tool for this problem" 12:48
for some reason, I can't see myself going: "hm, I need to interpolate this string within a << >> while still keeping it as one element" :) 12:49
audreyt you don't do a lot of shell programming, do you :) 12:50
masak well, no :)
but that made me understand its use better
I do some command-line hackery sometimes
and quoting comes in there
thanks for careful explanations 12:51
audreyt no prob
masak btw, somewhat OT-ly, I'm learning chinese this semester! 12:52
audreyt for detailed rationale, ask TimToady++, I'm just this coding moneky... :)
cool! @ uni?
masak yes
audreyt as a foriegn language course?
masak @tell larry what is the rationale behind removing qw() as a quoting construct? (just curious) 12:53
lambdabot Consider it noted.
masak audreyt: yes. I started a few weeks ago
we've been crammed full of grammar and history so far
first chapter this Wednesday, four weeks into the course
audreyt oy. you don't want to learn grammar-first...
masak well, opinions diverge there 12:54
I kinda like it, being grammar-oriented
audreyt *nod* it makes sense if you're going to use mostly written chinese
masak it prepares me for seeing the patterns IRL later
I'm hoping to use both a lot
audreyt excellent
masak chinese is the first language that makes good on its promise of being hard 12:55
well, that and haskell :)
I'm sort of a little scared after reading this... pinyin.info/readings/texts/moser.html 12:56
lambdabot Title: Why Chinese Is So Damn Hard
audreyt ooh, is this moser who I think he is? 12:57
...yes
masak who is it?
I haven't hear of him
audreyt Douglas Hofstadter mentioned him a lot in Le Ton Beau De Marot 12:58
gaal drh's pal?
heh
audreyt one of my fav books
12:58 ofer0 joined
masak checks the book out 12:58
audreyt also "To Err Is Human: To Study Errors is Cognitive Science" and "This Is the Title of This Story, Which Is Also Found Several Times in the Story Itself" 12:59
masak can't believe there's a hofstadter book I haven't heard about
oh. the latter rings a bell
gaal i believe he's also mentioned in metamagical themas. which is also pretty good.
masak yes 13:00
xerox What Hofstadter book?
audreyt xerox: Le Ton Beau De Marot, aka the Chickadee book
13:00 Salzh joined
pasteling "masak" at 130.238.83.176 pasted "the best part, and the one that shook me the most, from "Why Chinese Is So Damn Hard"... I always wanted to be able to read the classics :/" (15 lines, 980B) at sial.org/pbot/20074 13:01
13:01 ludan joined
gaal "A passage in classical Chinese can be understood only if you 13:01
already know what the passage says in the first place"
hey, that sounds like unix man pages!
xerox O_o 13:02
audreyt hrm
that's not quite true...
masak exhales
audreyt it's true that to understand all interpretations of it you need a lot of context
masak of course
as with all old texts
audreyt but if you just want to have a gestalt idea, especially if it's literature work, then it just takes liberal imagination 13:03
masak cool! I have that
audreyt because The Author Is Dead (for centuries), that approach is not only more fruitful, sometimes it's the only sane approach :)
masak right 13:04
masak pushes on with the character studies with new hope
I've memorised maybe 20 so far...
audreyt 1k will get you very far
masak they already feel like friends
audreyt e.g. newspapers, etc
masak I'd like to get to know the radicals really well, tho' 13:05
thinking of making a nice desktop background with all radicals and their meaning
audreyt: I've heard people claiming the opposite lately. Moser, for one 13:06
he says that the more uncommon characters are the one's which are often most important in a text
audreyt all, as in nearly 200?
masak yes
audreyt that is correct
masak should be able to fit that on-screen, I think
audreyt as with english, less frequent words are keywords
masak while not making it too cluttered
audreyt good news is you just need to look a few of them up from a dictionary :) 13:07
masak audreyt: and besides, it's the combinations of characters that is more important
audreyt and they are the least ambiguous
masak and there are very many combinations...
audreyt unlikes common words, which form one-char phrases
and can have dozens of context-dependent meanings...
masak audreyt: true. I'm still quite hopeful, and looking forward to when I can pick up a newspaper in chinese and read some of it 13:08
audreyt multichar phrases almost always have specific meanings that can easily be looked up
masak another article says there's a real need for a change in chinese wordbook paradigms
sec
gaal there's no marking that a phrase is multichare though, is there?
that is, lexing is hard 13:09
audreyt no but you can ues my Lingua::Zh::Toke...
masak www.sino-platonic.org/abstracts/spp...aries.html
audreyt which features overloading of @{} %{} <> etc
%{} is histogram iirc ;)
masak just found a treasure trove of modules in the Lingua::Zh namespace 13:10
cool 13:11
lambdabot Title: Chinese dictionary review, tinyurl.com/api-create.php?url=http...t;BODY>
audreyt Encode::HanConvert is one of my more popular modules :)
masak audreyt: I'll have a look :) 13:12
audreyt: when you answer "test triaging" in response to "what can be done to help along with the next pugs release?", what does that mean? besides running the tests on the last rev of pugs, I mean 13:14
audreyt it means look at smoke matrix 13:15
in particular the failures
pasteling "audreyt" at 220.135.90.73 pasted "triage targets" (82 lines, 4.2K) at sial.org/pbot/20075 13:16
audreyt I'm moving from bottom up
so pick a point and move down
masak :)
gladly
audreyt woot 13:17
if the error is at the end
likely nonregressions
then simply :todo<feature> them as needed
masak right
can do
audreyt if they are regressions, try to find out if they are not buggy tests
and if so fix the tests :)
s/not/actually/
masak oki 13:18
13:22 zakharyas joined
audreyt hm 13:30
@a[0] := $x
lambdabot Unknown command, try @list 13:31
audreyt the lhs of := is not valid Signature expression, is it?
audreyt ponders how to reconcile this
easiest way: allow that in a signature ;) 13:32
sub f (@a[0], @a[1]) { ... }
maybe insane...
masak when would one want to use that?
audreyt when creating views, presumably
masak fair enough 13:33
audreyt maybe not worth keeping
none of the spec text uses this form
marking as unspecced.
masak there should be a tool for mapping test numbers to the corresponding lines in the test file 13:35
TimToady @messages 13:36
lambdabot audreyt said 5h 39m 37s ago: I implemented << 'foo' "bar" >> by reparsing 'foo' and "bar" as separate literals; I wonder if we should generally allow all undecorated quote forms inside :ww, that is <
< `foo` <bar> <<baz>> >> should be legal
audreyt said 5h 27m 49s ago: also, should << foo'$bar'baz >> be one element?
masak TimToady: ...and I accidentally gave someone whose nick was "larry" the following message, meant for you: 13:37
"what is the rationale behind removing qw() as a quoting construct? (just curious)"
TimToady it's ugly, it doesn't compose like <...>, and we didn't remove it. 13:39
masak :)
TimToady qw// still works, as does qw ()
masak but not qw()? 13:40
TimToady but qw() itself looks like a function call, so that's what it is.
masak I always thought of it as a function call
SamB so, since ;-) looks like a smiley face, is it one of those too?
masak only that qw is a special kind of function
TimToady sure is. just not in Perl
masak TimToady: but I'm not really complaining about the change... I think it's good once one gets past the p5 discrepancy of it 13:41
TimToady one could say that about a lot of thins. :)
our goal is to surprise p5 programmers on a surface level and delight them on a deeper level. 13:42
SamB but not about Py2k, IMO...
SamB does not like Guido's attitude towards FP 13:43
TimToady well, gotta run, and don't know if I'll have connectivity for the next N hours...
masak TimToady: as for me, I'm delighted on the deeper level. thx
TimToady (taking Lewis to a quiz meet at an unfamiliar church, so don't know if they have wireless...) 13:44
yw!
afk &
pasteling "masak" at 130.238.83.176 pasted "what's the test output supposed to look like? I get the this after putting a "force_todo 7 .. 12" in the beginning of the test file, is that normal?" (17 lines, 913B) at sial.org/pbot/20076 13:57
audreyt no... you need to try{} a fatal error 14:00
masak oh, ok 14:03
the whole block, or just that line? 14:04
ajs_home One more question about bareword constants like pi... how do they behave inside :adverb<pi> ? 14:05
masak is there a common practice for making sure the planned number of tests are run even if the try exits prematurely? 14:06
audreyt try should't exit...
if it's parsefail then use eval 14:07
ajs_home: constants are just functions
masak audreyt: it's not a parsefail, it's a runtime error 14:08
14:08 mako132_ joined
masak I'm about to commit putting a try on the line with the assignment, that at least clears things up more than before... 14:08
14:09 Limbic_Region joined
ajs_home audreyt: Right, so it would have to be :adverb<pi()> ? 14:09
or :adverb<true()>
svnbot6 r13747 | masak++ | [t/data_types/array_extending.t] 14:11
r13747 | masak++ | * put a try block around an assignment which blew the test file out of the water
audreyt ajs_home: :adverb(pi) 14:12
<> wouldn't work
ajs_home Ah right
forgot () worked on adverbs entirely
thanks, I feel better
audreyt Glad to provide you with potion of healing
t/operators/ triaged. bbiab... 14:13
ajs_home Is Bool::True the canonical truth for code examples? If I need to show a Bool adverb being called, should I write ":terror(Bool::True)" or is there some "true" type thing? 14:14
svnbot6 r13748 | lanny++ | * Bring t/unspecced/sort.t into line with latest S29
SamB ?eval 1 < 2 14:16
evalbot_r13746 Bool::True
audreyt ajs_home: :terror is sufficient
:terror(True) is okay
14:16 bradb joined
audreyt but you really just want :terror 14:16
use :!terror for the False case
ajs_home Oh nice. Thanks.
14:17 lanny joined, loumz joined
lanny @tell agentzh Smoke Syns are acting up again. :/ 14:18
lambdabot Consider it noted.
ajs_home That will make the Unicode normalization examples much easier, since there are essentially two boolean parameters, though the Unicode documentation insists on calling it four different functions :(
masak ?eval my @array = <a b c>; my $arglist = try { \(@array) }; my sub foo (@arr) { ~@arr }; try { &foo.call($arglist) } 14:20
14:20 evalbot_r13746 is now known as evalbot_r13748
evalbot_r13748 undef 14:20
masak yes, that's what the test becomes, too :(
masak marks it as :todo<feature>
though I have no proof that it's not really a regression 14:21
it's subtest 5 out of 18, but many of the others are marked :todo<feature>
lanny Didn't that one get reworked with the Capture | ? &foo.call(|$arglist); 14:23
Looking it up
audreyt &foo.call($arglist) is canonical
as .call takes the unflattened Capture 14:24
:todo<feature> is also correct.
masak ?eval my $ref = { val => 42 }; say $ref[0] # should die trying to access the hash as an array, but doesn't 14:25
evalbot_r13748 OUTPUT[val42 ] Bool::True
lanny aha. Found the S02 was gonna hit S06 next. @audreyt is easier.
masak leaving that test in place, failing, because it's likely a regression
14:26 foo\ joined
audreyt *nod* 14:26
masak ?eval my $foo = 42; ($foo, "does_not_matter")[0] =:= $foo # should be Bool::True, but isn't 14:28
evalbot_r13748 Bool::False
masak maybe this is the time for me to finally learn enough Haskell to hunt those bugs down...
it sure is tempting
audreyt I'd be thrilled to help! 14:29
er, the [0] =:= thing.
it's currently not clear that you can := into [0]
it's unspecced and of dubious usefulness
so all =:= involving subscripts is :todo<unspecced> 14:30
masak gotcha
marking it as such
?eval my $pair = :when<now>; (%$pair).does(Hash) # should be Bool::True, but pugs says Bool::False (or parsefails on the command line) 14:35
evalbot_r13748 Bool::False
lanny ?eval ((1,2),(3,4))
evalbot_r13748 (1, 2, 3, 4)
lanny ?eval zip(1,2;3,4)
evalbot_r13748 ((1, 2, 3, 4),)
masak evalbot_r13748: ah, the parsefail was me -- I forgot to escape the % from within vim
I really shouldn't be talking with bots 14:36
Juerd Good afternoon
masak hiya
lanny ?eval my @a = (1,2); my @b = (3,4); zip(@a;@b) 14:37
evalbot_r13748 ((1, 3), (2, 4))
Juerd I went to a party last night. There are always a few software developers. I told someone about Perl 6.
lanny ?eval zip((1,2);(3,4))
evalbot_r13748 ((1, 3), (2, 4))
Juerd "Huh, how can you improve a switch statement? It's already perfect."
So I showed examples of given/when.
"Whoa - that's pretty cool!"
lanny Is there any way to build a list of lists without having them flatten using literals? 14:38
Juerd It can be amazing how people are used so to living with a lot of limitations that they can't even come up with this (to me, rather logical and obvious) stuff themselves :)
lanny: A list of ... lists? Why not arrays?
lanny Just trying to match the output of zip. 14:39
Juerd Match?
lanny I guess I could use zip but that would be silly to test something against it's own call. lists/zip.t has a buggy test. Trying to fix it.
svnbot6 r13749 | masak++ | [t/data_types/lists.t]
r13749 | masak++ | * marked to tests as :todo<unspecced>
r13749 | masak++ | [t/data_types/capture.t]
r13749 | masak++ | * marked one test as :todo<feature>
r13749 | masak++ | * now done triaging t/data_types, moving on to t/examples
Juerd I'm not sure I know what a "list" is, really. 14:40
I know:
lanny ?eval zip((1,2);(3,4))
evalbot_r13748 ((1, 3), (2, 4))
Juerd * lists - whatever is in list context
* feeds
* arrays
Limbic_Region Juerd - not so amazing to me. Humans want familiarity - it makes them feel safe. In any browser, OS, editor war - the side someone is fighting for has plenty of problems but the person fighting for it has become used to them and no longer notices them. IOW - best to live with known evils.
lanny No. For instance list(1) says 1 is in list context but it's not a list. 14:41
Juerd I don't get how ((1,3),(2,4)) is possible, as that flattens to one list...
lanny It's the result of a zip()
I thought it should flatten too but Pugs seems perfectly happy carrying it around as a result.
Juerd I thought ((1,3),(2,4)) is (1,3,2,4) in list context, and [[1,3],[2,4]] in item context.
lanny If I assign it to something I'll bet it flattens
Juerd So I can't really think of what nested parens would mean here. 14:42
lanny ?eval my @a=(0,4); my @b=(2,6); my @c=(1,3,5,7); my @z = zip(zip(@a;@b);@c); @z 14:43
evalbot_r13748 [((0, 2), 1), ((4, 6), 3), (undef, 5), (undef, 7)]
lanny So not flattening
Juerd I see that it does that, but I don't know how to read it.
Or how it would make universal sense. 14:44
lanny Well lists and arrays are different now. So this is a situation where you are able to stuff a list of list in another container before it flattens
It makes perfect sense since zip returns list-tuples as its result.
Juerd Lists and arrays were different in Perl 5, but there a list could only be in list context. Something not in list context wouldn't be a list. 14:45
Limbic_Region audreyt ping
Juerd How do you create a list then? Surely the syntax evalbot outputs can't be it, as that would flatten in list context, and create arrays in item context.
Limbic_Region I go to Java class for 4 days and Win32 pugs goes to hell in a handbasket
Juerd Or am I wrong about that?
Limbic_Region: That should teach you. 14:46
Limbic_Region . o O ( he says very jokingly )
lanny So I don't know if it's Perl 6 but Pugs has no problem keeping them (Lists of lists) around
Limbic_Region it is however not working on Win32
Juerd lanny: I see that.
I think it's not Perl 6.
I could be wrong, of course.
lanny I think it might be but I'm with you on could be wrong. 14:47
Juerd still thinks that W operators should NOT return arrays instead of lists in item context, including comma
lanny Well I think it's an artifact of zip here but I think it's an artifact that's supposed to be here 14:48
?eval my @a=(0,4); my @b=(2,6); my @c=(1,3,5,7); my @z = zip(zip(@a;@b);@c); @z[0]
14:49 evalbot_r13748 is now known as evalbot_r13749
evalbot_r13749 [(0, 2), 1] 14:49
lanny Reminds me of Lisp. We should keep it since it followed us home.
?eval my @a=(0,4); my @b=(2,6); my @c=(1,3,5,7); my @z = zip(zip(@a;@b);@c); @z[0,1] 14:50
evalbot_r13749 [((0, 2), 1), ((4, 6), 3)]
Limbic_Region @tell audreyt running make smoke on Win32 results in pugs blowing up on almost every single test
lambdabot Consider it noted.
masak ?eval map -> $num { map -> $suit { { num => $num, val => $num > 10 ?? 10 !! $num, suit => $suit } }, <H D C S>; }, 1..13; # this parsefails in pugs right now in examples/cribbage_scoring.pl, how should it be written? 14:51
evalbot_r13749 pugs: internal error: startTask: Can't create new task Please report this as a compiler bug. See: www.haskell.org/ghc/reportabug
lambdabot Title: 1.2. Reporting bugs in GHC
masak whoa
sorry, GHC, didn't mean to
Limbic_Region masak - cribbage_scoring.pl was never parseable
masak Limbic_Region: whee! 14:52
so there's nothing I can do?
Limbic_Region it was written a long while back
masak - there is
14:52 Salzh joined
Limbic_Region figure out the intent of the code, determine if it is valid syntax 14:52
lanny ?eval [((0, 2), 1), ((4, 6), 3), (undef, 5), (undef, 7)]
evalbot_r13749 [0, 2, 1, 4, 6, 3, undef, 5, undef, 7]
Limbic_Region if it is - write failing tests
if not - rewrite using valid syntax
lanny Interesting.
masak Limbic_Region: well, rewriting using valid syntax is my goal -- hence the question above: "how should it [the nested map expression] be written?" 14:53
do we still have map { expr }, @array?
Limbic_Region doesn't keep up with the synopses well enough to know what is valid and what isn't without looking it up 14:54
masak or is it written exclusively with colons nowadays?
Limbic_Region no comma needed in that form
masak not even in p6? :)
p6 is more regular in that regard
Limbic_Region ?eval my @foo = map { uc($_) } 'a' .. 'z'; ~@foo;
evalbot_r13749 Error: Unexpected "'" expecting comment, ",", ":", operator, statement modifier, ";" or end of input
masak if no comma, then at least a colon or sum'n
Limbic_Region ?eval my @foo = map { uc($_) }, 'a' .. 'z'; ~@foo; 14:55
evalbot_r13749 "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
Limbic_Region ok - comma is needed and yes - it still works
masak ?eval my @foo = map :{ uc($_) } 'a' ... 'z'; ~@foo
evalbot_r13749 Error: Unexpected "'" expecting operator, ":", ",", comment, statement modifier, ";" or end of input
14:55 bradb left
masak hm 14:55
Limbic_Region ?eval my @foo = ('a'..'z').map{ uc($_) }; ~@foo; 14:56
masak I know I've seen something with a colon
evalbot_r13749 Error: Cannot cast from VList [] to Pugs.AST.Internals.VCode (VCode)
mauke ?eval my @foo = map { uc($_) } :'a' ... 'z'; ~@foo
evalbot_r13749 Error: Unexpected "'" expecting operator, ":", ",", comment, statement modifier, ";" or end of input
Limbic_Region ?eval my @foo = ('a'..'z'):map{ uc($_) }; ~@foo;
evalbot_r13749 Error: Unexpected ":" expecting term postfix, comment, operator, ",", statement modifier, ";" or end of input
Limbic_Region wishes mauke good luck
err uh masak even 14:57
lanny masak: that double map works for me
masak lanny: which one?
the parsefailing one?
lanny The big one you said parsefails
masak ah
audreyt ('a'..'z').map:{} 14:58
lambdabot audreyt: You have 2 new messages. '/msg lambdabot @messages' to read them.
masak which revision pugs are you using?
audreyt: thx
lanny Version: 6.2.12 (r13749)
Limbic_Region me too - and it is terribly b0rk on Win32
masak that's the latest one 14:59
?eval my @foo = ('a'..'z').map:{ uc($_) }; ~@foo'
evalbot_r13749 Error: Unexpected "'" expecting "::", term postfix, comment, operator, statement modifier, ";" or end of input
masak this should work, right?
audreyt: is there a non-dot form with a colon, too? 15:00
audreyt prolly not
lanny ?eval zip((1,3);(2,4))
evalbot_r13749 ((1, 2), (3, 4))
lanny audreyt: Should that list of lists exist? Seems like the correct output of zip() but surprising. 15:01
masak audreyt: oh, I seem to remember having seen one. did it really never exist, or only never in the 1984 sense? :)
audreyt in the 1984 sense
lanny: each() is the flatten form
masak: that should work except you had a trailing ' after @foo 15:02
lanny Ok. Good to (be reminded) know.
masak blushes
?eval my @foo = ('a'..'z').map:{ uc($_) }; ~@foo
evalbot_r13749 "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
masak huh
Limbic_Region audreyt - not sure how to debug why Pugs is blowing up on Win32. Windows is giving me a popup that pugs has encountered problems and must terminate - no output to stderr or stdout 15:03
masak rewrites cribbage_scoring.pl
Limbic_Region -d is of no help
pugs -e "say 'hello, world'" # works fine though 15:04
audreyt hrm. which ghc are you using? 15:05
ghc -head was broken for a week or so
Limbic_Region ghc is from about the 9th
and had previously been working fine
IOW - I haven't changed the ghc, just pugs 15:06
audreyt so it's a pugsbug... hm
lanny audreyt: is there a way to create that list of lists above using literals? I ask trying to fix a test in zip.t
audreyt so say is working fine
what's a minimal non-fine case?
Limbic_Region would you prefer something from t/ or ext/
since ext/ comes first in smoke 15:07
I know more of those tests
but could easily find something in t/
svnbot6 r13750 | masak++ | [examples/cribbage_scoring.pl]
r13750 | masak++ | * threw around some syntax to make map calls work :)
r13750 | masak++ | * now it parsefails somewhere else instead :/
audreyt lanny: test for stringification perhaps?
Limbic_Region: I prefer something reduceable to -e
I suspect p5embed
masak afk & # there's an emergency at my local sushi place, they need me to come and pick stuff up
audreyt perl -e "say /./" 15:08
does that work?
Limbic_Region audreyt - testing
lanny It's doing that now and getting it wrong. The only way I can see to test right now is run the zip(zip(@a;@b); @c) twice and test against each other. That's hardly a real test.
Limbic_Region <Regex>
yep - works
xinming__ audreyt: Hello, What will you do on national day? :-P
audreyt perl -e "say 1 ~~ /./"
audreyt mumbles something about not having loyalty for nations 15:09
Limbic_Region: try that?
lanny I'll p6l it. There really shouldn't be a construct you can create that you can't make as literals as well.
audreyt there's a canonical way
namely Seq(Seq(1,2);Seq(3,4))
Limbic_Region audreyt - assuming you mean pugs and not perl
that doesn't work 15:10
audreyt but that's not yet available
Limbic_Region but doesn't cause the windows level error
audreyt Limbic_Region: segfaults?
Limbic_Region I get output
lanny Ok. I'll switch the test to that and todo it. :)
Limbic_Region *** Cannot parse regex: .'
audreyt lanny: good :)
15:10 MacVince joined
Limbic_Region *** Error: Error: Can't locate object method "__RUN__" via package "Pugs::Runtime::Match::HsBridge". 15:10
audreyt Limbic_Region: that's all? no other explanations?
ah. there we go
Limbic_Region those 2 lines
MacVince Will Perl 6 have an easy way to compare complexe arrays and hashes? 15:11
lanny MacVince: see eqv()
MacVince lanny: thanks. 15:12
audreyt Limbic_Region: try this line
perl -Iperl5/Pugs-Compiler-Rule/lib -MPugs::Runtime::Match::HsBridge -e "warn Pugs::Runtime::Match::HsBridge->__RUN__(1,q[.])"
Limbic_Region did you mean perl or pugs? 15:13
perl blows up about not finding some stuff 15:14
will nopaste
perlbot nopaste
perlbot Paste your code here and #<channel> will be able to view it: sial.org/pbot/<channel>
audreyt I mean perl this time :) 15:15
15:15 justatheory joined
pasteling "Limbic_Region" at 24.35.57.240 pasted "perl output" (13 lines, 888B) at sial.org/pbot/20078 15:15
audreyt oy, someone is being naughty
fglock: this doesn't dwym: eval { use YAML::Syck }; 15:16
audreyt changes that to require
Limbic_Region audreyt - I think just trying to use Test; is causing the windows level blowup
audreyt Limbic_Region: try again? no recompile needed
svnbot6 r13751 | audreyt++ | * Pugs::Runtime::Match: Load YAML::Syck at runtime only when needed. 15:17
audreyt Limbic_Region: oh? hm.
rm blib6/lib/Test.pm.yml ?
Limbic_Region PGE_Match 0 1 [] [] at -e line 1.
so that looks good
audreyt yup 15:18
Limbic_Region let me test my Test theory
and then your potential fix
pugs -Iblib6/lib -e "use Test;" # sufficient to cause windows to blow up (testing removal of Test.pm.yml now) 15:19
and now all is right in the world
;-)
Limbic_Region runs a smoke
svnbot6 r13752 | audreyt++ | * Support for postfix reduction forms: 15:20
r13752 | audreyt++ | [+]<<
r13752 | audreyt++ | [\+]<<
r13752 | audreyt++ | [>>+<<]<<
r13752 | audreyt++ | [>>\+<<]<<
Limbic_Region running smoke of 13752 - thanks audreyt++ 15:22
now if you have time for a question
svnbot6 r13753 | audreyt++ | * triaging of t/operators/.
Limbic_Region in p5 - I could create a dispatch table of code refs and inside a while () { ... } block call one of those coderefs 15:24
and if that code ref had a last
the last worked on the while () { ... } block
and this worked in pugs too - for some time
but I was just testing examples/progessive_powerset.pl
and discovered that this doesn't work any longer 15:25
I can see how to work around it - kludgely
is there a more elegant way than
checking the return of the code ref
and if 'last' than last inside the while () { ... } block itself? 15:26
audreyt hm. the reason last diddn't work was because it's not really throwing a control exception
but indtead we bind &last inside the while
now you mentioned it that was indeed a very wrong way
please write a todo<bug> test
Limbic_Region audreyt - happy to except I am not sure which is correct behavior
audreyt p5 is 15:27
as for workaround - two ways. one is to put the table construction inside the while
Limbic_Region should the code in examples/progressive_powerset.pl work?
audreyt that will let it bind the correct &last
one is to check for rv and last, as you said
Limbic_Region I don't really like either of those ways
the first defeats the purpose of the dispatch table in the first place
the second just isn't pretty - but I can live with it 15:28
audreyt you can use "fail" and try{}
but write a test definitely; I wasn't realizing we were doing it wrong
svnbot6 r13754 | lanny++ | [zip.t]
r13754 | lanny++ | * fixed test trying to use array to match zip(zip(@a;@b);@c);
r13754 | lanny++ | * :todo :depends<Seq> same test
r13754 | lanny++ | * modified test text indicating a bug. text now explains the regression
Limbic_Region audreyt - so the p5 behavior is correct
audreyt aye 15:29
Limbic_Region a code ref executed inside a while block that invokes last should work on the while block not the code ref (provided it isn't inside a loop construct in the code ref)?
audreyt that is correct. 15:30
lanny Limbic_Region: You might be able to leave TAG; I think I did that in sort.t inside a closure.
audreyt I don't recall mplementing leave :)
Limbic_Region hrm - I would think that the p5 behavior was wrong
audreyt Limbic_Region: think of next/redo/last as throwing exceptions 15:31
not invoking lexical escape continuations
Limbic_Region ok - so lets walk through this so I can understand
lanny Hmm. I'm 95% sure I tested it in isolation and it seemed to be doing the right thing.
Limbic_Region my example (in my mind) is equivalent to
audreyt sub call_last { last } while 1 { call_last() } 15:32
sub call_last { last }; while 1 { call_last() }
Limbic_Region sub foobar { # ... some code; last; # using last to exit a sub is wrong } while ($cond) { # ... foobar(); # uses last # ... more statements }
yeah 15:33
audreyt last-to-exit-a-sub is a warning , true
or should be one, at any rate
but it still works 15:34
Limbic_Region so last throws an exception caught at the sub level - the sub level realizes it needs to re-throw it so it can be handled by the loop construct?
audreyt (I need to crash into sleepiness very soon)
yes.
Bit's equiv to
Limbic_Region will write the test then
still feels like I am abusing behavior but am happy to write the test
audreyt leave Loop; 15:35
which reminds me, I need to subclass Block into Loop
Limbic_Region is glad he is good for something
;-)
audreyt you're good for lots of things :) 15:36
Limbic_Region well - I am probably going to be spending more time on Java (and possibly Haskell) then on p6 for a while
lanny Glad I qualified my having tested in isolation. :/
audreyt ...you rolled a 1 in 1d20 :) 15:37
Limbic_Region audreyt - fwiw, I needed to re-delete blib6/lib/Test.pm.yml after svn uping and making
pasteling "lanny" at 206.109.40.208 pasted "leave LOOP;" (11 lines, 240B) at sial.org/pbot/20079
lanny Is what I was aiming at. 15:38
audreyt Limbic_Region: seems yaml loading is broken on win32 somehow
lanny Was very useful in my fevered imagination. :)
audreyt Limbic_Region: can you upload your pugs.exe somewhere?
I can maybe look at it tomorrow
Limbic_Region audreyt - yep - can put it in my home directory on feather
audreyt also file a hiveminder.com ticket for that :)
Juerd sub infix:<d> ($num, $size) { ^$num.map:{ 1 + int rand $size } }
audreyt Limbic_Region++
I need to run now... *wave* 15:39
Limbic_Region going to finish the smoke first
sleep well
Juerd ? eval sub infix:<d> ($num, $size) { ^$num.map:{ 1 + int rand $size } }; 5 d 3
audreyt Juerd++
Juerd ?eval sub infix:<d> ($num, $size) { ^$num.map:{ 1 + int rand $size } }; 5 d 3
15:39 evalbot_r13749 is now known as evalbot_r13751
evalbot_r13751 (0.0,) 15:39
Juerd Holy crap, it can parse that?!
audreyt you want a [+]
lanny Why not?
Juerd Oh, right. I need .sum ;)
wolverian isn't prefix ^ metaclass stuff?
Juerd ?eval sub infix:<d> ($num, $size) { [+] ^$num.map:{ 1 + int rand $size } }; 5 d 3 15:40
evalbot_r13751 0.0
Juerd ? eval 1 + int rand $size
I'm too used to hitting spacebar after ?.
?eval 1 + int rand $size
evalbot_r13751 Error: Undeclared variable: "$size"
Juerd D'oh.
?eval 1 + int rand 5
evalbot_r13751 2
Juerd ?eval ^3
audreyt ?eval sub infix:<d> ($num, $size) { [+] map { 1 + rand($size).int }, ^$num }; 10 d 6
evalbot_r13751 (0.0, 1.0, 2.0)
37
MacVince ? eval undef err "Oh noes!"
Juerd Why does ^$num.map:{ ... } not work? Predecence? 15:41
audreyt 37 is pretty good for a fireball
yeah. (^$num).map would work
Juerd Oh. Is this intended?
lanny Juerd: What is the ^$num ?
Juerd lanny: 0..$num.
MacVince ? eval undef err say "undefined"
Juerd lanny: I don't really like it, and would prefer that we get XX instead.
lanny You're kidding! :)
audreyt Juerd: intentional. think (int $foo.moose) 15:42
.moose gets run first, not int
for I think good reasons
Juerd { 1 + int rand $size } XX 5
Eh, $num
lanny I would think 0..$num would be a lot clearer.
masak MacVince: you shouldn't use a space after the "?"
MacVince masak: okay
Juerd audreyt: Eh, the intended was referring to ^ binding so loosely.
MacVince ?eval undef err say "undefined"
evalbot_r13751 OUTPUT[undefined ] Bool::True
masak MacVince: and "say" isn't really needed in ?eval
MacVince ?eval undef err "undefined"
evalbot_r13751 "undefined"
MacVince Cool, thanks masak
masak np 15:43
audreyt Juerd: I was replying to that; no prefix op binds tighter than method
except for prefix sigil op on a sigilled var, and that doesn't count because it's parsed as var.
Limbic_Region audreyt - pugs.exe uploaded and hiveminder reminder set - writing failing last test now
MacVince ?eval ([1,2,3], [4, 5, [6]]) eqv ([1,2,3], [4,5,[7]])
audreyt Limbic_Region++
evalbot_r13751 Bool::False
MacVince ?eval ([1,2,3], [4, 5, [6]]) eqv ([1,2,3], [4,5,[6]]) 15:44
audreyt Juerd: $num.'^'.map:{...} will get you that... maybe tomorrow I'll implement it
evalbot_r13751 Bool::False
MacVince Limbic_Region: are you Jesse Vincent, the guy behind hiveminder?
Juerd audreyt: Ahh, I see. I think that's a bit unfortunate, but it's understandable.
MacVince Hmmm....
audreyt MacVince: recursive comparison is better done by comparing .perl
Juerd MacVince: No, that's obra
audreyt: I still don't like '^' as a syntax. '' reminds me of strings!
audreyt Juerd: the only way to make ^$num.map work is... make it a sigil!
MacVince audreyt: .perl is the representation of a data structure, right?
audreyt MacVince: it is. 15:45
Juerd audreyt: I'm convinced. Let's use parens :)
MacVince ?eval (1,2,[3,4]).perl
15:45 evalbot_r13751 is now known as evalbot_r13753
evalbot_r13753 "(1, 2, [3, 4])" 15:45
Juerd (re sigil, not re '^')
audreyt good. now I can rest in pieces
:) &
lanny MacVince: sub infix:<eqp> ($a,$b) { $a.perl eq $b.perl; }
Juerd Good night, audreyt
MacVince ?eval (1,2,3).perl eq ~(1,2,3) 15:46
evalbot_r13753 Bool::False
masak 'night, audreyt
MacVince ?eval (1,2,3).perl
evalbot_r13753 "(1, 2, 3)"
MacVince ?eval ~(1,2,3)
evalbot_r13753 "1 2 3"
masak :)
MacVince Ah!
repl++
lanny Oh good. ^$num is 0..^$num. Was gonna be worried about the disconnect there. 15:47
Juerd ^ reads as "up to"
lanny That's in S02 probably?
Juerd I don't know 15:48
I think S03.
lanny or maybe 03
S03/New Operators 15:49
wolverian oh, ^ is meta only on classes.
lanny ?eval ^(3,3)
evalbot_r13753 (0.0, 1.0)
lanny ?eval list(^(3,3)) 15:50
evalbot_r13753 (0.0, 1.0)
lanny Time to write a test.
masak lanny: why? that seems fine by me
Juerd ?eval ^(1, 2, 3, 4) 15:51
evalbot_r13753 (0.0, 1.0, 2.0, 3.0)
lanny Spec says that should be (0,0), (0,1), (0,2), ... (2,2)
Juerd I think it makes no sense for ^ to accept multiple arguments
masak lanny: ah
Juerd We have ^« for that when we really need it.
lanny The for example used in the spec is compelling
masak Juerd: why not p6l that opinion? 15:52
lanny for ^(3,3) { } # (0,0), (0,1), ... (2,2)
mauke d num size = liftM sum (replicateM num (randomRIO (1, size)))
lanny ^<< wouldn't do the same thing
masak lanny: I like the example
Juerd masak: I wonder too much if it would matter. My opinion about ^ has been ignored before. These examples look cute, but IMO we'd be better off without. 15:53
Well, not ignored. But it wasn't well received either.
masak Juerd: I must have missed that. anyway, if you have good arguments for leaving multi-arg ^ out of the stew, I sure'd like to hear them 15:54
lanny How else would you easily form a cross product? for ( i = 0; i < 3; ++i ) { for (j = 0; j < 3; ++j ) { ... }}
Would have loved to have had ^(3,3) a few times in the past
Juerd masak: Because returning nested "lists" can be done in so many different ways, that none of them would still be intuitive as a default. 15:55
my $list = any(List, Array, Capture, Feed);
masak Juerd: what about the order that corresponds to increasing numbers in the position system
...?
Juerd my $nested_list = $list of $list.
That's 16 permutations already. 15:56
masak: What's a position system?
masak Juerd: the one that replaced Roman numerals
svnbot6 r13755 | Limbic_Region++ | Added a todo test for last inside sub inside loop per audreyt++
Juerd masak: If you need 0..^$foo, write it?
^ will be used much with arrays: ^@foo.
lanny for ^(2,2,2,2) -> $nibble { }
Juerd This solves something, and it makes something else go really bad. 15:57
It solves the common case where you need the indices of an array, but ONLY for arrays that are 0-based.
masak Juerd: yes
but that's quite common
Juerd It makes things go really bad when an array doesn't follow that anymore.
Arrays can be shaped very differently in Perl 6. 15:58
mauke isn't there something like array.indices?
Juerd If you want the indices, ask for them: @foo.indices, or @foo.keys for all i care.
But don't do ^@foo. We should get RID of assumptions about indices, like we got rid of C-style for loops: lists work so much better!
Limbic_Region @tell audreyt the t/statements/last.t test for last inside a sub inside a loop is eval_is/todo because it crashes locally fyi 15:59
lambdabot Consider it noted.
masak Juerd: you're almost getting through to me here
Juerd We should have something that returns a list of indices for any given array.
And avoid having something that's more attractive, but returns a list of indices only for most arrays.
^ is so cute and easy to type, that people will use it instead of a .indices or .keys, even if those methods exist.
That will either:
1. hurt later on
2. make oddly shaped Arrays look bad (bad style, frowned upon) 16:00
masak ?eval my @a = <a b c d>; @a.keys
16:00 evalbot_r13753 is now known as evalbot_r13755
evalbot_r13755 (0, 1, 2, 3) 16:00
lanny The vast majority of users are going to be using one-dim, zero based arrays 16:01
Juerd And see how I already abused (^$foo).map:{...} to do ... $foo times?
I don't need indices there!
I'm not using $_ at all. It shouldn't be there. It can only hurt or pollute.
lanny Why is it abuse? It says that ^$num generates 0..^$num. It doesn't specify that this has to be for array indices 16:02
masak hm
Juerd But - I used ^ because it exists. I'm like all the other programmers: I'll abuse any language feature you give me.
lanny: Generating a list and then never using it is abuse of the list.
lanny: If you want to do something a number of times, why generate a list for that? Why not just have something that says "do foo, bar times"?
masak Juerd: but ^ is also a handy shortcut
Juerd If your code still works when you change a single 0..9 to a 1..10, you're wasting a list. 16:03
masak Juerd: but I agree, I kind of like Ruby's 5.times {}
Juerd masak: It's a handy shortcut, but TOO handy. And it's only 3 characters shorter than its full form, 0..^
lanny Ah. Missed your not using $_ in the map. I wouldn't go so far as naming it abuse but I see your point
Juerd masak: While introducing a lot of obfuscation.
.. is immediately recognisable as a range to almost anyone. Even if you have to look up wath that ^ does there. 16:04
Also, ^ could be used for so many nice things. A lot have been mentioned already. None of which really appeals to me, but we need to reserve some characters for future killer operators. 16:05
masak Juerd: so you propose outlawing ^$foo and writing it 0..^$foo
Juerd masak: Yes. And when you need a list of array indices, writing it as @foo.keys, not ^@foo. 16:06
There has been mentioning of ^@array being shorthand for @array.keys, but that feels like a hackery solution to a problem that can be avoided in a much earlier stage.
5.times is nice, but not in line with x and xx, which repeat too (but in a different way). The order of arguments is completely reversed. 16:07
masak Juerd: well, you've more or less convinced me. but I'm not sure I'll do something about it, short of not writing ^$foo in my perl6 code 16:08
Juerd Well, if it's there anyway, I will use it too.
But I'm convinced that it's better to not have it.
masak Juerd: a lot of features exist in Perl that can be abused, but that can also be used for a lot of goodness 16:09
Juerd Yes, but this kind of abuse will be the standard.
That's the danger here.
masak Juerd: sounds like you're saying that ^$foo is too Huffman-y 16:10
Juerd It's huffmanly perfect for our current problems.
But our problems will be shaped differently. Pun not intended, but you can interpret it both ways.
masak Juerd: actually, I don't agree that the zero-basedness is a problem. zero is a very, very common array index base 16:11
having a shorthand for that is nice
Juerd Yes, and that's great. I think we should keep the default to 0, and I think that most arrays would best have 0 as their base.
Well, there you go.
You first say that 0 is a common array index base, then you say that a shorthand for an array index base is nice.
lanny 0..^$num does say that clearer though and does handle 7..^$num 16:12
Juerd But why this shorthand?
It's "nice". Yes, it's cute and short syntax.
lanny For instance being midway down a buffer and taking slices
Juerd But it's awful code documentation, because you're not asking for the right thing.
Even though you are getting what you wanted.
It's like the difference between 5 * 3 and 3 * 5. They both return 15, but they mean something wildly different.
masak Juerd: I fail to draw the analogy. why are 5 * 3 and 3 * 5 so different? 16:13
lanny Um... * is associative so no they don't. At least in the field of integers
Juerd And indeed, the non-shorthand isn't so bad either: 0..^ # on most keyboards, that's only three keys.
masak: 5 * 3 is XXX XXX XXX XXX XXX, while 3 * 5 is XXXXX XXXXX XXXXX. 16:14
Both 15 Xes
masak Juerd: yes, I get that
mauke Juerd: or the other way around
Juerd But arranged differently.
masak Juerd: yes
Juerd mauke: In LTR languages, no, not the other way around.
mauke since 5 x 3 is '555'
Juerd I'm speaking of * strictly, for the analogy, not about x or xx.
mauke I'm seriously not sure which way * works 16:15
Juerd I do think that the arguments for x and xx should have been the other way around, but it's much too late to change that now.
3 x "foo" makes much more sense to mee than "foo" x 3.
As would 3 XX { ... } make more sense to me than { ... } XX 3
lanny Nope. Because "foo" is what you want copied. It pays to introduce the subject at the start of your sentence 16:16
masak Juerd: anyway, from the pragmatic point of view, ^ is not going to go away by itself. someone needs to lobby against it. write a blog entry or something :)
Juerd masak: I've mentioned it here and on p6l before. If enough, or influential enough people would agree, it would already have been changed.
Limbic_Region likes to start his sentences with conjunctions 16:17
masak Juerd: nothing is set in stone, you know
Juerd masak: I'm not going to lobby. I hate that.
masak Limbic_Region: and an example?
Limbic_Region Because it was rainy and cold outside, he stayed indoors.
Juerd Larry has made up his mind about this, and other things. He gets to decide.
I also still want <->.
And "<-> $_" to be the default instead of "-> $_ is rw" 16:18
masak Juerd: with a bit of luck, you'll be able to redefine p6 to your needs :)
afk & # dinner
Limbic_Region $larry is variable and has been known to unmake up his mind.
Juerd masak: No, that'd be bad. Deviating from the standard language too much is a stupid idea.
Limbic_Region was very happy to hear that 2 things he bitched about on the list over a year ago have ended up coming to pass anyway
Juerd Also, <-> wouldn't just be practical, it would also make teaching Perl much simpler.
mauke what is <->?
Juerd Glueing it to the language afterwards would only fix half of that. 16:19
Limbic_Region masak - if you hadn't noticed the sentence beginning with a conjunction - it was the one right before you asked for the example
Juerd mauke: Well, in current terms, "->" implying "is rw" for all parameters.
16:19 vv3 joined
Juerd mauke: I'd like to explain "->" as a special case of "<->" instead, where it has "is ro" for all of its parameters. 16:19
for @foo { ... }
That's actually shorthand for:
for @foo -> $_ is rw { ... } 16:20
So "$_" isn't the default here. No, it's "$_ is rw".
That's weird, because that makes these two things different, while they look like they should be the same:
for @foo { ... }
for @foo -> $_ { ... }
This is solved by making <-> the general case, and -> the more specific case:
for @foo { ... }
is shorthand for: 16:21
for @foo <-> $_ { ... }
While
for @foo -> $_ { ... }
is shorthand for:
for @foo <-> $_ is ro { ... }
(But that'd be BAD style, if we have both -> and <->)
lanny Yeah. And all my orgs junior programmers would be using <-> because they don't want to have to think about what vars to make is rw and I'll be tracking down bugs forever.
Better to make folks think about is rw when needed than prop open the door. 16:22
Juerd (As <-> looks bidirectional, and -> looks unidirectional. Using -> for bidirectional may make sense for us now, but using <-> for unidirectional would certainly be bad style and only good if you were mixing ro and rw)
lanny: Disagreed.
mauke lanny has a point
lanny We can agree to disagree but I face this problem now. 16:23
Juerd lanny: That is -- if that's your argument, and I do see your point, then the default should also be ro, not rw.
But if the default is rw, then your argument doesn't really hold for the explicit cases...
If the default were ro, though, Perl'd change much in the way it's used. 16:24
lanny The default probably would be ro if Perl 6 were starting from ground zero. It's standing on the shoudlers of Perl 5 though 16:25
Juerd (I wouldn't mind that, by the way. I'm quite apathetic re for @array { s/.../.../ and manipulate $_ some more }, because for the simplest case I already get » in return to fix it.)
lanny: That's what I mean.
16:27 cognominal joined
lanny Well Perl is the only language I can think of that scales from one-liners to full production codebases. Getting rid of the shortcuts that tend to dirty things as the language scales up would hurt the one-liners. 16:27
So your gonna get some non scaling items (e.g., ^$num)
Juerd But changing behaviour much while scaling up is weird too. 16:28
Small scale defaulting to rw, but any explicit mentioning defaulting to ro... That's unintuitive, hard to explain, and just not very logical.
lanny Yes. But in my production code I wouldn't use for @array { s/// } without a compelling reason. Heh. I'm coming to think we are arguing the same point from different views. 16:29
Juerd It requires explicit learning of behaviour, and you can no longer get by by trial and error, because it'll only confuse you. I expect this to be reported as a design bug by critics.
lanny But why would you ever for -> $_ {} ? It's there just for the for {} 16:30
Juerd lanny: It's not $_ that I'm afraid about
I will initially have, somewhere in a program:
for @foos {
...
}
lanny Yes, well the critics write stuff like python (a language I have a lot of fun with) so I have to do regexes as \\\\...\\....\\\\\\
Juerd Then, later, the block grows, and gets more complex. It gets an inner block, so the outer block needs an explicit loop variable:
for @foos -> $foo { 16:31
...
... # but I was mutating $_ somewhere, so now suddenly my code breaks. And all I did (if I were a normal programmer, and not already intimately familiar with Perl 6) was use a name "foo" instead of the default name "_"!
}
So I will come to IRC, or Perl Monks, or my cow orker, and ask about this. 16:32
I'll be wasting time over this.
lanny Hmm. I always for @foo -> $v {} so don't bump into that but I do see your point.
Juerd Not just my time, but also someone else's time. I can really not understand what happened here to make this variable read only, even though I do understand from the error message that something must have done that. 16:33
If I'm really smart, I'll ask IRC, Perl Monks, or my cow orker, how to make it read-write again. I'll be wasting time, but not a lot.
16:33 chris2_ joined, shachaf_ joined
Juerd But most programmers aren't really smart, so I'll just paste the loop, and the error message, and complain that I didn't do anything to change this. Help me, please! This is urgent, not homework, and I can't really continue with my project until is fixed. I'm wasting a lot of my own and someone else's time. 16:34
16:34 Psyche^__ joined
integral|ZzZzz Obviously the solution is to introduce certification, so that programmers are required to know that. 16:34
Juerd The principle of least suprise is ENTIRELY ignored here.
integral|ZzZzz: I considerid mentioning that a few minutes ago. But it hurts my brain too much. 16:35
considered.
16:35 ashleyb joined
integral|ZzZzz Probably hurt the economy too much to insist on competence :-P 16:35
Juerd integral|ZzZzz: Unfortunately, yes, products that do have such implicit unexpected behavioural changes, typically do come with certification :(
lanny I wish google was better at finding symbols. Can't trace down where $_ is ro on for ->
Juerd lanny: That's just one of the many reasons you'd have to ask someone else about this. 16:36
The other reasons are that documentation isn't indexed by problem, but by subject. While it's easy to find information in documentation, it's hard to find solutions in documentation. 16:37
lanny Trivial test shows it though
16:37 chris2_ is now known as chris2
Juerd If we would document by problem, we'd quickly identify this as a design flaw. 16:37
lanny Yeah. I thought about indexing it but the rate of change is still really high
And a programmatic indexer would have fun with symbols like ->
Juerd Because in the perldiag of the future, "Try adding 'is rw'" would have to be mentioned.
And if we can already determine now that we will need to explain this later, why go on with making the mistake? We can't optimize for TWO things in one construct. Sorry about that. 16:38
That is, not for two *conflicting* things. 16:39
lanny That will probably be a resolution. Perl 6 is going to have a lot better idea of basic errors than Perl 5 did. I wouldn't be surprised with an error that said, "You attempted to modify $_ in a pointy block without declaring it is rw"
Juerd Well, I have to compare this to how certain ISPs handle network breakage.
lanny Well I don't agree with <-> as a solution but I do think $_ should always be is rw. 16:40
Juerd Some actively put the information about the breakage on their website. One Dutch ISP even broadcasts network status on a Text page on a TV channel.
Some will wait for you to call and complain, and then they'll tell you what's wrong.
It turns out that the ISPs that actively inform you about the status are ALWAYS the ones that have the most solid networks in the first place. 16:41
16:42 Psyche^__ is now known as Patterner
Juerd If we need to find out what's wrong by running code (asking what's wrong), we're in the leage of the bad ISPs: a better language (network) design would probably have prevented the problem from happening in the first place. 16:42
I agree that "->" looks very uni-directional, so that if it's used, you should have read-onliness as the default. But that just means that we need a read-write version of -> to serve as the default when no -> variant is used at all. 16:44
The alternative is to make $_ read only by default too.
Just like what was done to sub foo { ... } which gets a signature of (*@_) by default, NOT (*@_ is rw)!
We can live with that. 16:45
So we could also live with for @foo { ... } having a readonly $_ by default.
lanny The alternative alternative is to have $_ alwasy rw in for 16:46
Juerd The common case is not this, but ... for @foo. And such a single action is already better done with a hyper op: @foo »~~ s/foo/bar/, so the impact in idiomatic Perl 6 wouldn't be huge.
lanny: That's the current behaviour that I've been calling illogical for the past 30 minutes (months, actually)
lanny Hypers are going to take some time to trickle through as an idiom 16:47
No. I mean that for @foo -> $v { s///; } still works because $_ remained rw
Juerd lanny: To me, that's a bad solution. Actually, it's not a solution but an ugly hack that will bite many people later.
lanny Yes but the other way is an ugly hack that will bite people later so maybe we just get rid of for.
Juerd lanny: That'd be very weird and not be a good fix for what I mentioned. 16:48
Though I'll have to expand my example to illustrate:
for @foo {
foo;
bar;
baz;
}
"bar" happens to modify $_. 16:49
for @foo -> $foo {
foo;
lanny Getting rid of for was humor/sarcasm.
Juerd for @bar -> $bar {
bar;
}
baz;
}
Code broke.
lanny Juerd: I'm with your examples. I just ran them in a side window.
Juerd Even though "bar" now mentions $foo explicitly.
(foo, bar, and baz, are to be read as "...", but labeled :)) 16:50
(not as function calls or macros)
lanny What I'm suggesting is the p5 behavior. $_ is always rw weather you said for @foo {} or for @foo -> $v {}. 16:52
s/weather/whether/
Juerd No fix.
The inner loop would have a different $_, and mentioning $foo explicitly as in Perl 5 doesn't help, because it's weirdly automatically ro now.
lanny No no no. You can't claim that's not a local fix anyway because it causes your broken examples to now work. Might not be a scalable fix.
Juerd local fix? 16:53
It's simply not a fix.
lanny Ok. Sorry. Your example isn't the one I was thinking of.
Juerd It's another hackish workaround, that only serves a specific case.
I'm all for hacks in my own code, but such hacks get a bit harder to code if the language I write them in has them too :) 16:54
lanny So I agree for @foo { $_ } acts differently than for @foo -> $v { $_ } and that it's surprising. Your argument that folks will waste time having to learn the fix is a stretch (in my book) because learning a new language is always time wasting. 16:56
Hmm. I thought there was way to keep the topic though ($_) while naming it something as well. i.e., for @foo -> <magic>, $v { $v =:= $_; } 16:58
MacVince ?eval :foo 16:59
evalbot_r13755 ("foo" => Bool::True)
MacVince ?eval :foo.class
evalbot_r13755 Error: Unexpected ":" expecting "::"
MacVince ?eval :22 17:00
evalbot_r13755 1
lanny Aha.
17:01 ashleyb is now known as ashleyb_
lanny ?eval my @x = 1..6; for @x -> $v is rw { $_ += 1; } say @x; 17:01
evalbot_r13755 OUTPUT[234567 ] Bool::True
MacVince Does Perl 6 have symbols like Ruby? 17:02
lanny MacVince: What's a symbol like Ruby?
MacVince lanny: basically an atomic, immutable string 17:03
lanny: they look like this: :symbol 17:04
17:04 ashleyb_ is now known as ashleyb
lanny Ah. Immutables that share memory. An implementation is free to re-use an immutable without making another. You don't name the explicitly though. 17:05
* them 17:06
Juerd lanny: It's not wasting time learning, for the people who learn taking courses or by reading books that tell you about such things. But a lot of Perl programmers, myself included, learn from reference manuals and trial and error. 17:08
17:09 Aankhen`` joined
Juerd lanny: And for those programmers, the principle of least surprise is extremely important. It cannot be stressed enough. 17:09
lanny Yes. I took that path too.
Juerd This isn't just time invested in learning a new language. It's time wasted in frustration.
MacVince: There's very little reason to have symbols, except the cute syntax. We have cuter syntax ::) 17:10
s/::)/:)/
lanny Admitting that there is a surprise there it's a single-point surprise. It bites you, you learn to put is rw on your first parameter, and you go on.
Juerd lanny: Times how many programmers?
lanny: For something that's easily avoided now?
MacVince Juerd: it was a guy on #python who lamented that Python didn't have symbols like Ruby. Upon further questioning, his reasoning was that he liked the Ruby syntax. I just got curious as to whether Perl 6 had that feature. 17:11
Juerd lanny: Have you ever been in a Perl IRC help channel? On Perl Monks? These things must be avoided, really... :)
MacVince: We don't need the feature, because our language works differently.
lanny Ok. I'll toss your main point right back at you. How much time are you going to lose reprogramming p5 programmers concerning for @bar {} doesn't work because $_ is ro or you have to now say for @bar <-> $v {}
17:11 loumz joined
lanny I haven't visited the channels. I do provide classes at my work and I have mentored any number of perl newbies and know the joy of, "Well yes what you did is correct but there is this edge condition..." 17:12
MacVince should get off his ass 17:13
turn on my PC
fire up Emacs
Juerd lanny: They will find that out early ("compile time") instead of while doing important work ("runtime"). Besides that, Perl 5 programmers WILL read documents about differences between the languages. There, a simple notice about this suffices. With the current behaviour, a simple notice AND A DETAILED EXPLANATION OF THE REAL THING, are needed.
MacVince and then get side tracked by Digg.com and not try to port something to perl 6.
:-)
Juerd lanny: The joy I refer to is answering the same questions over and over and over.
lanny: Perl's helpful community can get really annoyed by this. Many people eventually get rude when N+1 asks the same question. 17:14
lanny: There are a lot of such cases that are fixed in Perl 6. I see a problem in adding a new one when we can identify it.
If we can't identify it, well, then we can't avoid it. But if we can... by god, please let's.
"fixed" in the "repaired" sense of the word. 17:15
Gotta go
afk
lanny Juerd: I disagree. The reason the help channels get the same question N+1 times is that very few new learners actually read the docs if they can find a helpful person.
Juerd No, most of such questions are actually about unintuitive syntax, also known as design flaws. 17:16
Sorry, really have to go. Just found out.
afk
lanny np
Khisanth you can't design for every possible brain that exists and will ever exists :) 17:21
lanny Well you can but your programming language wouldn't do much. :) 17:35
17:56 Aankhen`` joined
svnbot6 r13756 | lanny++ | * undef.t -- :todo on ?(@(undef,)) test 18:02
18:03 justatheory joined 18:19 weinig_ is now known as weinig\, weinig\ is now known as weinig 18:20 shachaf_ joined
Juerd Khisanth: That's true, but I think this kind of brain is very common amongst Perl programmers. 18:33
18:45 yts joined 18:47 shobadobs joined 18:48 penk joined 18:52 MacVince_ joined
svnbot6 r13757 | lanny++ | * reduce.t - :todo<unspecced> on n-ary reduce 19:00
pasteling "fglock" at 200.102.175.122 pasted "Possible Module::Compile bug" (20 lines, 241B) at sial.org/pbot/20082 19:21
svnbot6 r13758 | fglock++ | [Pugs-Compiler-Rule] 19:27
r13758 | fglock++ | - added '>>' and '<<' to Rule parser (currently disabled due to possible M::C parsing bug)
r13758 | fglock++ | - fixed :ratchet newline regex
19:35 frederico joined 19:40 lanny joined
pasteling "lanny" at 128.107.248.220 pasted "min/max with block broken" (32 lines, 524B) at sial.org/pbot/20083 19:53
19:53 TimToady joined
lanny Anyone that knows Prim/Lists.hs help me with a debug? I know how to fix it but I don't know what it's broken. Example is in the nopaste. 19:53
s/what/why/ 19:54
TimToady: if Array::min and Array::max are supposed to be in Perl 6 they aren't specced. Lots of tests for them though. 19:55
I know Functions.pod is in Pugs space but not sure about just going in and putting whatever builtins I think should be in there. 19:57
19:58 MacVince_ is now known as MacVince
lanny @tell audreyt bug in src/Pugs/Prim/Lists.hs in op1MinMax' (-- or use the one of the user). I know how to fix it but I don't know why it's broken. Example of error in sial.org/pbot/20083 20:03
lambdabot Consider it noted.
lanny @tell audreyt Bug is that @a.min: { $^a <=> $^b } returns the max and vice versa for @a.max; {...}. 20:05
lambdabot Consider it noted.
[particle] lanny: if you don't find something specced in S* try A* or E* 20:08
(sometimes things haven't made it into S* yet)
lanny [particle]: ok. Sort of obvious how min and max should work but I'll do that for questionable stuff. 20:09
20:09 lanny joined
[particle] D:\usr\local\perl6\doc>ack --perl \.min 20:10
trunk\design\syn\S03.pod
469:be interrogated for their current C<.min> and C<.max> values (which
lanny Yes. And the test file has a p.p6.lang article mentioning them. But that doesn't really say if they should take code blocks, etc. 20:11
(They should if the current implementation is a guide.) 20:12
20:12 DaGo joined
lanny I need to go make a Wiki page concerning things that seem missing from the specs. Make one or find one if already made. 20:13
20:19 mdiep joined
svnbot6 r13759 | lanny++ | * minmax.t - added examples of min/max returning the max/min 20:28
20:34 Aankh|Clone joined 21:00 crem_ joined 21:02 Aankh|Clone is now known as Aankhen``
svnbot6 r13760 | fglock++ | [Pugs-Compiler-Rule] 21:28
r13760 | fglock++ | - workaround '<<' bug; no workaround yet for '>>'
r13760 | fglock++ | - implemented /<<word/ and /word>>/
21:44 Bugi joined
svnbot6 r13761 | lanny++ | * os/system.t - :todo failing test that :depends<0 but True> 22:10
22:25 imago joined 22:26 imago is now known as gunya
Juerd Is =<> a special case, or does <> always return $*ARGS? 22:50
22:50 MacVince joined
Juerd would be surprised if removing foo from <foo> would make <> be something different. 22:50
23:07 Limbic_Region joined 23:08 ashleyb joined 23:13 weinig is now known as weinig|food 23:18 kanru joined 23:31 weinig|food is now known as weinig 23:39 gnuvince joined
gnuvince I want to add tests to make sure that map {...} @array; is invalid and that map {...}, @array; is correct. Should I put that in the syntax folder? 23:40
23:41 kanru joined