6.2.10 released! xrl.us/hxnb | geoffb's column (/. ed): xrl.us/hxhk | pugscode.org | pugs.kwiki.org | paste: feather.perl6.nl:8888/ | www.geeksunite.net
Set by Juerd on 20 October 2005.
Ovid HI all. 00:23
Anyone here? 00:24
clkao *yawn* 00:25
Ovid I was beginning to feel lonely.
I assume that pugs does not yet automatically support automatic method creation for class variables? 00:26
svnbot6 r7708 | Ovid++ | Stub recipes for object creation and destruction. 00:29
r7708 | Ovid++ | I was blocked fairly quickly on recipe 13-03 (not committed) because PUGs
r7708 | Ovid++ | apparently does not yet support autogenerating accessors for class instance
r7708 | Ovid++ | variables (or Im doing it wrong somehow)
clkao commit tests and go to sleep, you shall see them implemented the next day 00:40
svnbot6 r7709 | Ovid++ | A couple of array recipes 00:53
Ovid Looks like a lot of those tests are already there and they're failing. 00:59
Night all
eric256__ anyone remember a while back, autrijus mentioned needing to add stub subs to prelude.pm in some cases? yea thats vague i know. ;) 02:14
hey the logs have a search button!! never mind found it 02:17
02:17 eric256__ is now known as eric256
xinming hmm, what are the differences between `class A { has $.a }; class B { has $a }; ` 02:32
hmm, or ` $.a =:= $a ` ? 02:33
though, don't know if it would be valid to use class A { has $a; } 02:34
eric256 the difference is still in flux 02:38
but last i read $.a meant "make public accessors for this" while has $a; meant "leave this a private attribute"
ping Juerd 02:51
juerd, in case you backlog....building pugs seems to hang on feather...i think. maybe...not realy sure. looks like i might have three concurrent builds at the moment 02:53
xinming eric256: hm, In fact, $:a is a private attribute.... 02:55
eric256 or i'm an idiot and forgot my account is used for the auto build. ;) 02:56
from recent rumblings on the list that might change.
so that $.x is public and just plain $x is private...which makes more sense in my head but who knows what will be the next finaly decision
Khisanth it seems nothing is ever final :) 02:57
eric256 nope. ;) thats part of the fun
Khisanth makes it unappealing to use though
eric256 to use? why would you think its ready for use? 02:58
its not. and if that makes it un appealing then good
autrijus: a while back (while trying to fix shift/pop/min/max to only work on lists) you mentioned using a stub in prelude.pm 03:04
i tried that today, but now it hands on 42.shift; any thoughts? 03:05
eric256 whistles and hums while waiting for pugs to compile ;) 03:19
ingy cpan-upload -mailto [email@hidden.address] -user INGY -password ******** Perl6-Bible-0.21.tar.gz 03:29
Finished!
eric256 cool
ingy why does `use No::Such::Module` crash the pugs shell? 04:16
yet syntax errors do not
eric256 dunno. oddly i just did that a minute ago too ;) 04:17
ingy wonders how to use yaml in pugs
ingy greps a little and gives up 04:22
eric256 lol.
what error do you get?
ingy sleep&
eric256 alright. later
gaal : FEAR: The new features won't be used by people 05:12
FEAR: The new features *will* be used by people!
dduncan FEAR: both of those will happen at the same time ... in different universes ... which one will be ours? 05:16
spinclad both of those will happen at the same time... by different people, or to different features 05:58
'use every feature' is not a recipe for excellent programming 05:59
(especially junctions!)
wolverian junctions might be nice for automatically generating arguments in tests 06:00
spinclad .oO ( if junctions are meant to be a step up from Quantum::Superposition, why don't they have complex weights? )
06:17 brother_ is now known as brother
buu Oh dear god. 06:39
wolverian hm? 06:40
buu Weighted junctions
wolverian heh. 06:41
10:28 r0nny_ is now known as r0nny
svnbot6 r7710 | renormalist++ | - The "documentation will never be rewritten for Perl6" fear 11:51
brother What would be the natural score in p6 golf? number of unicode glyphs or number of utf-8 chars? 13:16
Limbic_Region I think it still has to be keystrokes 13:28
so using unicode glyphs may be a penalty rather than a gain
how many keystrokes does it take to generate the zip glyph?
brother depends on how you keyboard is set up 13:29
theorbtwo Depends how you generate it.
For me, three. For a Japanese user, probably 1.
I tend to think the opcount is a better measure for both perl5 and perl6, though it's not as visually obvious.
brother theorbtwo: No. one of the wonderfull thing in golf is to (ab)use precedence 13:32
theorbtwo Then again, I never much cared for golf, and it'd make eval "..." count as the best way to do everything. 13:36
svnbot6 r7711 | juerd++ | +=1 13:52
theorbtwo wonders what that log entry is supposed to mean. 13:53
Juerd One more. 14:04
rafl_ karma points for Juerd, right. ;-) 14:12
jabbot rafl_: points for Juerd, right. ;-) has neutral karma
rafl_ karma jabbot
jabbot rafl_: jabbot has neutral karma
rafl_ karma Juerd
jabbot rafl_: Juerd has neutral karma
theorbtwo karma juerd
jabbot theorbtwo: juerd has karma of 1
rafl_ Well, maybe not. :-)
karma rafl 14:13
jabbot rafl_: rafl has neutral karma
theorbtwo Did jabbot's karma counting get reset awful recently?
rafl_ Hm.. long time no commits..
theorbtwo jabbot, uptime?
jabbot theorbtwo: That is interesting. Please continue.
eric256 morning 14:18
theorbtwo G'morning, eric256. 14:19
eric256 is there something super special about prelude.pm? because i have a fix for an issue that works in a seperate file, but when i try to compile it in prelude.pm it doesn't work anymore. 14:24
autrijus yeah, see the comments on top of Prelude.pm
eric256 ahh... now to wait for another compile and see if that works ;) 14:26
?eval sub x (@array) { shift @array}; x(1); 14:27
evalbot_7711 1
eric256 why does it call x? shouldn't that mismatch the signature? 14:28
autrijus it should. that is a bug. 14:29
theorbtwo Probably the same bug as...
?eval 1.shift 14:30
evalbot_7711 Error: No compatible subroutine found: "&shift"
theorbtwo Oh.
eric256 i fixed that one ;)
theorbtwo Oh, probably not.
OK then.
eric256 i was working on the other part....
?eval my @x = (1..5); print shift @x, " hello";
evalbot_7711 Error: No compatible subroutine found: "&shift"
eric256 i can make that work by adding sub shift (@array) { shift @array }; but that makes 42.shift start working wrong agian ;)
another oddity i found. 14:31
?eval shift (1);
evalbot_7711 Error: No compatible subroutine found: "&shift"
eric256 ?eval shift (1,);
evalbot_7711 1
eric256 ?eval shift (1,2);
evalbot_7711 Error: Can't modify constant item: VUndef
eric256 middle one shouldn't work either, but it does
autrijus why not? 14:35
eric256 why would (1,) work when (1,2) does not? they should be identical shouldn't they? 14:36
wolverian autrijus, they're lists! they can't be shifted! 14:37
or mutated in any other way
autrijus ah. right. 14:38
?eval shift(1,)
evalbot_7711 Error: No compatible subroutine found: "&shift"
autrijus ?eval shift (1,)
evalbot_7711 1
autrijus autoenref
eric256 huh? what about
?eval shift (1,2) 14:39
evalbot_7711 Error: Can't modify constant item: VUndef
eric256 ?eval shift (1,2,)
evalbot_7711 Error: Can't modify constant item: VUndef
autrijus ?eval 1.shift
evalbot_7711 Error: No compatible subroutine found: "&shift"
autrijus so (1,) evaluates to type List 14:40
autoenref into Array
shifts correctly
wolverian wow, that is headache
autrijus it is
not sure if it's worth it
eric256 but (1,2,) doesn't?
autrijus eric256: there is a bug on either side.
wolverian please p6l about it if you have the energy :)
autrijus yes :)
eric256 ahh.. i thought you were saying it was right. ;)
is there somewhere easy i can look for the sub (@a) accepting a scalar? 14:41
autrijus nb: a scalar containing an array ref 14:43
eric256 what? 14:44
i want to look in the source for a way to fix sub shift (@array) accepting a scalar.
robkinyon why? 14:45
wolverian eric256, it must accept arrayrefs, which are scalars
eric256 but it shouldn't accept "hello" or 1
Juerd wolverian: That's not entirely true.
wolverian: It can expect an Array, and thus provide Array context
This is a form of scalar context, but you can look at it in two different ways:
1. arrays are auto-reffed
2. arrayrefs are auto-dereffed
wolverian right 14:46
Juerd Which one occurs internally is irrelevant
wolverian that's what I meant
it has to accept a subcontext of scalar
is that true?
eric256 either way. sub x (@array); x(1); should be an error right?
Juerd Yes
1 can't coerce to an array.
wolverian argh. this container/value context dichotomy makes me cry
(as in, it hurts my head to talk about two kinds of contexts.) 14:47
Juerd wolverian: Yes, that is true, but not all too relevant for this discussion :)
wolverian true. sorry. :)
Juerd There aren't two kinds of context.
There are infinite.
eric256 yea i don't kow anything about containers and values :) i'm happy in my bliss. either way 1 isn't an array or list so i'm fine ;)
Juerd item and list context each have infinite subcontexts
wolverian Juerd, I meant two classes of context. erm. that's even worse way of putting it 14:48
Juerd, item/list versus type
Juerd eric256: 1 is a list in list context, much the same way anything is a list in list context
something is a list iff it is in list context.
There are no lists that aren't in list context
And there are no non-lists that are in list context
Well, elements of a list :) 14:49
wolverian: type contexts are subtypes of item/list
wolverian: Array context is item/Ref/Array
This hierarchy is pretty simple
wolverian hm. right.
Juerd There is item, with beneath it: Str, Num, Bool and Ref 14:50
And everything else is directly under Ref
List has the same substructure
Oh, and there is Scalar, which equals item but changes type.
Or you could see it as directly under item 14:51
As there's also Scalar list context
wolverian how does one specify list context?
*@foo?
Juerd Yes
wolverian okay. 14:52
Juerd Hence the alias "slurpy" context
wolverian sorry for being so thick about this.
Khisanth is that the left or the right?
Juerd This is in signatures only
Outside signatures, * is splat, which doesn't exactly equal providing list context.
wolverian hm. I thought assignment was unified somewhat with signatures, at some point
Juerd Also, I believe the "list" operator is weird, wrong, and I consider it non-existent.
wolverian my (*$foo) = @bar; 14:53
Juerd And, of course, containers provide list context to the RHS of the =
collection containers at least
wolverian: No, that's aliasing
wolverian: The := operator has a signature on its LHS, as the signature in a sub, but without parens.
wolverian does the * do anything there?
Khisanth then what are := and ::=? 14:54
wolverian Juerd, ah. okay.
Juerd Khisanth: For binding/aliasing
Khisanth * on the left side of an assignment retains it's p5 meaning?
Juerd No, typeglobs go away.
*$foo = @bar is a syntax error, afaik.
Khisanth sounds pretty darn similar 14:55
Juerd * is valid in signatures and sub calls (symmetrically, also the RHS of binding)
robkinyon eric256: wouldn't it be enough to ask "if ( $scalar does Array )" ?
Juerd robkinyon: The signature should fix this.
robkinyon: Not an explicit check
PerlJam Khisanth: * is always either multiplication or "flatten"
eric256 robkinyon....sure. but the scalar should never be passe din and that sub never called 14:56
robkinyon so, there should be a shift( @a Array ) and a shift( $c Array ) ? 15:00
Juerd robkinyon: What is this syntax?
There should be a single shift(@a)
svnbot6 r7712 | juerd++ | more fears; markov++
eric256 wouldn't shift (Array @a) be redundant?
Juerd This handles: shift(@array), shift($arrayref), @array.shift and $arrayref.shift
Possibly it has modifiers like :n(5) to shift 5 at a time, but that's outside the scope of this 15:01
wolverian OT: why does (foo){1,3} only capture once in perl5? 15:03
rather, does perl6 do that too? :)
robkinyon oops
i flipped the type and the variable. :_)
eric256 ?eval sub x ($x) { say $x}; x(1); x (1,2,3,4); x(1,2,3,4); 15:06
evalbot_7712 1 1234 Error: No compatible subroutine found: "&x"
eric256 ?eval sub x ($x) { say $x}; x(1); 15:07
evalbot_7712 1 bool::true
eric256 ?eval sub x ($x) { say $x}; x(1,2,3);
evalbot_7712 Error: No compatible subroutine found: "&x"
eric256 so it does work the other way around. blah
Juerd wolverian: Because that's the only way to make sure you know beforehand which capture variables there will be.
wolverian: Count the left parens. Those are the $n numbers.
wolverian Juerd, right. 15:08
Juerd I know no way around this.
wolverian since $/ is a tree of matches anyway, it can just hold an arrayref 15:09
kolibrie wolverian: in Perl 6, all three values will be captured and put in an array ref
wolverian kolibrie, ah, like I assumed. thanks!
kolibrie :)
PerlJam wolverian: All quantifiers will capture into an array. 15:10
wolverian yay!
PerlJam (this week :) 15:11
wolverian that is much saner than perl5.
Juerd It's more useful 15:12
But imo, equally sane
wolverian hm. perhaps. 15:13
PerlJam Juerd: I don't know ... the perl5 behavior exposes an implementation detail to the user rather than doing something more useful.
I guess that was the sanest thing to do though
wolverian TMTOWTBS (There's More Than One Way To Be Sane) 15:14
do rules have methods? 15:16
eric256 to their madness?
eric256 couldn't resist
wolverian or: are named rules first class citizens outside rules? 15:17
Grammar.rule($string) or so. 15:19
PerlJam wolverian: perl6 continues to follow the principle of least surprise. 15:22
wolverian PerlJam, was that a yes or no? :) 15:23
PerlJam yes, but it would be spelt more like $string ~~ Grammar.rule I think 15:24
eric256 hmmm. stubing shift doesn't seem to work at all
or my computer just dislikes me greatly ;)
PerlJam I don't know that it's been specced anywhere how the "subroutine form" of rules work. 15:25
Perhaps Grammar::rule($string,@args) ?
eric256 ?eval sub shift (@array) { shift @array }; sub shift ($s) { die }; my @x = (1..5); say shift @x, " hello"; 15:28
evalbot_7712 1 hello bool::true
eric256 ?eval sub shift (@array) { shift @array }; sub shift ($s) { die }; my @x = (1..5); say shift @x, " hello"; shift 42;
evalbot_7712 1 hello Error: Died
theorbtwo ?eval rule r {42}; \&r
evalbot_7712 Error: Undeclared variable: "&r"
eric256 but dropping those two definitions into prelude.pm and marking them as 'is primitive' doesn't change anything at all.
btw in prelude.pm i marked them with * to put them global... even tried adding multi in front, it just doesn't like them 15:30
ehh don't 'mind me...if you have pugs open on windows during compile it doesn't replace the existing pugs...good to know 15:31
?eval my @x = (1..5); my @y = splice(@x,5) 15:37
did i do that? or coincedence?
?eval my @x = (1..5); my @y = splice(@x,5);
evalbot_7713 Error: No compatible subroutine found: "&splice"
eric256 ?eval my @x = (1..5); my @y = splice(@x); 15:38
evalbot_7713 [1, 2, 3, 4, 5]
svnbot6 r7713 | iblech++ | * Usual svn props. 15:39
r7713 | iblech++ | * docs/quickref:
r7713 | iblech++ | * README: Mentioned new "fears".
r7713 | iblech++ | * unicode: Fixed the Unicode variant of ??!!.
r7713 | iblech++ | * fears: Extremely minor cosmetical fix.
r7713 | iblech++ | * data:
r7713 | iblech++ | * (42) is neither a list nor an array, but the Num 42.
r7713 | iblech++ | * (42,) and list 42 are one-element arrays.
r7713 | iblech++ | * ($foo,$bar) does not create new containers, while [$foo,$bar] does
r7713 | iblech++ | (also see t/data_types/lists.t and t/data_types/array_ref.t and several
r7713 | iblech++ | p6l discussions linked in these tests).
r7714 | iblech++ | docs/quickref/data: More explanations WRT the constantness of (...,...) and 15:40
r7714 | iblech++ | [...,...]; also see t/operators/binding/arrays.t and related p6l discussions.
r7714 | iblech++ | (BTW, PIL2JS handles most (all?) of these things ((42) is not an array, the
r7714 | iblech++ | comma operator does not create new containers, but [...] does, etc.) correctly.
theorbtwo ??!! has a unicode variant? 15:41
eric256 dunno. i'm confused on his (42,) list 42 notes. ;) 15:42
Khisanth list 42 creates an array? boy that sure is a misleading name ...
theorbtwo Oh, it doesn't -- he added it to the abusive section. 15:44
Do we want to add ยข to the top section, or is it too early?
PerlJam theorbtwo: release early, release often.
(IOW, add it!)
eric256 abusive section? 15:45
?eval (4,2).ref; 15:47
evalbot_7714 ::Array
eric256 ?eval list (4,2).ref;
evalbot_7714 ::Array
eric256 ?eval (list (4,2)).ref;
evalbot_7714 ::Array
eric256 agrees with Khisanth....thats weird. ;)
?eval (l4,).ref; 15:48
evalbot_7714 Error: No compatible subroutine found: "&l4"
eric256 ?eval (4,).ref;
evalbot_7714 ::Array
theorbtwo eric256: There's a section at the top, unicode operators, then unicode ops in Set.pm, then things that we could use as unicode operators if we weren't evil.
eric256 ahh
mrborisguy so is there also a ::List type?
eric256 i' 15:50
Limbic_Region adds his 6 cents to the "Perl 6 fears" thread
theorbtwo So, I wonderses... 15:51
svnbot6 r7715 | eric256++ | 'Fixed' shift and pop so that all tests pass. Sort of a kludge in prelude.pm that i think needs fixed in the MMD at some point. (@a) signature allows scalars to be passed in (even if they arn't refs).
theorbtwo Where does one find documentation on C-x 8 ... things for emacs? 15:54
C-x 8 gives me a no-such error on my xemacs... 15:55
Jooon theorbtwo: you could try C-h b for keybindings list and search for C-x 8 in that list 15:56
but it doesn't seem that helpful to me 15:57
eric256 ?eval shift 42; 15:58
evalbot_7715 Error: Cannot 'pop' scalar
eric256 aint pretty but it works. ;)
eric256 finds that many of the trans tests were actualy broken, not the implementation ;) 16:01
svnbot6 r7716 | iblech++ | docs/quickref/data: More explanations WRT list context and slurpy signatures. 16:03
r7717 | eric256++ | trans.t - fixed tests.
eric256 ?eval int Inf; 16:13
evalbot_7717 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216
Khisanth oO
eric256 ?eval int Inf == Inf; 16:14
evalbot_7717 bool::true
xerox o_O
eric256 ?eval use Test; is (int Inf, Inf);
evalbot_7717 pugs: *** No compatible subroutine found: "&use" at Prelude.pm line 61, column 30-59
eric256 figures. lol
xerox ?eval Inf 16:15
evalbot_7717 Inf
eric256 is does an eq tests instead of ==
?eval int Inf eq Inf;
evalbot_7717 bool::false
eric256 of course that fails
integral ?eval log(int Inf) / log(2); 16:18
evalbot_7717 Inf
integral ?eval my $a = int Inf; $a
evalbot_7717 \179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216
integral ?eval my $a = int Inf; log($a) / log(2)
evalbot_7717 Inf
integral ?eval my $a = int Inf; log(+$a) / log(2) 16:19
evalbot_7717 Inf
integral ?eval log(179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216) / log(2)
evalbot_7717 Inf
integral *sigh*
eric256 what?
integral I was hoping log wouldn't overflow 16:20
eric256 ahh
?eval int Inf == 'Inf'
evalbot_7717 bool::false
eric256 ?eval int Inf eq 'Inf'
evalbot_7717 bool::false
eric256 thats just a dumb test anyway...i can't see anyway that would be usefull
?eval '' ~ Inf 16:21
evalbot_7717 "Inf"
theorbtwo ?eval my $a=int Inf; my $b=0; $b++ while ($a/=2); $b;
eric256 i mean that would make the string "Inf" magicaly....seems ludicrous
evalbot_7717 (no output) 16:22
theorbtwo ?eval my $a=int Inf; my $b=0; $b++ while ($a>>=1); $b;
evalbot_7717 Error: unexpected ">" expecting word character, "::", term postfix, operator or ")"
theorbtwo ?eval my $a=int Inf; my $b=0; $b++ while ($a >>= 1); $b;
evalbot_7717 Error: unexpected ">" expecting operator or ")"
theorbtwo Did shift-right change?
Khisanth maybe unimplemented :)
theorbtwo ?eval my $a=int Inf; my $b=0; $b++ while ($a +>= 1); $b; 16:24
evalbot_7717 Error: Can't use readline() or getc() in safemode.
theorbtwo (Yes, it did change... but WTF?)
?eval $x = 2; $x +>= 1;
evalbot_7717 Can't exec "./pugs": Permission denied at examples/network/evalbot//evalhelper.p5 line 46.
theorbtwo WTF?
xerox What is +>= ? 16:25