pugs.blogs.com | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | <stevan> Moose... it's the new Camel ":P | .pmc == PPI source filters!
Set by Alias_ on 16 March 2006.
TimToady avar: the bootstrapping book by Jules Verne is "The Mysterious Island". It doesn't "cheat" nearly as much as, say, Swiss Family Robinson, but I suspect it does have some improbabilities for your typical tropical volcanic island... 00:03
But then, they're being helped, and saying more than that would be a spoiler...
00:08 justatheory joined 00:33 justathe1ry joined 00:34 mugwump joined 00:52 stclare joined
audreyt clkao: if @a[2] is rw, then yes. 00:56
clkao: consider:
my @a := (1, 2, 3);
@a[2] = 4; # boom
but,
my $x; my @a := (1, 2, $x);
@a[2] = 4; # that's just fine, $x=4
i.e. @a[2]'s mutability is independent of @a's. 00:57
clkao: makes sense?
TimToady: I like the name Capture
00:59 sean` joined
azuroth what about um, maybe... my @a := (\1,\2); @a[1] = 3? 01:00
audreyt that is same as 01:02
\2 = 3
and since Arguments can't be used as lvalue, that is certainly fail
even if we spec so that it can serve as lvalue by propagating to the invocant in it
"2" still can't be used as lvalue
so would neccessarily fail
azuroth cool
audreyt but arguments as lvalue is bad idea anyway 01:03
\$x = 5; # boom
$(\$x) = 5; # sure why not
I think that's clearer and easier to explain (and is what the current spec says)
azuroth hmm, yeah
avar p5 ${\$x} = 5; doesn't work anymore? 01:08
audreyt avar: we changed ${} to $() for consistency 01:09
or just prefix $
01:09 ptolomy joined
avar $\$x = 5; ? (not valid p5) 01:09
audreyt that is certainly legal 01:10
if a bit obscure to p5 eyes
easier to write as
$ \$x = 5;
or use parens
avar ${} to $() for consistency with what? Grouping in general? While {} usually means a block 01:12
audreyt er no. ${} is a special form
$() is just a prefix operator
you can write it without parens too
it's just like prefix ~
or prefix +
it's a caster 01:13
avar ah
audreyt doesn't quite make sense to make a mere prefix caster
but use the hash deref syntax for it
esp. since we don't have
$glob{CODE}
anymore
so the hash analogy is long gone
avar will $%foo<bar> mean the same thing as ${$foo{bar}} in p5, or ${$foo}{bar} ? 01:14
audreyt avar: +%foo<bar>
so surely, it means the p5 ${$foo{bar}}
avar eh, that doesn't make any sense, I mean @%foo<bar>
audreyt same
avar cool;)
audreyt it'd meanthe p5 @{$foo{bar}}
unless the sigil is part of a variable name 01:15
it assumes the same prec as prefix +, prefix ~ etc
and variable names can't consist of 2+ sigils
avar I see, that's nice
audreyt so it all follows naturally
theorbtwo (Following naturally)++ 01:16
Way too many @{}s in my p5 code.
audreyt yeah. the Reference/ImplementationType/Container ambiguity has plagued p6l for too long
glad to put an end to it
avar theorbtwo: yeah, like for my $i (@{$hash{key}})) .. 01:17
that's for @%hash<key> -> $i { ... } now right?
audreyt right
%hash<key>.map($i -> {...}) 01:18
avar So it'll never automagically dereference stuff like in p5?
01:19 Southen joined
audreyt well, we can spec so that "for" will perform another level of flattening 01:19
such that
for (1,2,3) -> $i {...}
and
for [1,2,3] -> $i {...}
both iterates 3 times
I'm fine with that too 01:20
and is in fact what pugs implements
but there is nothing magical about that
theorbtwo I'm not so sure about that.
audreyt it's simply saying statement_control<for> is equivalent to a map
theorbtwo It's convient, but it will sometimes mean that you have to put in extra brackets to get it to do what you actually wrote.
audreyt right, as in 01:21
for [$x] {...}
if you don't know whether $x contains a list or not
theorbtwo for $x.foo -> {...}, where $x->foo returns a list of arrayrefs. Does it do something different if there happen to only be one foo? 01:22
avar I don't know, I've coded a lot of Perl 5 (hey, I even get paid for it;) But I've yet to find a situation where something like "print for [qw(1 2 3)]" was useful, other than sitting there being consistent with the rest of the language
Which has its values too 01:23
audreyt theorbtwo: well, if foo returns a list of one element and it's an array 01:24
theorbtwo: i.e.
(@a,)
then it still will iterate just once
theorbtwo Blink.
audreyt so I'd say it's consistent
theorbtwo Does that not flatten anymore? 01:25
theorbtwo has forgotten most of perl6, it seems.
audreyt (it doesn't flatten under scalar context)
theorbtwo Um, but that's list context.
audreyt it may help to write out foo explicitly
oh wait, you said arrayrefs 01:26
that is (\@a,)
theorbtwo Right.
audreyt which doesn't flatten in any context.
so sure, it gets iterated once.
theorbtwo (\@a), or (\@a, \@b), depending on the state of $x.
audreyt right. that is then just fine.
avar well just like any scalar would 01:27
evalbot_9807: print for "foo"
avar bows in shame
audreyt ?eval print for 'foo'
01:28 evalbot_9807 is now known as evalbot_9835
evalbot_9835 OUTPUT[] undef 01:28
theorbtwo But if for removes an outer layer of arrayrefness, wouldn't it take out the layer on \@foo?
?eval sub foo {return ([1]);} for foo() -> $x {say $x}
evalbot_9835 OUTPUT[1 ] undef
theorbtwo ?eval sub foo {return ([1],[2]);} for foo() -> $x {say $x}
avar audreyt: you've changed that I see;) 01:29
evalbot_9835 OUTPUT[1 2 ] undef
audreyt theorbtwo: there is a difference between (\@a,) and (\@a)
avar spoke of p5
theorbtwo Oh.
audreyt theorbtwo: (\@a,).map(...) gets run once only
theorbtwo I've got a lot of rereading to do if I'm going to be able to speak intelegently on this channel again. 01:30
theorbtwo calls it a night, at least for a few hours.
audreyt (\@a).map(...) runs as many times as the element of @a (that is, if we define "map" on the Capture object.)
01:30 xern joined
audreyt or maybe it just dies. 01:30
01:42 hexmode joined
audreyt TimToady: I think this should no longer work: 01:43
$bar = @foo;
*$bar = (1,2,3);
to make it work we'd say a lvalue Capture biases toward the positionals always 01:44
(otherwise, consider $bar=%foo; *$bar = (1=>2))
and that's probably bad idea
we have the @$bar=(1,2,3) form already
interestingly the definition of prefix \ is just 01:53
sub prefix:<\> (\$_) {$_}
02:02 amnesiac joined
azuroth wouldn't that be dereferencing...? 02:20
or uh, deargumenting
02:20 justatheory joined
azuroth err, never mind! 02:20
avar audreyt: Looks like an incomplete definition 02:21
y~.~:~
audreyt hm? 02:22
no, \$x in arglist captures the entire arglist
see \$args in S06 02:23
02:43 r0nny joined
TimToady audreyt: I disagree with [1,2,3] autoderef in list context. (1,2,3) is fine though for interpolating, since parens only group, and have no effect on list commas. 02:55
(I'm referring to the for [1,2,3] bit earlier.) 02:57
I think if we break the scalar/list context distinction, Perl programmers will revolt. 03:00
biab & 03:01
03:05 diotalevi joined 03:25 mako132_ joined 03:37 Quell joined 03:40 LCamel joined, Soga joined, ingy joined 03:41 gugod joined, lumi joined, pjcj joined 03:44 kakos joined 03:49 arguile joined
PerlJam Where exactly would someone look for simple examples using TGE? I just started looking (thinking about how to use the tools to write a small compiler) and I'm having trouble seeing the forest for the trees I think. 03:49
03:50 kanru joined 04:03 scw_ joined, xern_ joined
audreyt TimToady: er, [1,2,3] never autoderefs 04:17
I'm merely referring to the behaviour of
for $array -> $i {...}
i.e., whether "for" performs the flattening 04:18
I'm certainly fine with requiring people writing
for @$array -> $i {...}
it feels more consistent anyway.
for *$array -> $i {...} # works too 04:23
if we consider $array containing positional args to the slurpy for
PerlJam was just about to ask
audreyt sub statement_control:<for> (*@, *&) {...} 04:25
if that's the prototype, then I think the above behaviour follows
arcady that's how I would write the prototype for for (assuming such a thing can be written) 04:29
PerlJam arcady: It must be able to be written or we are lost :) 04:31
arcady because perl 6 desperately needs to define itself in terms of itself 04:32
04:32 stclare left
arcady it's like... super bootstrapping 04:32
04:35 stclare joined 04:43 nirgle joined
TimToady audreyt: I believe (*@, *&) is a legal sig. Might even work the other way around, given a smart enough "slurpy" definition of {...} hunting. 04:50
but in this case probably controlled by an "is parsed" implicit to statement_control:<if> 04:51
*for rather
04:51 nirgle left
TimToady arcady: not everyting has to be defined in terms of sigs, since "is parsed" is available, not to mention the entire grammar available for replacement... 04:52
arcady yeah, that definitely makes it easier
TimToady But it would certainly be nice to keep things as regular as possible.
And needing to go outside the sig is probably a code odor of some sort, if not exactly a code smell... 04:53
arcady by the way, how much of "the perl 6 grammar" exists at the moment? 04:55
04:57 hlen joined, Maddingue joined
TimToady depends on how you count, I suppose. rule syntax is fairly well characterized by now. a lot of it is specced pretty well, for some definition of pretty that ain't pretty. 04:58
arcady so at least we can have something like the grammar grammar 04:59
TimToady Most of the operator precedence is not done with rules at all.
Yes, the grammar grammar is already bootstrapped approximately twice.
arcady it's kinda hard to keep track of all the stuff going on...
TimToady there'e very little top-down grammar over the bottom-up expression parser. 05:00
more top-down involved in scanning complex tokens containing subexpressions.
but the main complication remaining is just making sure all the grammatical categories work as envisioned.
Then there's just little detail of attaching semantics to the parse... :) 05:01
s/little/the little/
arcady that can be left as an exercise to the implementors : ) 05:02
TimToady But audreyt says that Perl 6 now fits in her head, so that should be finished a day or two after the grammar is done.
arcady that would be most awesome 05:04
TimToady well, even a month or two would be awesome. a year or so is more likely before we have something really, really solid. Still, I'm very happy with how it's going. 05:05
arcady well, I'm happy that you're happy, and that it's going
I guess it's not entirely obvious from here
and all the various bootstrap efforts and targets and so on are confusing 05:06
TimToady Hmm, yes. Audrey 05:07
Audrey's development methodology resembles a flooding algorithm at times...
Or maybe a genetic algorithm. 05:08
arcady well, as long as things get done that need to get done
still, it'd be nice if us spectators could follow along more easily
what's going on with parrot, by the way? 05:11
and how does any of that connect to any of this? 05:12
05:12 Khisanth joined
TimToady well, now that updates are logged on either p6l or here, between the two of those it's pretty easy to keep up with the high-level stuff. p6i for the parrot stuff. 05:12
Parrot is sort of the other end of the world from me, so I just follow along in p6i mostly. I hear conflicting things, but I think it'll get there eventually, for some definition of "there". 05:13
Whether it will be "the" Perl platform or "a" Perl platform, or somewhere in between, remains to be seen. 05:14
audreyt rehi
TimToady nobody here but us chickens... 05:15
arcady squawks 05:16
audreyt TimToady: so, @a[0]:=1 is an action on @a, and @a[0]=1 is an action on @a[0], not on @a
TimToady: and whether an array is rebindable depends on how it allocs the storage of its element cells, and has nothing to do with what individual elements are bound to
TimToady makes sense, I think
(unless @a[0] needs to be created for the assignment) 05:17
audreyt yeah, lvalue autovivify is another phase
TimToady subject to the constraints that you could attempt to bind the array to a storage mechanism that doesn't work for the element cells you have in mind. 05:18
audreyt but it's cool... I'll totally swap out the current code in Pugs now that I think everything is clear. will go with no automagic dereferencing at all for Capture objects (i.e. (\(1,2,3))[0] would be illegal) and everything needs a explicit cast
TimToady: yup
TimToady I suppose we could outlaw binding an array that has anything in it...
audreyt for the default sparse array (Array of Scalar of Any), you can indeed freely rebind 05:19
TimToady either that, or just throw away the old contents
audreyt yup
I suspect it's more useful
as p5 already allows you to use it
(i.e. alias $x[0] = $y; in Data::Alias) 05:20
TimToady I suppose some people want a stricture of the FP variety that prevents reassignment or rebinding. 05:21
basically, treat everything as immutable...
likely to be slow in some cases though... 05:22
audreyt but you can do that easily
my @x := (1,2,3,4);
TimToady yeah, just xlate to Haskell... :)
audreyt now pushing and rebinding of @a[0] fails
since it's bound to a Tuple instead of sparse Array 05:23
assigning to @a[0] would fail because 1 is not mutable
otoh, my @a := [1,2,3,4] would permit pushing and rebinding
and depends on whether we want the circumfix [] to scalarify its elements 05:24
may also allow assigning into @a[0]
TimToady: damian mailed us something very strange 05:25
claiming that S02's
$x .(...)
$x .<string>
is to be written as
$x. (...)
$x. <string>
I don't quite know how that came to be
TimToady yes, in fact that's what S02 says now.
Damian and I did that at the hackathon.
audreyt but 05:26
:longkey(1) .($value)
TimToady psychologically, we'd like .mumble with whitespace in front to always
audreyt is still there
TimToady be $_.mumble
an oversight.
audreyt gotcha.
which change was that? 05:27
(or some commit log keyword)
TimToady 8563 is when it came in--neglected to mention in log 05:29
I did 8561..8566 today. Also did grammatical category cleanup.
audreyt ok, I'll fix S02 to align with them. 05:30
done as r8573.
TimToady and clarified reducability
audreyt yeah, I saw that. nice 05:31
probably need to clarify what rule_mod_internal: 05:32
TimToady The proscription of infix .foo is a bit draconian, but I think necessary to preserve sanity.
audreyt and rule_mod_external:
means
and change the example from:p5 to :P5 or :Perl5 05:33
or allow :p5 again in S05
TimToady somewhere it says that those might actually be the same grammatical
category with a parameter.
05:33 drrho joined
audreyt aye 05:33
TimToady the internal/external are documented in S06.
*5
05:34 feng joined
audreyt ahh 05:34
so maybe use :g
as example of _external ?
TimToady something that makes no sense inside. :g, or maybe :nth(3) 05:35
though arguably either of those could be forced to work inside with sufficient .* <(...)> .* chicanery. 05:36
audreyt yeah, in which case everything is external 05:37
TimToady but probably not worth it, unless it is.
audreyt I'll keep the diff
TimToady one could also just have one category but blow up on things that make no sense. 05:38
but 2 categories seems cleaner for now
audreyt yeah
r8574.
I guess we need a mirrorer so that svnbot6 can announce synopsis changes here too 05:44
audreyt goes setting one up on feather
arcady that would be a very good idea 05:45
since synopses aren't exactly all that short anymore
spinclad please remind me, where do i look for an svn view of [AES]*? 05:48
(I remember them in pugs doc/ formerly, but i doubt now that was canonical) 05:49
TimToady spinclad: svn.perl.org/perl6/doc/trunk/design/syn 05:54
audreyt spinclad: docs/Perl6/Spec/ will soon have a (read only) mirror 05:55
spinclad thanks, both. will peruse. sometimes i feel (but is it true?) that my second readings are better if i can see how things have been mutating. 06:01
it certainly helps make sure i'm of the changes themselves...
oops, s/i'm of/i'm aware of/ 06:02
ayrnieu You can determine if this is true by repeatedly reading the entire document over its lifetime of changes, so that you have read all of the documents at least N times in a repository of N patches.
Then you can write a spooky poetic book about living in a labyrinth called "The tunnel of perl6" 06:03
spinclad "the name of the camel" 06:04
svnbot6 r9842 | audreyt++ | * Begin mirroring ofr upstream svn.perl.org Synopses as 06:09
r9842 | audreyt++ | read-only Spec documents:
r9842 | audreyt++ | 01 Overview 02 Syntax 03 Operator
r9842 | audreyt++ | 04 Block 05 Rule 06 Subroutine
r9842 | audreyt++ | 09 Structure 10 Package 11 Module
r9842 | audreyt++ | 12 Object 13 Overload
06:09 GeJ joined, fridim_ joined
audreyt praises svk for making things like this trivial 06:13
clkao++ 06:14
azuroth humm, is there a word for "unrequired"? 06:15
ayrnieu 'unrequired'.
FurnaceBoy_ optional ?
ayrnieu yeah, or that :-)
azuroth right. gaim told me unrequired wasn't a real word
ayrnieu gaim doesn't know about 'real words', it only knows about dictionary words, which aren't the same thing. 06:16
FurnaceBoy_ I agree with gaim on this
TimToady audreyt: I have asked sixperl what they think of Capture.
azuroth hum. I'll leave it at "not required"
FurnaceBoy_ yeah
ayrnieu azuroth - 'not required' and 'unrequired'/'optional' differ in grammatic use. 06:17
FurnaceBoy_ there are others in the ballpark too. dispensable, etc. A thesaurus would help. 06:18
azuroth not when "not required" is used an adjective ;-)
hmm. cool
ayrnieu azuroth - "not required elements include" -- bzzt.
azuroth I just reworded it; "it contains many not required functions" to "it contains many functions that are not required;" I think it reads a lot nicer... 06:19
ayrnieu If you like copulas. Pffth :-)
azuroth of course, my spurious use of semicolons there would suggest that I don't really know
copula?
interesting 06:20
ayrnieu "If you like the verb 'to be'. Pffth :-)" -- I don't actually know if 'copula' is the correct term. I take that from descriptions of J grammar.
TimToady If you're going to use "not required" as an adjective you have to spell it "not-required".
Well, you don't have to, but it's clearer, I think... 06:21
ayrnieu aside, "it contains many functions that are not required" seems weird without context. I'd expect something like "It also has many useful functions in excess of those described by the FOO and BAR standards." 06:22
audreyt surely "nonrequired" would do?
ayrnieu in addition to those.
azuroth hmm.. would you suggest a different adjective? I don't really like optional, because it doesn't have quite the... negative feeling I think we're looking for
audreyt nonmandatory, even
TimToady extraneous
ayrnieu I think the solution is to not look for a single word. 06:23
azuroth extraneous, I like it!
ayrnieu extraneous is good for negative feelings.
TimToady I'm really good at thinking up negative words. :)
audreyt TimToady++ # positive words too
azuroth it's weird. we're doing this feasibility report for college, for this point of sales system. but what would happen if it was found it wasn't feasible? I imagine we'd do it anyway 06:25
spinclad infeasible
ayrnieu If the results of your report don't matter, don't be party to them.
TimToady Maybe it's just infeasible without more fees. 06:26
ayrnieu although if it fails as you predicted you can at least say you told them so :-)
azuroth hmm, yeah 06:27
spinclad of course, 'feasible' doesn't quite mean 'required'...
ayrnieu and if it doesn't fail: you're wrong.
TimToady well, it's infeasible for me to stay up much longer, so g'nite all.
audreyt sleep well
azuroth night!
audreyt don't let the bed pugs bite!
spinclad sweet dreams
TimToady ow!
& 06:28
spinclad dreams of bed pugs all night
ayrnieu (it's unrequired for me to stay up much longer, but I have an extraneous hour and my other tasking is optional)
azuroth spinclad: we're saying that MYOB's POS has extraneous features that would just distract from the efficiency of the user...
TimToady
.oO(ped bugs pite...)
audreyt there is no such word as "pite"... 06:29
TimToady
.oO(is now. zzzz) &
audreyt g'pite
azuroth s/word/verb/. I'm sure I've seen pide spelled with a t 06:30
spinclad let's call said features omissible, maybe 06:32
enim censeo, featura ista delenda esse 06:33
"i really think those 'features' have got to go" 06:37
azuroth "I certainly recommend, feat..." you didn't give me enough time ;-) 06:38
06:46 iblechbot joined
spinclad "truly i deem those features to deserve expunction" 06:48
and other echoes of the elder Cato 06:50
spinclad goes off to dream of bedpugs & 06:51
06:51 marmic joined 07:00 KingDiamond joined 07:05 hugues23 joined
gaal "Seize" is shorter than "Capture"... :) 07:06
arcady but not a noun 07:08
how about Seizure!
gaal Seize is also a noun
arcady since that's what it will give those who attempt to understand it
07:09 premshree_ joined
gaal like, oh, Siege 07:09
wait now I've got my English crosswired. 07:10
what's the name for a verb functioning in noun role (in English) 07:11
"The arrest of the mad linguist"
"The love od the mad linguist" 07:13
azuroth hmm. interesting questions 07:14
-s
gaal "The seize of the mad linguist's subversive proposals"
in the case of love clearly that's a standard noun there
not sure about the other two 07:15
azuroth en.wikipedia.org/wiki/Verbal_noun maybe..
audreyt I think Capture works
gaal audreyt: sure, also easier to spell
azuroth: yes, that's it 07:16
azuroth it's a boring name for it. I was hoping for something like sublightdriveitive 07:17
gaal azuroth: well, it invokes the gerund, so there's some fun there. 07:18
07:21 bsb joined
arcady I still think Seizure is more fun 07:22
gaal Snare :-) 07:25
07:26 Barry joined
gaal uh, or plain Catch 07:28
but these verby nouns are all confusing.
bsb Are we playing rename the Arguments? 07:29
lumi It's not an argument, you're just contradicting me 07:30
gaal catch, like capture, has an accepted nounly usage at least 07:32
lumi: are you proposing Contradiction for a name?
this isn't Haskell yet you know
rgs contradiction is not diction 07:33
gaal or a Joni Mitchell song. .oO( and he took his contradictions out / and he splashed them on my brow )
07:33 Barry left
gaal s,.oO(),~/~, 07:34
audreyt I think Capture is long enough :)
huffman says that it shouldn't be very short 07:35
as we are not expecting humans to write them in code
lumi I thought the Arguments looked fairly record-like, but maybe I'm missing the point..
07:35 bsb_ joined
audreyt record? 07:36
lumi Yeah, I was reading TaPL, it mentions the record as a supertype of a tuple 07:37
bsb_ Maybe Glist, as in "A Glist"
lumi So it's ordered but it can have named values
07:37 kane__ joined
gaal hw = "~Y~" : [ "~Y"++x | x <- hw ] 07:40
audreyt lumi: I think it's something like
data Capture = MkCapture
{ invocant :: Val
, named :: Map Str ral
07:40 KingDiamond joined
audreyt , positional :: Seq Val 07:40
, block :: Val
} 07:41
s/ral/Val/
of course, both invocant and block are actually "Maybe Val"
gaal hw !! 2
# live commentary in Haskell 07:42
lumi Looks kinda Ruby-ish (and that first line would get you mauled by nothingmuch :P)
gaal lumi: which first line, invocant :: Val ? 07:43
lumi Yeah
Not mmd enough!
gaal ah
07:44 ko1_away is now known as ko1_
gaal how would you express it then? [Val] ? 07:44
audreyt gaal: 07:45
hw = unfoldr (\x -> Just ("~Y"++x, x)) "~Y~"
hm, but comprehension is actually more readable
bsb_ audreyt: regarding and example for $args ~~ $sig yesterday... 07:46
if $args ~~ $sig means thisi $args would bind to this $sig without error,
audreyt slightly better version: 07:47
hw = unfoldr (\x -> let y = "~Y"++x in Just (y,y)) "~"
bsb_ then a sub that takes an Arguments could do ordered pattern matching dispatch
like case desugared Haskell using given/when.
gaal audreyt: surely there's a scan version hiding somewhere
07:47 bsb_ is now known as bsb
audreyt gaal: indeed 07:48
hw = scanl (++) "~" (repeat "Y~")
gaal I don't understand the Just versions though, where
's the rest of the monadic trickery?
audreyt unfoldr :: (b -> Maybe (a, b)) -> b -> [a] 07:49
gaal oh
hmm? why the Maybe?
audreyt termination.
gaal ah, that
audreyt bsb: I think it makes sense
gaal then, obviously the wrong function given the streaming nature of the handwave 07:50
I like your scanl version. The comprehension still is shorer though...
hadwave is the new Hello World 07:52
s/d/nd/
bsb audreyt: that's a relief 07:53
gaal evolution of a * programmer: 1. hello world 2. ... n. fac ... k. handwave
audreyt (bbiab) 08:23
08:53 nothing_pasta joined, mj41_ joined
wolverian heh, that's a lot of grammatical categories 09:03
09:16 wilx`` joined 09:19 elmex joined
gaal trivial nit: in S02, Grammatical Categories: 09:41
# has $.tail handles <wag>
# my $x shall conform<TR123>
should there be whitespace after the trait? 09:42
audreyt mmm 09:46
you mean
my $x shall conform('TR123'); 09:47
or something else?
Juerd audreyt: There's a space between handles and <wag>, but not between conform and <TR123>
has $.tail handles <wag>
my $x shall conform<TR123>
But I agree it can be very confusing.
audreyt I have no idea what "conform" does here. 09:48
azuroth maybe like a subtype or something?
audreyt if it's a named arg to "shall"
then it should be
my $x shall :conform<TR123>;
the "shall" is user-defined trait auxillary
like "is"
Juerd Is shall synonymous to is? 09:49
Or will we have to remember a load of trait categories?
audreyt no... "shall" occurs to the same position as "is"
it is user-defined
Juerd (Which to me is as hard as 1st 2nd 3rd)
audreyt you can declare your own trait auxillaries
there is nothing special about "shall"
it's not part of the base language 09:50
Juerd I see.
audreyt sub trait_auxillary:<must> {...}
then you can say
Juerd Oh my
audreyt my $x must :be<happy>;
TimToady: is it simply a case of missing colon before "conform"? 09:51
Juerd Will Perl 6 have floating point %? 09:52
azuroth unrelated, but I think that parrot consciously doesn't 09:54
audreyt Juerd: I don't see why not
Juerd I don't know if regarding % will follow sanity, or Perl 5 :) 09:55
Perl 5 has only integer %, and I couldn't find anything in a synopsis specifying Perl 6 would be different
audreyt well, docs/Perl6/Spec/Builtins.pod is the place to look for now...
I think floating % makes sense.
Juerd So do I
audreyt azuroth: why is it so? 09:56
azuroth err. I might be off base. float percent, or float-keyed hash?
Juerd Modulus
azuroth haha, oh
sorry!
audreyt np :) 09:58
Juerd: fix Builtins.pod ?
(and write a test)
Juerd Well, I think it may need some discussion first 09:59
Because it's a difference with Perl 5, and I can't imagine Perl 5's surprising behaviour was chosen arbitrarily. 10:00
audreyt ponders whether it's worth it to upgrade to gnome 2.14
Juerd: I think it is chosen arbitrarily. 10:01
Juerd I see :)
gaal Detective AudreyT in the Case of the Missing Colon
Juerd Hm, I could "svk up" twice 10:02
audreyt py/rb/js all does floating %
gaal uh, what is floating point %? 10:03
5.2 % 7.3 == ?
audreyt 5.2 ;) 10:04
7.3 % 5.2 is 2.1.
gaal s/one/the other/
.oO(pi % e)
10:05
Juerd gaal: $bar / $foo - int($bar / $foo) * $foo 10:06
svnbot6 r9854 | juerd++ | %
gaal
.oO(2 pi % pugs version)
Juerd gaal: It can be very useful to know that 5 % 2.5 == 0 10:07
While Perl 5 does int(5) % int(2.5) == 1
It wouldn't be a problem if it warned about this, but it silently truncates the numbers 10:08
gaal *nod
Juerd Oh, and the behaviour for negative numbers should probably be specified by documentation rather than implementation :) 10:09
audreyt there's a pretty good doc in 10:10
ri Numeric.divmod
svnbot6 r9855 | juerd++ | t/% 10:18
10:19 ko1_ is now known as ko1_away
gaal when I do svk log -l 1, I get some empty commit messages 10:29
oh, I see svnbot tracked a skip in the r number too. why's that? 10:30
9843-54 weren't mentioned here.
Juerd 12:10 < svnbot6> r9854 | juerd++ | %
perlbot What kind of idiot karmas himself? Your kind of idiot!
Juerd perlbot: steefu
audreyt gaal: yeah, those are empty mergebases 10:31
gaal -53
audreyt: say what?
also, after svk pull of quite a few upstream changes, I want to svk log -v and see what file each upstream patch did, but I only see the filelist for the pull unit (merge ticket? whatever the term is) 10:32
audreyt gaal: those revs are just for telling svk upstream are cp'ed 10:33
gaal: as they don't have a commit log, they are not shown 10:34
gaal: not sure how to do that... try #svk
gaal k 10:35
shouldn't Math::Basic::sign(undef) fail instead of return undef? 10:46
(Builtin.pod)
likewise <=> 10:47
audreyt sure 10:48
fix away :)
gaal hmm now I'm not sure! <=> admitting undefs is probably useful in oneliners 10:51
btw, is there a TOC for synopses that includes the unwritten ones? 10:52
ah, perldoc Perl6::Bible 10:53
audreyt (bbiab...)
10:55 iblechbot joined 11:03 chris2 joined
wolverian audreyt, yeah, upgrading to gnome 2.14 is worth it, for some definition of "it". 11:10
audreyt, dapper is stable enough nowadays to just install it, for some definition of "enough".
17:34 ilogger2 joined 17:42 Southen joined
arguile If <=> is the spaceship operator, is <===> the mothership? 17:43
pmurias the biggest problem is that the parrot api is really minimal roughly only init interpreter,load any run bytecode is defined
wolverian TimToady, what's <===>? is === well ordered? that sounds weird.. :) or is that <= ==>? 17:45
pmurias fglock:the biggest problem is that the parrot api is really minimal roughly only init interpreter,load any run bytecode is defined
fglock pmurias: you may have to write a bit of code - see the Inline::Parrot stuff 17:46
pmurias fon the other hand it may be enough, i have to go for swimming now
s/fon/on
bbiab
17:46 siosiosios joined
b_jonas it's <=== > 17:47
17:57 zgh joined
Juerd Hm, I kind of like the ...\s*... proposal 18:00
$foo...
...bar
is clearer than
$foo.
.bar
And ... isn't that much harder to type than .
18:06 hlen is now known as hlen_
TimToady I'd prefer ...\s+. I think. And we'd have to make current ... something else, like ..* or some such. 18:06
18:06 hlen_ is now known as hlen
pmichaud TimToady: the lookahead on say .1 is because ".1" is a term and not postfix? Or did I miss the example entirely? 18:06
Juerd TimToady: \.\.\.\s+\. would be fine too. It's the trailing single . that I think is too inconspicuous 18:07
Hmmm... /\.\.\.[\s+\.+]?/ 18:08
Limbic_Region notices about 20 Synopses changes in the last 24 hours and wonders if TimToady has figured out how to hack in his sleep too 18:16
18:20 mj41_ joined
TimToady On the other hand :foo... .($bar) is awfully unweildy if you're just trying to line up your pair arguments. 18:20
Juerd TimToady: Maybe \.+\s+\.+ then 18:22
TimToady $min..$max
Juerd TimToady: \s+
TimToady $min.. $max would be an error
Juerd No, it would be a range operator, because \s+ didn't match and the postfix . is no longer considered. 18:23
Or do I then not understand how parsers work?
TimToady Just trying to avoid backtracking over a line boundary.
$min..
$max
xinming TimToady: You use too much puctuations. :-P do you considered ` ? 18:24
Juerd Uh oh.
xinming since ` isn't used in perl 6 yet IMHO,
TimToady ` is reserved for user ops, or maybe units
$x`meters
pmichaud TimToady: what's the issue of backtracking over a line boundary? Does it have to do with statement ends?
theorbtwo pmichaud: Has to do with humans.
Juerd theorbtwo: Humans can take this. 18:25
Humans intuitively understand the difference between .. and .
., I think
TimToady $min..
=begin
...
=end
$max
Juerd TimToady: A bit contrived though :)
Anyone who puts POD in the middle of expressions should be shot anyway :P
pmichaud TimToady: I haven't seen the latest pod docs, but in the version of the grammar I'm working with now pod would just be comments 18:26
(active comments, but still comments)
Juerd Oh, I wanted to ask. Do we still have meaningful comments like #line?
(Not referring to the shebang) 18:27
pmichaud i.e., I was planning to put =begin into the ws rule
TimToady could be =line now maybe
pmichaud so, if that worked, backtracking over a line isn't an issue for the parser. It might be for the human, but that's what they get for podding in the middle of an expression 18:28
svnbot6 r9858 | fglock++ | PCR/Category - improved testability
TimToady It's still lookahead with an arbitrary number of intermediate characters.
Juerd I don't think anything is going to look great and selfevident with pod in between.
TimToady Anyway, we could just say that .. is always the range operator, and go with either ... or . 18:29
xinming hmm, anyone here would tell me what does back track over a line mean? :-/ I'm not sure if I fully understand
Juerd TimToady: But isn't every whitespace sensitivity thing suffering from that?
xinming ... is yada operator.
TimToady I think that's how people would rather read it.
pmichaud we already have lookahead with an arbitrary number of intermediate characters --- that's just the nature of whitespace, isn't it? 18:30
TimToady it's the yada term.
18:30 fglock joined
TimToady has nothing to do with where an operator or postfix is expected. 18:30
but not lookahead that changes whether we're expecting a term or operator.
(I hope)
Juerd xinming: It's simple. You're allowed to think and pause with ... within sentences, but the rules of the game are that you fail if you do so at the beginning ;) 18:31
xinming: Many operators have different meaning, depending on where they are used. Consider, for example, * and ^ 18:32
xinming yes, + is plus, but in rule, It is at least one match
is it * or +
Juerd xinming: "plus" itself has two different meanings.
xinming oops
Is not plus... 18:33
theorbtwo +$x, $a+$b
Juerd xinming: +$foo, where + is used prefix, and $foo + $bar, where + is used infix, are different.
Where +$foo happens to equal 0+$foo in most cases.
TimToady more dramatically /$foo/ vs $x/$y
18:33 cognominal joined
theorbtwo And 1.0 vs $x.foo vs .foo vs ..1 18:34
Juerd And : in rules, versus :pair, versus foo bar: list, versus foo: args, versus ::Foo, versus Foo::Bar, versus ... :)
TimToady ..1 not legal currently
xinming but now, what do we need?
theorbtwo Oh, I thought it was -Inf..1 18:35
TimToady not any more than 1.. is 1...
Juerd ..1 could be $_..1 ;)
TimToady erg
theorbtwo Ah, right.
Juerd I'm sure someone will event a use for that some day!
s.event.invent.
pmichaud TimToady: I know you've been down this path before, but I'm starting to agree that "dot" isn't the correct whitespace eater 18:36
Juerd Heh. If ^\d methods always return the method name, on every object, and even undef, we don't need a special rule for .5 anymore ;)
TimToady Maybe we should go with *.. and ..* and *..* as infinite ranges, much like ^.. ..^ and ^..^ 18:37
jmcadams sorry to bother you all, but I was forwarded an email saying that you might want to have a perl6 hack-a-thon pre-YAPC::NA
18:37 fglock left
Juerd TimToady: Personally, I really do not mind typing "Inf" when I mean inf. 18:37
jmcadams if so, do you want me to find a place for everyone to meet up
pmichaud jmcadams: last I heard it was to be a post-yapc::na hackathon
(but I could be well out of the loop)
Juerd TimToady: These are three operators that I think are entirely unneeded 18:38
jmcadams any idea of who the loop consists of?
I'm out of it myself
xinming hmm, what about \.* for the back track? 18:40
TimToady I don't understand what you're asking.
xinming If I understand correctly, backtrack is used for something like \ at the end in C, which means, the next line and current are "grouped", sorry for me poor English. :-/ 18:42
TimToady ah, no, backtracking is a pattern matching term. \ is a "line continuation". 18:43
Juerd xinming: Backtracking is finding out you can't go any further, and going back to where you came from to try another alternative
xinming shuts up.
Juerd xinming: Like in a maze, or a pattern match, or a detecvite story.
detective 18:44
18:44 cognominal joined
Juerd xinming: Backtracking can be annoying, because it means what you did before was in vain, and the going back itself isn't free either. 18:44
TimToady I think we could safely say that, in postfix position (that is, with no preceding whitespace) a /\.+<ws>/ always means "the postfix is continued after the whitespace with a leading dot". 18:45
Backtracking in the parser also tends to mean that the user can also be confused by the syntax. 18:46
pmichaud TimToady: is that just "gappy dot"?
Juerd TimToady: Is there any difference between <ws> and \s+?
TimToady <ws> includes comments and pod presumably. "gappy dot" didn't require a dot after the whitespace. 18:47
Juerd Aha
TimToady This is a compromise that allows both $x... .foo and $x. .foo
And $x.. .$foo if your'e so inclined.
Juerd and $foo............................................
.$bar :)
TimToady but $x..$y is still a range, as is ($x...) 18:48
Juerd TimToady: Is there any specific reason for not allowing ... after the <ws>?
Foo...
...bar
...baz
is quite common in normal languages
Though perhaps that it means something else should be a blinking sign that it shouldn't be used for this ;) 18:49
s/;/:/
TimToady my problem with ...bar() is that it doesn't look like .bar() at all. 18:50
pmichaud so, juerd's proposal would be more like /\.+<ws>\.*<before \.>/
TimToady To me $x... ...bar() comes out to $xbar().
$x........................... 18:51
................................bar()
xinming ......
pmichaud heh, that reminds me of /* ... */ in C/C++. $x... wait for it ...bar()
TimToady
.oO(...)
Juerd pmichaud: No, credits for ... ... go to David Green. I myself am not entirely convinced the second ... is a good idea, but I like it visually. 18:52
TimToady $x... --- ...bar() # sos
Juerd ... we could have
multiline
comments ... 18:53
;)
pmichaud that needs to be the debugging operator. infix:<...---...>
Juerd ...---... is the yadayadayadaaaaaaaaaaaaaaaaaaaaaaaaaaaargh operator?
pmichaud TimToady: I don't see a problem with implementing /\.+<ws>/, fwiw 18:54
Juerd I think it's wonderful.
TimToady Well, let's bounce it off of p6l and see if juerd complains there. :) 18:55
pmichaud I think maybe it should be /\.+<ws><before \.>/, however, and we require the <ws> to be non-empty
Juerd I think a special syntax for being able to format your code better is unique to Perl, or at least typical.
TimToady: ;)
TimToady $x. . . . . . . . . .42 # TOC entry. 18:56
19:00 dduncan joined
pmichaud gotta go look at a house, bbiab 19:01
19:06 autark joined
svnbot6 r9859 | Darren_Duncan++ | ext/Rosetta/ : multiple docs updates in Language.pod and SeeAlso.pod 19:22
19:29 dduncan left 19:44 b_jonas joined
pmichaud so, does this mean that it's valid to write $x... ... to mean $x..Inf ? 19:45
PerlJam ouch
that hurts my eyes
pmichaud I think it really brings out just how big "Inf" can be. :-) 19:46
PerlJam And if we can chain ranges, then $x... ... ... ... ... ... is valid too
pmichaud uhhhh, no. Range is C<..> 19:47
oh, I see
never mind :-)
ranges are non-chaining, fortunately
(see S03)
PerlJam perl6 sure has opened up new avenues for obfuscation 19:48
btw, I think you guys are crazy to allow $x.................... .foo 19:49
$x. .foo I can stand though
and in fact, it's looking better and better :) 19:50
TimToady I suspect best practices will be to use . to continue on this line and ... to continue on the next line.
pmichaud TimToady: in S03, can we get rid of the phrase that talks about the "yada yada yada" operator? 19:51
and change it to be the "yada yada yada" term?
TimToady I thought we'd already put a note to that effect, but maybe it was somewhere else.
pmichaud However, ... as a term is the "yada, yada, yada" operator, which is used as the body in function prototypes. It complains bitterly (by calling fail) if it is ever executed. Variant ??? calls warn, and !!! calls die.
it does say "as a term" there, but I think people tend to focus on the word "operator" and translate that to "infix" 19:52
it's a minor nit, but one I thought I'd point out :-)
TimToady maybe it's a prefix operator. 19:53
pmichaud interestingly, postfix:<...> doesn't appear in the operator precedence table at the bottom of S03
TimToady should
b_jonas but that's right, because it does have a precedence
pmichaud where should postfix:<...> go? I'm guessing autoincrement precedence...? 19:54
b_jonas to decide if $x + 1 .. means ($x + 1) .. or $x + (1 ..)
pmichaud or, given that, perhaps it should be lower 19:55
b_jonas if it's the range operator, it should have about the same precedence as the infix range I think
19:55 _bernhard joined
PerlJam So ... would $foo.*bar become $foo.... .*bar or $foo.*... .bar or $foo. * .bar or what? I'm guessing it would be the first. 20:08
pmichaud pj: you lost me there 20:12
but $foo.*bar would be postfix:<.*>($foo, bar) or something like that 20:13
PerlJam The other method invocation syntaxes. A.B A.*B A.+B and A.?B (IIRC)
pmichaud $foo.*B is $foo... .*B
the /\.+\s<ws>/ allows one to move the postfix thingy away from the term 20:14
20:16 SamB joined, hexmode joined
PerlJam right, I'm just not taking any "obvious" thing for granted :-) 20:16
pmichaud <pmichaud>but $foo.*bar would be postfix:<.*>($foo, bar) or something like that <---- ignore that, I wasn't thinking clearly again 20:17
my brain seems fogged today :-(
20:21 chris2_ joined
pmurias isn't $foo.*bar infix:<.*> (not thinking fully after exersise) 20:21
TimToady no, methods are always considered postfix, even with .* in front. 20:22
but they are never declared postfix:<.*foo> since we have method foo. 20:23
pmichaud TimToady: does the method name have to abut the '.*' (or '.' or whatever)? 20:24
TimToady yes
pmichaud okay, good, that's what I was hoping :-)
TimToady I think a more interesting question is whether it's $x>>. .foo or $x. >>.foo
offhand I'd guess the first, and the other would have to be written $x. .>>.foo or some such 20:25
PerlJam that just dosn't look right without a @ to me 20:27
pmichaud okay, perljam: $x. # but perljam thinks it should be @x \n .>>.foo
er, @x.
fap
PerlJam pmichaud: I hope this isn't affecting your perl6 work today ;-) 20:28
pmichaud pj: you mean the brain cloud? no, not really
I'm trying to decide how I want to code/structure the past-->post translation at the moment 20:29
TimToady doesn't matter, since left side is scalar context even with >>, so you'll get an array one way or another. Though in the case of $x containing an array, you can certainly wite @$x if it makes you--except that the precedence would now attach the . more tightly than the @, so it'd have to be @($x)>>.foo or $x[]>>.foo 20:30
/you/you happy/ 20:31
PerlJam Yeah, but that's what I expected that I needed to write.
you've shattered that expectation though
:)
20:37 chris2 joined 20:57 colares joined
pmurias hello world from an embeded parrot in perl5 works! 21:00
pmichaud pmurias: nice 21:01
webmind yay :)
21:07 nirgle joined 21:11 chris2_ joined 21:18 iblechbot joined
pmurias dobra noc 21:41
22:01 oneiron joined 22:08 enantiodromos joined 22:11 kanru joined 22:15 stclare joined, stclare left 22:21 enantiodromos joined 22:44 nirgle left 22:53 theorbtwo joined 23:00 FurnaceBoy joined 23:32 larsen joined, deejay_ joined
deejay_ anyone here know if waitpid(-1,WNOHANG) works in Windows XP? it seems to block for me. 23:33
23:35 deejay_ left 23:40 kakos joined 23:49 PolettiX joined
Toaster vaguely remembers it not 23:49