6.2.11 released! | pugs.blogs.com | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6
Set by wolverian on 12 February 2006.
00:05 Khisanth joined 00:30 vel joined 01:13 nothingmuch joined, Maddingue joined, stennie joined, Kattana joined, orafu joined, blm joined, qwacky joined, meppl joined, integral joined, Supaplex joined, ycheng_ joined, jvoorhis joined 01:14 kane-xs joined, Bit-Man joined, perlbot joined, chihchun joined, qmole joined, whiteg joined, mugwump joined 01:38 meppl joined 01:50 vborja joined 02:16 Cryptic_K joined 02:30 sapper joined 02:37 sapper left 02:56 cognominal joined 03:02 hcarty joined 03:03 hcarty left 03:10 Cryptic_K joined 03:18 Cryptic_K joined, stevan_ joined 04:01 beppu joined 04:09 Amnesiac joined 04:45 sapper joined 04:48 immie joined, immie left 05:02 kisu joined 05:23 nothingm1ch joined
gaal kolibrie: oh, another thing: "Yet Another Haskell Tutorial" has a good presentation of monads leading up to Parsec 06:23
it also has a few examples of running your own parser from the interactive haskell environment (hugs or ghci) 06:24
06:36 Cryptic_K joined 06:47 iblechbot joined 07:00 xinming joined 07:08 justatheory joined 07:18 lisppaste3 joined 07:28 xinming_ joined 07:49 f joined 08:11 elmex joined 08:34 GeJ joined 08:50 drrho joined, KingDiamond joined 08:55 Arathorn is now known as Ara4n 08:58 marmic joined 09:04 kane_ joined 09:38 iblechbot joined 10:08 rantanplan_ joined 10:18 elmex joined 10:24 gaal joined 10:36 bsb joined 10:42 nnunley joined
svnbot6 r9106 | audreyt++ | * Unbreak the precedence operator parser from incorrect application 11:03
r9106 | audreyt++ | of Schwartzian transform: longest tokens should be tried first,
r9106 | audreyt++ | not last. Reported by lwall.
11:08 nothingmuch joined 11:14 r0nny joined 11:15 r0nny joined 11:49 kisu joined 11:56 elmex joined 12:07 KingDiamond joined 12:11 chris2 joined 12:25 theorbtwo joined
svnbot6 r9107 | bsb++ | Added haddock-broken make target to get process files individually 12:30
r9107 | bsb++ | (linking between files is lost)
12:40 rantanplan_ joined
svnbot6 r9108 | gaal++ | * Pugs.Prim.Eval - attempt to load the precompiled version of a 12:48
r9108 | gaal++ | module before parsing the Perl 6 source, if it is found in the same
r9108 | gaal++ | directory as the source.
r9108 | gaal++ | Caveats: symbols are not being imported correctly yet; and the
r9108 | gaal++ | cache design is still being experimented with.
r9109 | fglock++ | iterator_engine - tests are now in a separate file 13:00
13:01 fglock joined 13:17 iblechbot joined
svnbot6 r9110 | bsb++ | r585@rex: bsb | 2006-02-22 15:18:34 +0200 13:21
r9110 | bsb++ | Parsing CODE as a ruleBlockBody, and Eval-ing as not implemented
13:26 drbean joined
spinclad gaal: re r9108, would it make sense to compare their timestamps as well (portable?) ? 13:35
13:44 drbean left
svnbot6 r9111 | bsb++ | Sketch code and commentary for CODE splicing 13:54
14:01 Qiang joined
gaal spinclad: in a word, yes, but we're thinking of a hashing scheme which is also robust against pugs internals change 14:10
14:38 vel joined
svnbot6 r9112 | fglock++ | * iterator_engine - all tests pass so far - alternation, grouping, 14:46
r9112 | fglock++ | greedy match, backtracking
r9113 | fglock++ | iterator_engine - moved experimental pge_P6Rule.grammar to a new file 14:58
15:09 nothingmuch joined
nothingmuch seen luqui 15:09
jabbot nothingmuch: luqui was seen 24 days 7 hours 22 minutes 37 seconds ago
15:13 bsb joined, sapper joined
sapper join /#ai 15:14
15:26 dvtoo_ joined 15:35 s7n joined 15:36 Amnesiac joined
stevan_ mmmm, generators in JS ajaxian.com/archives/the-future-of-...endan-eich 15:45
audreyt oooh 15:46
hey stevan_
stevan_ heya audreyt :)
audreyt has committed a lot of Synopsis changes
more on the way
nothingmuch oh, audreyt please look at my synopsis half-patch too 15:47
stevan_ wonders if audreyt is working on her tan while in .il :P
audreyt well yeah, I took a walk :) 15:48
stevan_: I cornered lwall with the "class but undef" dilemma
and we now have a complete operational semantics!
stevan_ oh oh,.. do tell
audreyt my Dog $fido .= new; # now works Just Fine (tm)
ok. the upshot is that "my Dog $fido" desugars to 15:49
my $fido;
BEGIN {variable($fido).add_class_constraint(::Dog);}
BEGIN {$fido = ::Dog}
now, ::Dog.meta is the metaclass 15:50
stevan_ hmmm
audreyt and ::Dog is a dog prototype
so far so good?
stevan_ yes
similar to what we always talked about except that ^Dog is not ::Dog.meta
hmmm, 15:52
so in effect, my Int $num; becomes
my $int; 15:53
BEGIN { variable($int).add_class_constriant(::Int) }
audreyt yes.
stevan_ BEGIN { $int = ::Int }
very nice
I like the consistency there
cant &add_class_constraint just be a method of Scalar? 15:55
then we can remove the variable() part
15:55 hexmode joined
audreyt well, no, because variable() talks about the ocntianer 15:57
$int.foo always FETCH first
and then call .foo
but let me go on
::Dog as a prototype object 15:59
has the .defined slot set to false
and consequently, boolifies to false as well
16:00 scw joined
audreyt but it does take methods 16:01
and dispatches them using normal instance dispatch rules
this leads the the idiom
method meth { self ?? self.class_method !! self.instance_method } 16:02
stevan_ is on a conf call,.. sorry :)
audreyt if you really want to test if something is an object, don't use .defined, use .id
Juerd audreyt: Wouldn't self be a class in case of a class method call?
16:04 justatheory joined
audreyt Juerd: no, self is a prototypical object 16:05
the class is always in self.meta now
Juerd I see 16:06
Are prototypical objects false?
16:06 scw joined
Juerd Oh, NOW I get what you said before 16:06
Nevermind :)
audreyt ok :) 16:10
16:12 scw joined
audreyt some more news (already checked in): 16:13
$x = sub foo { ... } # valid
$x = my Int sub { ... } # valid, replaces a/an 16:14
same goes for "class" and "module" and "role"
16:20 KingDiamond joined 16:27 iblechbot joined
kolibrie gaal: thanks for the link to www.cs.uu.nl/~daan/download/parsec/parsec.html 16:59
17:09 chris2 joined 17:11 vel joined 17:15 Ovid joined
svnbot6 r9114 | fglock++ | iterator_engine_p6grammar.pl - experimental implementation of a grammar 17:23
r9114 | fglock++ | that could parse pge/P6Rule.grammar - the grammar itself is compiled using
r9114 | fglock++ | iterator_engine_p6regex.pl
17:43 xinming joined
svnbot6 r9115 | fglock++ | iterator_engine - alternation terms are given by an arrayref, so the 17:50
r9115 | fglock++ | grammar can now be modified at runtime
audreyt amazing revelation: ./foo is now spelled $.foo 18:16
(or @.foo, or %.foo, depending on the context)
s/context/context you want/
18:20 justatheory joined
stevan_ audreyt: is that because we no longer have the $.bar public attribute twigil? 18:22
theorbtwo Waitasecond... method calls on self take the sigil of the type returned, but everything else takes the sigil of the type being used? 18:23
Khisanth hrm that is actually nicer, but what happened to implicit contexts?
oh wait, nvm 18:24
theorbtwo We have @array[42] (takes an element of @array), but @.children (calls children on $self)?
...and sin($pi/3) (runs a function on nothing).
audreyt also, pugs implemented $obj.foo.(1) as $obj.foo().(1) 18:27
while S12 explicitly required it to $obj.foo(1) 18:28
so this needs to change
and that will make
$.foo(1,2,3)
essentially self.foo(1,2,3)
theorbtwo: yes, because @.children is parsed as a variable 18:29
18:29 dethote joined
audreyt stevan_: $.bar is a public attribute still 18:30
stevan_: but it's now virtual
and merely means calling self.bar in scalar context.
to access the attribute slot concretely, use $!bar 18:31
of course, if there's no subclasses, then $.bar and $!bar points the same thing.
stevan_ yup
ok that works
audreyt so instead of in javascript where everything is slots
and methods are just slots with closures as content 18:32
stevan_ so attributes are virtual just like methods because the "normal" means of accessing them is actually desugared into a method
audreyt in perl6 it's the other way
everything is methods, and accessors proxies for concrete slots
outside the class body you cannot mention $!
$!x that is 18:33
so everything becomes virtual.
stevan_ cool
audreyt also, the old "use optimized :closed" thing which I was never comfortable with 18:35
svnbot6 r9116 | fglock++ | iterator_engine_p6regex - added a list of implemented/not implemented features
audreyt can now be spelled as... *rimshot*
pugs -O
;)
stevan_ LOL
BTW - the rimshot usually comes after the joke ;)
audreyt (and the cached bytecode would save optimized (closed/finalized) form and unoptimised form as two files)
okay, I stand rimshotted 18:36
stevan_ :D
18:36 KingDiamond joined
audreyt stevan_: so, is the "class but undef" thing grokkable? 18:36
stevan_ audreyt: yes, I think 18:37
audreyt excellent
theorbtwo The phrase you were looking for was "drum roll, please".
stevan_ not for chromatics "average joe programmer", but they dont need to
audreyt theorbtwo: thank you
18:40 calanya joined 18:41 Shachaf joined 19:16 audreyt is now known as audreyT 19:17 audreyT is now known as audreyt
ingy hi audreyt! 19:17
audreyt greetings ingy 19:18
ingy it's been so long
when do you land in Taiwan?
audreyt 17th I think 19:19
19:19 anatoly joined
clkao audreyt: when do you land japan? 19:19
audreyt but I'm going to YAPC Chicago
clkao: right before the conference -- maybe staying a bit extended afterwards
ingy oh cool, me too
audreyt and I'm still thinking about OSCON
ingy yay
audreyt and/or Euro
clkao ah. i am staying beforehands
ingy audreyt: did you see my Jemplate?
audreyt ingy: no, not yet 19:20
ingy I ported TT2 to js
blog.ingy.net/2006/02/jemplate_a_te...it_fo.html 19:21
audreyt: I also ported Test.Base to js :) 19:22
19:23 rantanplan_ joined, KingDiamond joined
svnbot6 r9117 | bsb++ | Bundle MissingH.FileArchive.GZip, dependencies and license 19:38
19:40 larsen joined 19:51 justatheory joined
svnbot6 r9118 | audreyt++ | * Mikhael Goikhman suggested that we add a GNU-configure-like 19:53
r9118 | audreyt++ | configure script, much like perl5's configure.gnu, that
r9118 | audreyt++ | accepts --long-options and writes a Makefile just as
r9118 | audreyt++ | "perl Makefile.PL" will do.
r9118 | audreyt++ | (the full translation layer from autoconf options to
r9118 | audreyt++ | Module::Install options is for the later -- we are
r9118 | audreyt++ | just committing a stub now for compatibility.)
audreyt ingy: wow. 20:03
ingy audreyt: :) 20:08
audreyt ingy: you outingyed yourself
ingy I got lucky 20:09
TT2 was practically made for this
abw++
audreyt watches search.cpan.org/src/INGY/Jemplate-0.../body.html
==> svn.kwiki.org/ingy/Jemplate/example...index.html
Juerd Hm, piping webpages... 20:10
ingy audreyt: and the Test.Base runtime tests: svn.kwiki.org/ingy/Jemplate/tests/index.html 20:11
nnunley I read Audrey's paste as '...Jemplate/extract' and thought, 'That was fast.'
nothingmuch audreyt: is this you
ingy hi nothingmuch
nothingmuch hi ingy
ingy nothingmuch: going to yapc?
nothingmuch nothingmuch: which? 20:12
err
ingy:
audreyt nothingmuch: you just outnothingmuched yourself
nothingmuch sub postfix:<āˆ… 20:13
>
ingy nothingmuch: I'm going to Tokyo and Chicago at least 20:14
nothingmuch bash.org/?23396 20:15
ingy: i might be going to Chicago
ask stevan_
tokyo - no chance
stevan_ ingy: he will be going to chicago if we hire him by then ;)
nothingmuch that's 4 months from now you asshole 20:17
what does that mean?
ingy will nothingmuch move to usa if hired? 20:18
audreyt anatoly: www.haskell.org/arrows/
nothingmuch ingy: yes
ingy nothingmuch: w00t
we can do some road trips 20:19
seedy motels etc ;)
nothingmuch ingy: yeah
by bicycle though
stevan_ starts writing the script for "Brokeback Perl Hackers"
nothingmuch =D
ingy nothingmuch: sure
nothingmuch: I'm homeless these days so right on 20:20
nothingmuch wonders if ingy is still interested in showering with audreyt post runtime casting?
why homeless?
stevan_ would think it would make that shower much more "intersting" now 20:21
ingy nothingmuch: because I have no home
qed
nothingmuch ingy: i didn't ask "why are you calling yourself homeless"
i asked why are you homeless
ingy nothingmuch: I'm not sure 20:22
it's a weird question...
it's just that way...
20:23 justatheory joined
ingy my home is on the Net 20:23
dot Net = dweller of the Net
obra "What's your home address block, baby?"
ingy :)
I think having a home is just like a scab that healed and fell off 20:24
so wondering why I don't have a home is like wondering where the scab went 20:25
obra ingy: where's your car parked?
ingy it's insignificant
obra: Portland, and my mail goes there too
obra *nod* 20:26
you know you can get a mail->email gateway?
ingy really?
obra yeah.
I'll try to dig up the url
they scan and email everything
ingy thanks
msg it to me
obra and will optionall mail you a CD each year
ingy cool
20:29 TMTOWTDIt left
clkao ingy: but you have a scooter! 20:29
nothingmuch anatoly: feather.perl6.nl/~nothingmuch/harrorth/ 20:30
anatoly: specifically: feather.perl6.nl/~nothingmuch/harro...oc/04.kwid 20:31
20:34 vborja joined
audreyt gaal: perlcabal.org/~autrijus/tmp/DrIFT.tgz 20:35
(the Pugs-DrIFT sdk -- extract it in the updir of pugs)
integral audreyt: oh, I use DrIFT's own darcs for pugs, is that one different? 20:36
audreyt integral: not at all -- this one is just with symlinks
(to our UserRules) 20:37
integral oh, interesting. I wonder how mine is actually working then ;-)
audreyt it might not be ;)
(because we check in the drifted output to the src tree) 20:38
(so other developers won't need to -- unless you touch .hs-drift files)
integral I was touching them :)
I was fiddling with changing VStr to a FPS, but that's silly since FPS only does the first 256 unicode codepoints
audreyt not that silly though 20:39
unicode semantics only applies when you are asking .chars
and we can decodeUTF8 then
and only the
n
integral but surely there's other code paths that compare chars, search strings, etc other than .chars? 20:41
audreyt in .substr 20:42
and .index, yes
but those were using fromVal anyway
instance Value String where ... full unicode ... 20:43
integral okay, cool, I won't nuke my patch then :)
audreyt instance Value FastString where ... octets ...
contexts are a good thing :)
as long as the fromVal of String uses decodeUTF8
we are in good hands
integral ah, yes, I think I get the idea, I did have to write some new instances :)
audreyt just one instance... :) 20:44
(FastString)
which is identity anyway
and you have to fix the String instance to introduce a cast
but that's all :) 20:45
integral well I actually wrote the String instance since the existing one was a VStr
audreyt ahhhh.
right.
excellent, even better
audreyt praises type synonyms
integral hmm, that URL for DrIFT above doesn't work :-/
audreyt s/perlcabal.org/feather.perl6.nl/ 20:46
integral thanks! :) 20:47
20:47 xinming joined
lumi audreyt: ping 20:55
nothingmuch lumi: just extend your leg
Juerd audreyt: Is perlcabal.org broken?
20:56 szabgab joined
nothingmuch Juerd: she says it works for her 20:56
lumi I wanna be non-breaking
nothingmuch but i think her concentration is limited
audreyt lumi: pong
nothingmuch ah
szabgab just looking around
audreyt sub f ($x) { BEGIN { say f(10) }; $x * 10 } 20:57
szabgab gaal ?
audreyt lwall: that's what I was generalizing
nothingmuch szabgab: on the phone with rasn
ran
szabgab ok bbs 20:58
gaal szabgab: hello
szabgab: I have to go out in a few min 20:59
to pick up ran
can you /msg?
brb 21:00
21:00 putter joined
putter should have just cleaned up the regexp spike, rather than aiming for clean&correct. a bridge too far. 21:02
question: in p6, when parsing enters a regex, does $?PARSER change to something regex-y? 21:04
szabgab gaal: i am back 21:05
szbalint szabgab: hello. :)
szabgab szia
szbalint Hogy vagy? Ha jol latom nagyban hackeltek :P 21:06
szabgab En otthon vagyok, nem tudtam fenn maradni a hegyen
mennek mar aludni ha ez a gaal elokerul 21:07
szbalint Ah ertem.
szabgab en csak fuvaroztam oket tegnap 21:08
szbalint :))
21:09 Shachaf joined
audreyt putter: hm, not sure 21:11
svnbot6 r9119 | audreyt++ | * don't use runghc; instead compile DrIFT as an executable and
r9119 | audreyt++ | invoke it much as ./Setup.exe does. Required by lumi because
r9119 | audreyt++ | runghc is broken on OSX for DrIFT.
21:12 jeh_ joined
integral has been running make in the drift dir... 21:12
feather's popular tonight 21:20
svnbot6 r9120 | fglock++ | * iterator_engine_p6grammar.pl - added perl5 emitter (incomplete) - 21:23
r9120 | fglock++ | will generate a package with parsing subs
gaal szabgab: so am I, hellow
szabgab I am still here 21:24
trying to put together the picture I too in Nazareth
has Ran arrived then ?
anatoly he has, yes 21:25
fglock putter: ping 21:26
gaal szabgab: sorry, i must shut down my computer
brb
szabgab So do I guess corectly that he is without a car? 21:27
21:27 gaal left
anatoly he's without a car 21:30
Juerd Oh, good that you mention it 21:32
rafl: My car's fixed
nothingmuch ingy: INGY!!!!!!!!!!! 21:34
svnbot6 r9121 | fglock++ | iterator_engine_pge_P6Rule.grammar.pl - obsolete, will be generated automatically
21:34 elmex joined
putter re $?PARSER becoming regex-y, I think the answer is "possible, but unlikely". I was confused. 21:36
svnbot6 r9122 | fglock++ | iterator_engine_p6regex.* - renamed iterator_engine_p6rule.*
putter fglock: pong
audreyt putter: a sec, I'll ask lwall 21:37
fglock putter: some progress today - simple grammar files will soon be compiled using a bootstrapped grammar
putter audreyt: no need I think. I was confusing 21:38
grammar context in which one is running, vs tool doing the running. I think.
21:38 gaal joined
gaal rehi 21:38
szabgab re 21:39
gaal hey. can you /msg?
audreyt putter: what's the use case here?
21:39 r0nny_ joined
audreyt for $?PARSER that is 21:40
putter fglock: neat. I find myself going back and forth between "I hope fglock isnt wasting his time" and "I'm so glad fglock has something which actually works". ;)
fglock me too - I didn't plan to go so far. It is surprising that it works with just 15kb of code. perl5++ 21:42
audreyt putter: lwall thinks $?PARSER stays the same, I think 21:44
gaal gabor?
szabgab yes
gaal can you do /msg?
szabgab I tried to /msg you but it seem it does not work 21:45
though I saw your ping
gaal you need to regiseter in freenode to send them. never mind, plese join #ad_hoc_msg 21:46
integral gaal: /chanserv set unfiltered on # allows you to receive any messages
gaal integral: thanks
fglock it is small enough that it can't be too difficult to translate to javascript :)
putter audreyt: No use case, I'm just puzzling. I'm puzzling over p5's /x, and also regex termination chars (eg, the usual "/"). (?x) really switches you to a different grammar, though one with a lot of overlap with the default one. One can handle it dynamically (local $we're_in_x_now). One can handle it with grammar inheritance (grammar p5re_x is p5re {...}). I'm trying 21:48
obra is its own repo
putter to get myself less fuzzy on how dynamic/static grammars, and rules they contain which care about their grammar context, play together. 21:50
21:50 szabgab left
svnbot6 r9123 | bsb++ | Added list of names for the below (and recursive thoughts on recursive macros) 21:51
r9123 | bsb++ | macro max ($x is wehavethunkevaluatereduceonceallassynonyms,
r9123 | bsb++ | $y is wehavethunkevaluatereduceonceallassynonyms) {}
putter fglock: :) 21:52
audreyt hm, is no.perlcabal.org and perlcabal.org still unreachable? 21:55
(I just reset the DNS propagation)
putter didn't mean to invoke hackathon instant-p6l @larry power. ;)
audreyt: works for me (and it wasnt in my local cache) 21:56
audreyt k
thanks :) 21:59
putter fglock: yes. I'm hoping we end up with things clean enough that spinning off multiple implementations is both easy and makes sense. 22:00
"so putter, why are you writing a regex engine? putter: because I am tired of writing regex engines and hope to never have to do it again". there's just something about that logic that seems questionable... ;) 22:02
fglock: I was thinking how much boostrap hassle was saved by having Regexp::Parser... but didn't use it, did you? you bootstrapped from scratch? fglock++ 22:04
s/but/but you/ 22:05
rafl Juerd: Yay!
Juerd: Beds are booked. 22:06
putter lol
ahh
fglock putter: I used no modules but Test::More
putter :)
22:09 sili joined
putter have you explored the p6 side of testing opportunities? err, for p6 regexs? sometime soonish I have to actually start running real p6 tests. prehaps re_tests translated, or munged t/rules or parrot t/compilers/pge). Wish there were Regexp::Testing and Perl6::Rule::Testing modules. ;) 22:10
s/modules/module hierarchies/
I almost created Regexp::Test::ReTests, but the "is it of general interest?" cpan filter killed the idea. :/ 22:12
Juerd rafl: Nice; thanks.
rafl: Note that I have (on purpose) *not* asked anyone if it's okay to sleep in my office
putter :) 22:13
Juerd I've done it several times before, and it's no problem. It is a problem if you ask, though :)
putter i remember 22:14
22:14 larry joined
putter (fuzzily) 22:14
fglock putter: it is not powerful enough for passing real tests yet
integral argh, type should be banned, at least where newtype should be used :-P
fglock putter: but it could be used to parse tests out of the p6 suite and re-emit them to p5 22:15
audreyt larry: hi
Juerd Is this the real Mr. Toady? :) 22:16
nothingmuch nobody is panicking
yes, it is =)
Juerd Neat :)
nothingmuch audreyt: is explaining irssi to TheLarry =)
i doubt he will talk though
Juerd Hi larry :)
(Huh, the nickname "larry" was available?!)
(How does that happen on such a large network...)
putter fglock: that sounds... hard. I was just wondering if you were an Xsomething fanatic... "of course I have a complete test suite, I've started coding the application haven't I?" ;) 22:17
audreyt Juerd: it's registered by someone else I think, just not currently logged on
Juerd I see 22:18
23:31 -NickServ(NickServ@services.)- Nickname: larry 22:19
23:31 -NickServ(NickServ@services.)- Registered: 1 year 19 weeks 5 days (22h 21m 5s) ago
23:31 -NickServ(NickServ@services.)- Last Seen: 1 year 18 weeks 2 days (21h 46m 42s) ago
That poses no real threat :)
audreyt indeed :)
szbalint TimToady is free
fglock putter: that's how it compiles grammars - it has a minimal "grammar grammar" that only understands [grammar|rule|pod]. It could be used to run "rule" tests with some tweaks 22:20
Juerd szbalint: I'd be much surprise if it were taken
22:20 SamB joined, larry is now known as lwall 22:21 lwall is now known as TimToady
fglock putter: "grammar grammar" is compiled using "rule grammar", which is written by hand 22:21
audreyt cool, TimToady is registerable 22:22
(and registered)
TimToady: so next time, simply typing "irssi" should bring back this workspace 22:23
22:23 stevan joined
audreyt stevan: rehi 22:24
fglock putter: re performance - match objects could be built by an emitter - so the internals of the rule-engine can remain unboxed
TimToady wonders whether he has taken one step too far down the slippery slope.
anatoly you're definitely doomed. 22:25
fglock TimToady: welcome
audreyt fglock, putter: there's a rule foo { 0x (\d+) { return Literal.new(:16($0)) } } form now, which allows incremental build of captured objects from within rules
22:25 Blicero joined
Juerd TimToady: Just try to not get addicted :) 22:25
TimToady fglock: thanks...I think... 22:26
putter oooooo, neat :)
TimToady Juerd: too late...
szbalint great :)
Juerd Oh, you're quick :)
audreyt putter: basically the {return} functions as a binding to $<>
which is the capture object (accessible as $<>, or ~$/, or +$/)
the latter two forms are stringified and numified versions of the capture object
so the match object carries a capture object 22:27
putter capture object? something distinct from a match object? (putter had been thinking it was matches all the way down...) 22:28
audreyt putter: it used to be that +$/ and ~$/ returns the actual capture 22:30
svnbot6 r9124 | audreyt++ | * chromatic reported that -optc-O3 didn't work on OSX.
audreyt in number of string context
it doesn't really do that by substr()'ing using .begin and .end
because the original string may change in the meantime
so they actually captures a copy of the substring that it matches 22:31
now TimToady relaxed it so that it can capture any objects
and call that capture object $<>
TimToady: it's not part of S05 yet, iirc
the $<> notation
but in any case, that's what gets bound when you say "return" inside an interpolated closure. 22:32
Juerd lost his Wacom pen again. Why are these things wireless?
audreyt you can also explicit bind it using :=
TimToady audreyt: I haven't been the official maintainer of that lately...
putter ah, "capture object" as "match object currently being captured", now generalized to non-match objects?
audreyt putter: more like, match objects captured only substrings previously
but p6 is not tcl
sili doh
audreyt so it can now capture other things as well
22:33 rantanplan_ joined
audreyt the match object maintains the begin/end positions; the named submatches; the positional submatches 22:34
_and_ a capture object
which is usually a substring of the original string 22:35
but can now be something else
22:36 mtk00 joined
Juerd Are these substrings CoW? 22:36
(Or, well, reversed-cow)
putter audreyt: ah. ok. the non-pugs Match objects (pil2js, spike, etal), already broke the substr out separately, but hadn't considered it as potentially non-string.
integral Juerd: if it's based on FastPackedString it should be possible 22:37
audreyt Juerd: what integral said 22:38
Juerd Because with nested captures, you're very quickly duplicating data if not.
Cool.
integral but currently I'm still in bodge mode with the VStr FPS stuff
putter I think all they need is a field name change to avoid being misleading. The capture object seems still the right thing to return when stringification is requested. And other than bool/str/array/hash-ification, they're are rather passive objects. The post-spike MatchX2.pm is actually speced as an open api, with 22:42
match_hash etc fields, just because match trees become parse trees, and the runtime cost of going through overload when doing tree grovels, is prohibitive. though perhaps now, it will be less likely for match trees to be parse trees? hmm... 22:43
audreyt putter: I think the idea is to do as parsec does 22:45
namely the captureobj tree becomes the parse tree 22:46
not the match tree itself
which greatly simplifies things
22:46 xinming joined
fglock audreyt: so what is returned by {<code>} becomes a node in the ast? what is the default, when there is no code? 22:48
22:49 justatheory joined
audreyt fglock: the default is the captured string 22:49
"123" ~~ /123/
$<> is the Str "123"
~$/ too
and +$/ is 123
makes sense?
$/ is the match object 22:50
which dispatches its ~ and + to $<>
Juerd Why does it do that?
audreyt which is shorthand for $/.{''}
22:50 avar joined
Juerd Just because it can? 22:51
audreyt Juerd: also because that's what the user expects
at least p5
fglock rule{ (<ident>)++; { {increment=>$0,} } } - would this work? 22:52
putter hmm, fglock, good question. so {<code>} unavoidably binds $<> ? { $0 < 256 or fail } sets $<> to "true"? or { return 3 } behaves differently than { 3 } ?
audreyt if $str ~~ /\d/ { say $_ * 100 }
putter: nono
just the exceptional "return" form
otherwise it's just used for the side effects
the "return" form pulls control out of the current rule
and immediately binds the capture object and matches 22:53
fglock: yes, you can refer to captures from within {code}
fglock rule{ (<ident>)\+\+\; { {increment=>$0,} } }
Juerd Okay, I think I just don't get what the benefit of the $/<> to $<> shorthand is...
audreyt Juerd: it's already so that $/<named> can be abbreviated $<named>
just like $/[10] can be called $10
this just generalizes that
fglock rule{ (<ident>)\+\+\; { return {increment=>$0,} } } - right? 22:54
Juerd audreyt: Okay. I'll just assume that on some keyboards, / is awkward to type :)
putter so { return 3 } behaves differently than { 3 }, but there's more going on. ... { return 3 } ... is equiv... hmm, is this an entirely new control mechanism? putter tries to think of an transformation to commits... 22:55
audreyt (note that $<> is short for ${''})
Juerd: oh and ./method is gone, and I'm finally happy for it :) 22:56
audreyt is happy about $.method
Juerd audreyt: With self, I don't mind at all.
audreyt Juerd: it's now spelled $.method too
Juerd Oh, $?
I missed that
When did this happen? :)
audreyt and @.method, depending on the context you want
Juerd: I just commnitted to S12
fglock must go :( &
audreyt 1.5hr ago
$.method(1,2,3) 22:57
putter fglock: &
Juerd But...
$.foo is also used for attribute variables.
audreyt putter: it's not... just as you are doing, rules are decomposed to methods
22:57 fglock left, xinming joined
Juerd And I'd expect $.foo() to call a sub(ref) stored in one 22:57
Is my logic old fashioned? :)
TimToady Juerd: yep 22:58
audreyt Juerd: $obj.foo.(3); is always specced as $obj.foo(3)
it's just I missed that ;)
TimToady $.foo(1,2,3) always desugars to self.foo(1,2,3) or some such
Even in the class $.foo is a virtual reference, and you use $!foo 22:59
Juerd TimToady: Ah, so access of an attribute variable is *always* done through its accessor?
TimToady for a physical storage ref, and that probably on in
only in submethods.
audreyt putter: anyway. rules are decomposed to code. "return" just escapes the dynamic scope with a value. a match method returns with the capture object, _and_ changes the $/ given to it
Juerd Hmmm... I need to purge parts of my memory and re-read documents. 23:00
putter audreyt: but this is the first time you can actually *see* those semantics, as opposed to them being implementation details.
TimToady juerd: only if you use the $. form.
audreyt putter: aye. but otoh, it makes it possible to say
grammar Foo { method bar { ... }; rule baz { <bar> } }
TimToady The $! form is expclitily non-virtual.
audreyt and allow bar to hook to (say) OpTable 23:01
or (say) PCRE
Juerd TimToady: Is $!foo the non-virtual variable that $.foo uses too?
audreyt or (say) antlr
TimToady the bare $x form also means $!x.
Juerd I think I get it :)
audreyt and I think it's rather nice :)
Juerd Does "has" still require the . twigil, then?
audreyt nope, you can say "has $x"
means same as "has $.x" 23:02
TimToady juerd: yes $!foo is the "real" $.foo 23:03
Juerd Ahh
Perfect!
putter audreyt: I dislike the semantics (I've always looked forward to having an inline/stays-open flavor regexs, that subsequent normal code can fail back into). I'm just flagging this as a nontrivial change.
Juerd This is very close to what I silently wanted :)
TimToady It's actually been in the works for a while, but somehow didn't get into any synopsis...
audreyt putter: k. 23:04
putter re grammar Foo { method bar { ... }; rule baz { <bar> } }, are rules no longer in their own namespace? or methods in grammars end up in that namespace?
TimToady I've recently hired a new ghostwriter, so things are moving faster.
Juerd I really like that there is no indication of duration in the variable name anymore.
What's a ghostwriter?
putter audreyt: OOPS, s/dislike/dont dislike/
TimToady Someone who actually does the writing, but I get all the credit. 23:05
audreyt <- that someone
putter (it was *dont* dislike, and i guess I deemphasized the "*dont*" but removing it. oops)
Juerd Ah
cognominal recently in perlmonks someone wanted a qw() that supported comments, is there an idiom for that in perl6?
audreyt putter: yeah, I think rules are now specced to completely desugar to meths
Juerd cognominal: <<>>, IIRC 23:06
23:06 avar joined
cognominal I was surprised not to see TimToady pushing a Perl6 solution :) 23:06
TimToady cognominal: I don't think we actually said anything about comments, but considering that it's "shell quoting", and shells have comments, they could sneak in there... 23:07
Juerd It could still happen
TimToady: But let's not have \\\n :)
TimToady Didn't see that PM thread...
audreyt shells have line-terminated comments 23:08
Juerd audreyt: That was implied :)
TimToady So put line breaks in.
audreyt purrs randomly
Juerd 0:08 am. I should go home.
afk
audreyt my @x = << 23:09
This is some splitted words # but not this
and this too # but not this 23:10
>>;
putter scratches audreyt
cognominal I think the thread was recent, but a I found a similar one: www.perlmonks.org/?node=qw+comments...ton=Search
audreyt ponders audreynip
putter audreyt: so, has there been any thoughts on what $_ and pos() desugar into? hmm... though we may be all the way to no longer needing a "search state" "object"... 23:11
audreyt is there still such a thing as pos()? 23:12
oh, there is
putter think so, of the search, though not necessarily of some particular string (as in p5). 23:13
audreyt well, no, S05 stipulates it's still per-string
putter I'd been thinking $_ might be more than a mere string. though some of the examples in S05 perhaps make that interpretation a bit strained. 23:15
audreyt indeed. 23:16
I think it's mere 23:17
do you have some specific interpretation in mind?
hm, anyone had experience setting up SVN::Notify?
(or any other system that tracks a svn and post mails) 23:18
szbalint commit notices?
audreyt yeah 23:19
I'd like to get the commits to the official spec repository to be posted to p6l
to facilitate discussion
and avoid the "the language changes silently" syndrome
23:20 ilogger2 joined
putter non-desugared, I can make $_ be anything with the correct behavior. desugared... S05 doesnt actually show .pos called on anything but $_ . if there were a $_posvar which got magic'ed into existence when a $_ did, and $_.pos was just sugar for $_posvar, then strings wouldnt have to carry single pos fields, to the bane of multi-threading and... 23:21
basically, if you cant scope the <string,pos> association, then... 23:22
szbalint hmmm, we use such stuff at work but it wasn't me who set it up, sorry. :\
putter I guess that's the key idea. I want the association between a string and a pos to be scoped. 23:23
TimToady putter: the original idea was the $_ was the invocant/topic that was actually the current parse state proxying for the original $_. 23:24
So the original conception was, in fact, scoped that way.
putter right. I'd been thinking the same thing. but as desuggaring becomes a theme, I was trying to make the parse state go way... 23:25
TimToady I don't think you need to desugar $_ there--it really is $_ for that closure. 23:26
putter right. $_ can be a parse state, in which case $_.pos is just a method, and desuggared code explicitly creates a parser state object from a string. (hmm, wonder how that interacts with eq...) Or, $_ can be 23:29
a bare normal object, in which case $_.pos has to be desuggared to... something... since one doesnt want normal objects to have a concept of pos. 23:30
audreyt wait a minute... I think $str.pos works
much like in perl5
putter does it? 23:31
TimToady audreyt: it shouldn't. It should return an opaque position object.
audreyt TimToady: sure, but it's still per-string
putter:
o The ":c" (or ":continue") modifier causes the pattern to continue
scanning from the string's current ".pos":
o The ":p" (or ":pos") modifier causes the pattern to try to match
only at the string's current ".pos":
clearly it indicates a pre-string .pos 23:32
putter audreyt: unless "the string" is $_, the string currently being parsed. 23:33
but yeah, :c and :p would be rather less useful if not. 23:34
audreyt putter: according to timtoady, outside a parsing rule match
we can still get to arbitrary $str.pos
TimToady You want to be able to feed the output of $str.pos to substr, fer instance. 23:35
putter is there some way to ask a $str for a _new_, fresh, as yet unused opaque position object unassociated with any previously used/in-use? 23:36
that would do it, i think... 23:37
cognominal Sorry for the non sequitur: "the class does not need to declare C<has
$.foo> as a property -- a C<method foo> declaration can work just as well." does that mean that object can have methods a la javascript?
TimToady putter: sure, such objects are returned by things like index(), $42.pos, etc... 23:39
or more like $42.beg and $42.end. 23:41
Juerd I think it's wise to not give $42 a .pos
That is, if Perl still resets $42 on a successful match :) 23:42
putter so, given a $str, I can somehow create a $pos1 and $pos2. so a next question is, since one usually says $str.pos, how does one switch back and forth between that meaning $pos1 or $pos2. 23:43
(hmm, though another path could be to create <str-pos> pairs, which look like $str, and... I'm not sure how that works out...) 23:44
Juerd putter: What are these $pos1 and $pos2? 23:45
putter (... doesn't get you random {my $s = ""; $s.pos}, so perhaps doesnt work out.) 23:46
Juerd (Maybe "pos" is a misleading name for a method indicating *current* position (as opposed to a specific position where a match starts, or any other arbitrary position), because the currentness is more relevant than the positionness.
)
putter Juerd: "is there some way to ask a $str for a _new_, fresh, as yet unused opaque position object unassociated with any previously used/in-use?" "putter: sure, such objects are returned by things like index(), $42.pos, etc..."
Juerd What has that to do with .pos meaning arbitrary position objects? 23:47
theorbtwo Juerd: $str.here?
Juerd theorbtwo: Or there :)
theorbtwo .pos doesn't mean an arbitrary position object. That's presumably ::Pos.
Juerd theorbtwo: Though "here" is more consistent with historic error messages :)
<-- HERE 23:48
theorbtwo nods.
Juerd I like here. It's unambiguous and in noun context still available in English :) 23:49
putter Juerd: the objective is to... oh, good question, to... retain {my $s="..."; $s.pos} in normal p6 code, while being able to directly manipulate the string-to-particular-pos-variable association, so that, for instance, two separate subs operating on the same $str could be using two distinct $str.pos'es.
theorbtwo I'm not real clear on why poses should be fullblown objects, and nonportable. 23:51
putter though $s.pos may perhaps give you a handle, not an integer, which is only useful within a desuggared regex.
theorbtwo (Esp the second bit.)
TimToady theorbtwo: they have to point between chars/graphs/codes/bytes smartly.
Juerd putter: temp $x.pos?
TimToady Integers are just wrong the moment you lose track of the "units" of a string. 23:52
theorbtwo Why can't that be 4+1/2?
putter :)
theorbtwo Hm, OK, there's more then two sorts of units.
putter Juerd: not enough, 23:53
Juerd I imagine that integers are more efficient, and possible if you fix the unit. Maybe a nice thing for an optimization module, that can introduce a certain kind of string that's always counted a certain way.
putter pauses to think 23:54
theorbtwo So drop the "full objects" objection -- why do they need to not be portable between different strings?
I'd really like a sane way of handling 5degrees+27minutes+3seconds; this would seem to be similar.
Juerd theorbtwo: What's the point of making things that point to a certain position in a string, portable between strings? 23:55
theorbtwo "Get the thing directly under this on the next line."
Juerd How is the value of a position in $foo relevant for $bar, if $bar ne $foo?
theorbtwo: But there's a real problem there: what exactly is "directly under" it? 23:56
theorbtwo In a fixed-width font it has a clear meaning.
"The same number of graphs in." 23:57
Juerd theorbtwo: You'll need to specify if you want to have that charwise, graphemewise, etc... It's a matter of affixing ".chars", and in the rare case you need this, I don't think that's a bad idea.
theorbtwo Hm, OK, I'm alright with that.
...if it makes things easier on the implementation.
Juerd theorbtwo: Is it? Many "fixed width" fonts have "full width" (as opposed to the default "half width") characters...
theorbtwo OTOH, I don't think it will.
TimToady You can always subtract two positions and get a quantity like "3 graphs".
putter Juerd: the key idea is that regex's have/had a bundle of "parser state" information. like whether the unit being operated on were :bytes or :graphs, the string being parsed, the pos of the parse on that string. what else? as regexs become a thinner and thinner layer of sugar on methods, it gets nicer if the "parser state" could 23:58
Juerd theorbtwo: Implementation is complex, given all these different units. But if it must be done correctly, there's few alternatives. When speed is needed, a more simple datatype can perhaps be invented.
putter go away as a distinct cluster of info, and get spread out into normal p6.
TimToady It takes a functional programmer to think that splattering the state all over the call map is simpler than keeping it in one place. :) 23:59
putter lol
theorbtwo chuckles.
Juerd is a dysfunctional programmer :|