pugscode.org/ | nopaste: sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by diakopter on 11 July 2007.
00:02 packafk joined 00:15 justatheory left 00:46 r0bby left 00:47 r0bby joined 00:54 devogon left 00:57 franck____ joined 01:15 franck___ left 01:56 buetow left 02:07 Entonian joined 02:10 pro21ms4 joined 02:30 daxim_ joined 02:40 pro21ms4 left 03:12 hkb_aw is now known as hakobe 03:47 hakobe is now known as hkb_aw 03:59 demq joined 04:01 weinig left 04:16 weinig joined 04:17 demerphq left 04:37 shachaf left 04:45 hkb_aw is now known as hakobe
pugs_svnbot r17197 | lwall++ | [STD] Catch various mistaken uses of p5 special variables. 05:01
r17197 | lwall++ | [cheat] comment out perlhints that pugs can't parse yet
diff: dev.pugscode.org/changeset/17197
lambdabot Title: Changeset 17197 - Pugs - Trac
05:04 kane__ joined, kane_ left 05:10 Aankhen`` joined 05:17 weinig left 05:18 weinig joined 05:28 jisom joined 06:10 kanru joined
pugs_svnbot r17198 | moritz++ | [irclog] changed footer.tmpl to be more generic, since other 06:47
r17198 | moritz++ | users don't put their own name in :(
diff: dev.pugscode.org/changeset/17198
lambdabot Title: Changeset 17198 - Pugs - Trac
moritz_ diakopter: I seem to recall that you had a workaround for evalbot with current pugs (with b0rked MMD)... 06:52
diakopter: could you please commit that? I'd like to run it on another host 06:53
Aankhen`` @type (.) 06:58
lambdabot forall b c a. (b -> c) -> (a -> b) -> a -> c
07:00 agentzh joined 07:01 agentzh left, agentzh joined 07:21 rgs joined 07:26 dduncan left 07:40 weinig left 07:47 Aankh|Clone joined 07:49 devogon joined 07:53 wilx left 07:58 wilx joined 08:06 Aankhen`` left 08:38 daxim joined 08:43 rindolf joined 08:49 tyme- joined, daxim_ left, tyme- left 09:04 daxim left 09:06 daxim joined 09:19 jisom left 09:23 buetow joined 09:26 cognominal_ left 09:27 cognominal_ joined, buetow left 09:29 buetow joined 09:32 Blwood left, Blwood joined 09:45 franck____ left, Aankh|Clone left 09:56 franck___ joined
bloonix cool, my first p6 module is ready for use :) 09:57
daxim pix or it didn't happen 10:05
moritz_ bloonix: you should check it into the pugs repository in ext/ 10:08
bloonix moritz_: at first I do some debugging and I have to write a test file 10:11
aber dann gerne :) 10:12
10:15 iblechbot joined 10:18 packafk left
pasteling "bloonix" at 87.78.219.97 pasted "sub example_4 { say "--- Run e" (14 lines, 269B) at sial.org/pbot/26657 10:23
bloonix what is wrong here?
10:27 drupek12 left 10:28 melissa joined, drupek12 joined
Gothmog_ bloonix: Probably %hash<foo bar> works like @array, eating up everything; I don't know if that's the intended functionality or not. 10:34
10:34 pro21ms4 joined
bloonix unfortunately I cant find examples in the synopsis :/ 10:35
?eval $x=1;$y=undef; $x+$y 10:39
pugsbot_r17185 Error: ā¤Unexpected "="ā¤expecting "::"ā¤Variable "$x" requires predeclaration or explicit package name
bloonix ?eval my $x=1;my $y=undef; $x+$y
pugsbot_r17185 1
bloonix should that return an error?
10:40 thoughtpolice left
moritz_ I think it should generated a warning, like in p5 10:41
Gothmog_ Grepping for assignment in the synopsis, I couldn't find anything except that list assignment works like in P5. I would expect that (%hash<foo bar>) is similar to (%hash<foo>, %hash<bar>), (like in P5, iirc) but that's just me... 10:42
moritz_ I just know that pugs doesn't implement slice context yet 10:43
bloonix hmmm I could do it (%h<foo>, %h<bar>, $baz) but a slice is nicer :)
shorter
10:46 flokuehn joined
bloonix ?eval my %h; my %c = %h<foo>; 10:52
pugsbot_r17185 {}
bloonix ?eval my %h; my %c = %h<foo>; %c
pugsbot_r17185 {}
bloonix ?eval my %h; my %c = %h<foo>; say %c;
pugsbot_r17185 OUTPUT[ā¤] Bool::True
bloonix ?eval my %h; my %c := %h<foo>; say %c; 10:53
pugsbot_r17185 OUTPUT[ā¤] Bool::True
bloonix %c := %h is identical with $c = \%h ? 10:54
10:58 elmex joined 11:26 iblechbot left 11:27 Southen joined
bloonix how can I concat strings? 11:38
p5: $x = 'foo' . 'bar' . 'baz'
?eval 'foo' ~ 'bar' ~ 'baz' 11:42
pugsbot_r17185 "foobarbaz"
bloonix fine
demq its too bad that header style string joining isnt ok. 11:45
'foo' 'bar' 'baz' 11:46
convenient for code generation
11:53 chris2 joined
moritz_ @seen diakopter 11:53
lambdabot diakopter is in #perl6. I don't know when diakopter last spoke.
bloonix yesterday moritz_ 11:54
his last word was "afk" :)
11:54 Blwood left
bloonix 21:46 < diakopter> 11:54
moritz_ my lastlog says his last word was "matchee" ;) 11:55
moritz.faui2k3.org/irclog/search.pl...ter&q=
lambdabot Title: IRC logs - Search, tinyurl.com/yuqzcf
bloonix okay "afk" was that what I read at last
11:58 kanru left 12:00 iblechbot joined 12:03 DarkWolf84 joined 12:06 kanru joined 12:07 franck___ left 12:15 Blwood joined 12:19 jiing left 12:35 pro21ms4 left, pro21ms4 joined 12:36 cognominal_ left 12:37 rindolf left 12:43 cognominal_ joined 13:30 pro21ms4 left 14:22 stevan_ joined 14:34 buetow left, iblechbot left
bloonix how can I execute system commands? 14:44
p5: open my $h, "$cmd|"
how can I do that? 14:45
*arg* 14:56
Pipe::open
15:01 Limbic_Region joined 15:06 aindilis left 15:09 aindilis joined 15:15 cognominal_ left 15:16 cognominal_ joined 15:20 stevan_ left 15:25 rindolf joined
moritz_ where is svnbot? 15:26
bloonix++ # commiting his first p6 module 15:27
avar /U/W 2 15:37
TimToady demq: your code emitter can just emit ~'foo' ~'bar' ~'baz' and it'll do the right thing 15:42
assuming some higher precedence operator doesn't strip your final arg, of course... 15:43
in which case you might want parens
but I'd say in general a code emitter should have a better sense of the structure of what it's doing than to use tricks like that 15:46
I've always been kind of insane about making code emitters produce code that resembles what a human would do 15:47
moritz_ I only do that for HTML "code" ;) 15:48
15:50 melissa left, melissa joined
TimToady whois pugs_svnbot 15:51
hmm 15:52
moritz_ could it be that changes through the web interface aren't recorded by the svnbot? 15:54
15:57 shachaf joined
rindolf Hi shachaf 15:59
shachaf rindolf: Hello.
rindolf shachaf: what's up? 16:00
shachaf rindolf: I got disconnected from the IRC server sometime yesterday. This is a pretty rare event. :-)
rindolf shachaf: I see. 16:01
moritz_ if I declare a sub/method 'is rw', how can I acces the rvalue? 16:02
demq timtoady: ive found it useful a number of times, but your point about ~'foo'~'bar' is useful. 16:18
s/is useful/resolves the issue i was thinking of/ 16:19
16:32 cognominal_ left 16:35 cognominal_ joined 16:40 iblechbot joined 16:45 chris2 left
DarkWolf84 there is nobody at the parrot channel 16:53
Tene DarkWolf84: irc.perl.org/#parrot 17:15
that one?
DarkWolf84 no 17:16
that in tis server
this*
17:16 hakobe is now known as hkb_zz
DarkWolf84 Are they changed the server? 17:16
Tene That's always been the official parrot channel, as far as I know. 17:18
DarkWolf84 my mistake then 17:19
17:29 cognominal_ left 17:31 DarkWolf84 left 17:32 weinig joined 17:38 cognominal_ joined 17:42 justatheory joined 17:45 Psyche^ joined 17:48 kanru left 17:49 justatheory left 17:58 TJCRI joined 18:01 Patterner left, Psyche^ is now known as Patterner 18:06 Limbic_Region left 18:07 chris2 joined 18:28 TJCRI left
TimToady moritz_: um, use it in an rvalue context? 18:29
18:32 chris2 left 18:37 rindolf left 18:40 drupek12 left 18:43 IllvilJa left 18:55 meissner joined 19:22 dduncan joined 19:31 bonesss joined 19:33 rindolf joined 19:34 jisom joined
moritz_ TimToady: I mean if I have a sub foo is rw, and then call foo() = $bar; how do I get the value of $bar inside foo(){...} ? 20:04
20:07 wilx left, wilx joined
TimToady you don't exactly; in fact, there's no guarantee that $bar even exists yet at the time foo is called. foo must return an object that has a STORE method of some sort. 20:16
20:17 Jmax left
TimToady see S06:249 20:18
we don't follow the getters/setters model because it confuses the identity function of foo() with the operations it supplies 20:19
you'll note our autogenerated methods don't do getters/setters either, unlike Ruby 20:20
20:20 melissa left, melissa joined
TimToady even within a class, if you say $.foo = 42 you can't be sure whether you're setting $!foo directly or calling an lvalue method 20:23
with getters and setters you always have to keep track of whether you're setting a variable or calling a method, and that is a leaky abstraction. 20:24
20:28 mncharity joined 20:31 Schwern joined
dduncan I prefer names like fetch|store over get|set myself 20:31
that's one thing Perl 5 got right, contrasted with some other languages 20:32
20:32 hkb_zz left
dduncan (thinking of tie interface) 20:33
diakopter eh - what's wrong with pugsbot 20:45
gtg 20:47
dduncan I have an opinion question concerning numeric literals in Perl 6 ...
in synopsis 2, I see examples like :2<...> or :16<...> etc to specify radix 2 and radix 16 20:48
I'm wondering if there is any room for specifying the radix using a number that is of the same radix as what we want to specify, for consistency ... 20:49
this could be done in a literal using a radix specifier that is the highest value that a single column of a number in that radix could be 20:50
Eidolos :10<10> == 2|3|4|5|6|7|... :)
20:50 kane__ left
dduncan so for example, to specify base-2, we say :1<...>, base-10 we have :9<...>, base-16 we have :F<...>, base 35 we have :Z<...> or some such 20:50
that way, the whole thing is in the same base, but it is unambiguous 20:51
rather than the specifier always being base 10
the trade-off is that this only works up to base 36 or so 20:52
assuming just the use of 1..9,A-Z
examples in synopsis 2 would then be :9<42> for 0d42, :F<DEAD_BEEF> for 0xDEADBEEF, 20:54
:1<1.1> for 0b1.1, :7<177777> for 0o177777 20:55
I think doing it that way has a certain level of elegance not present in using base-10 for the radix specifier all the time
what do you think? 20:56
or I'll ask p6l
Eidolos if we do that we may be able to simplify the syntax a little, since there's no need to separate the base from the number 20:57
but in all I think it's a little weird
dduncan sure
in fact we could just say, eg, :F:DEAD_BEEF instead 20:58
or :FDEAD_BEEF
20:58 drupek12 joined
dduncan though keeping the <> retains consistency with other parts of the language 20:59
20:59 stevan joined, melissa left, melissa joined 21:00 melissa left
dduncan TimToady, any thoughts on this ... note that my main suggestion is to use single 1..9A..Z values to specify radix; the other parts of the syntax are orthogonal to my suggestion 21:00
s/values/characters/
as an alteration, if :A-Z might lead to confusion (for some reason) with eg a pair constructor, ... 21:03
perhaps something akin to 0b 0d etc could be used ... 21:04
eg, 0rN
so then, you could say eg 0r11.1 or 0r7177777 or 0rFDEADBEEF ... perhaps with some spacer character added between the N and the payload 21:06
the main point here being that users can then indeed specify numbers with a wide range of radixes using only characters that are actually in the same radix 21:07
regardless, I've decided to adopt such an approach in my Concrete Muldis D language, at least for now ... there eg it would be spelled Int:F:DEADBEEF or Int:9:42 or Int:7:177777 ... or Int:1:10110110 ... so this chat was partly to see if Perl 6 itself might benefit from something similar 21:09
for context, all literals are of format Type:Literal, such as Bool:true or Blob:F:A7017E or Text:'Hello World' 21:11
21:18 stevan left 21:19 ozo joined 21:36 melissa joined 21:39 hkb_zz joined 21:48 elmex left 22:02 avar left 22:03 avar joined 22:09 iblechbot left
dduncan seen bloonix 22:33
buubot dduncan: Seen at Sat Aug 4 07:57:03 2007: <bloonix>
dduncan @tell dduncan this is a test
lambdabot You can tell yourself!
dduncan @tell bloonix please include some commit message for your pugs updates so its easier for people to know what you did from looking at the commit log 22:34
lambdabot Consider it noted.
dduncan @tell bloonix I mean, for future commits, give each one a message 22:35
lambdabot Consider it noted.
22:38 ofer left, ofer joined 22:44 hkb_zz is now known as hakobe, ofer left, ofer joined 22:45 hakobe is now known as hkb_aw 22:49 ofer left 22:51 cognominal__ joined 22:52 cognominal_ left
dduncan in synopsis 5, is <?ws> supposed to match both \s* and \s+ depending what is next to the <?ws> ... if not, I may be seeing a typo 23:04
I'm thinking this example: m/ <?ws> next <?ws> cmd <?ws> = <?ws> <condition>/ 23:05
which it says is effectively m/ \s* next \s+ cmd \s* = \s* <condition>/
23:08 ofer joined
TimToady dduncan: yes, <?ws> can match either of those. 23:40
dduncan okay 23:41
TimToady and I think the proposed radix notation kinda sucks visually
dduncan keep in mind that the only important part was the 1-9A-Z part
the other things can be made to whatever looks good
TimToady we certainly can't use :f
dduncan unless you think '1' for base-2 is what looks bad
TimToady I think having something that looks like part of the number that isn't is precisely what sucks 23:42
dduncan so how might you spell eg :F<DEAD_BEEF> without using a '16' or the '0x' ? 23:43
TimToady I don't have any problem with the 16
dduncan admittedly, I considered it a more minor issue, a "wouldn't it be nice if" thing 23:44
TimToady well, sorry, but I think it *wouldn't* be nice...
dduncan but if you prefer base 10 for the radix specifiers all the time, then so be it
TimToady from a psychological point of view
also, why specify base 16 as f, which is off by one?
dduncan I use the F because that is the highest character you can have in a column 23:45
TimToady yes I know, but it still means 15
dduncan its loosely analagous to zero-based array indexes
TimToady where else in the world do we try to make metadata look like the data it describes? 23:46
dduncan descriptions of english text are written in english 23:47
but I don't mean to belabour the issue
I let this matter drop
anyway, right now I'm trying to figure out how to write my first Perl 6 grammar 23:48
by studying synopsis 5 and Std.pm
TimToady have the appropriate amount of fun :)
dduncan some details confuse me, and may or may not be typos ... for example: rule greet { [Hi|Hey|Yo] $<to>:=(\S+?) , $$} ... do square brackets indicate a list of literal tokens here rather than a character class? 23:49
avar list 23:50
dduncan more importantly, right now I'm trying to figure out where to define tokens vs rules vs regexes
TimToady yes, I'd suggest reading S05 before trying to understand STD
dduncan I am focusing on S05
TimToady square brackets are only for grouping now 23:51
you use <[...]> for character classes, or better, named classes
dduncan eg, in some respects, tokens|rules|regexes seem interchangeable sometimes as to which one uses to define something
TimToady you just use which is more convenient
start with a token, and if you find yourself scattering <?ws> all over, then you probably wanted a rule 23:52
avar tokens and rules are just implicit sugar on regexes
TimToady if you want backtracking, you probably wanted a regex
dduncan okay
avar regex { foo : bar } => token { foo bar } 23:53
TimToady there are really only about two places where STD wants backtracking
avar this is also all in s5 I belive:)
dduncan fyi, its the Concrete Muldis D grammar I'm writing, and it is supposed to be extremely simple ... no backtracking, no escapes that the parser should know about
TimToady well, in that case there's no difference, since foo can't backtrack 23:54
dduncan essentially, I'm trying to recode search.cpan.org/dist/Language-Muldi...rammar.pod , with some simplifications, completions, into a Perl 6 grammar
lambdabot Title: Language::MuldisD::Grammar - The string representation format of Muldis D - sear ..., tinyurl.com/23j49y
dduncan it's currently a pseudo-ebnf
23:56 Entonian left
dduncan back to Perl 6, one thing I didn't seem to see yet in the synopsis is the means to specify Blob literals 23:58
avar token start { <literal> } token literal { <bool> | ... } regex bool { 'Bool::' : [ 'default' | 'false' | 'true' ] }
and so on
look at some of the grammars in parrot 23:59
TimToady literal words don't need to be quoted
dduncan thank you
one thing I already did was eg: token enum_bool { < false true > }