pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, smop: etc.) || We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by TimToady on 25 January 2008.
00:12 felipe left 00:48 elmex left 00:52 felipe joined 01:00 jferrero left 01:25 ujwalic joined 01:29 ujwalic is now known as ujwal, ujwal is now known as ujwalic 01:34 ujwalic left 01:43 ting left, ting joined 01:50 gbarr left 01:53 Limbic_Region left 01:58 hcchien_ is now known as hcchien 02:03 Auzon joined 02:11 Zaba joined 02:24 Zaba_ left 02:56 Zaba_ joined 03:00 drfaustus joined 03:05 agentzh joined 03:09 Zaba left 03:58 Zaba joined 04:07 wknight8111 left 04:10 Zaba_ left 04:29 drfaustus left 04:36 yewenbin joined 04:49 Zaba_ joined 04:57 Psyche^ joined 05:01 DarkWolf84 left 05:02 Zaba left 05:06 ransom joined 05:09 Patterner left, Psyche^ is now known as Patterner 05:30 peepsalot left 05:50 simcop2387 left 06:15 simcop2387 joined, peepsalot joined 06:27 Lorn joined 06:34 Auzon left 06:39 Lorn_ left 06:51 alanhaggai left 07:03 justatheory left 07:12 araujo left 07:34 Lorn left, Lorn joined 07:36 Aankhen`` joined 07:41 iblechbot joined 07:45 IllvilJa left 07:49 elmex joined, ruoso left 07:56 masak joined 07:59 Psyche^ joined 08:11 ransom left 08:15 Patterner left, Psyche^ is now known as Patterner 08:18 masak` joined 08:25 masak left 08:35 Zaba joined 08:43 meppl joined, masak` is now known as masak, IllvilJa joined 08:48 Zaba_ left 09:08 DarkWolf84 joined 09:18 Zaba_ joined 09:22 weirdo joined
weirdo hi 09:23
what is the rationale for the presence of sigils in perl6?
masak weirdo: same as in perl5 I guess 09:24
they form little namespaces in themselves
marking "scalar", "array" and "hash" because these properties are deemed worthy of marking
weirdo i found typing "push @{$foo->{bar}}" particularly tiring. don't such cases overweight the benefit of having syntactic sugar for symbol cells? 09:25
xinming weirdo: In perl 6, an [] auto deferences depending on the context, so, IMO, $foo.bar.push() is enough in perl 6. ;-) 09:28
wolverian $foo<bar>.push 09:29
xinming weirdo: every thing in perl 6 is an object, and for array and hash, they are automatically deferences.
wolverian: ;-) there should be an accessor. :-D 09:30
wolverian hashes are not illegal... even in perl 6 :)
weirdo any progress on macro specification?
wolverian (but hash is!)
xinming weirdo: wolverian is right.
09:30 Zaba left
wolverian weirdo, the spec has some things on macros. 09:31
weirdo can an equivalent of a PROG2 lisp macro be easily defined?
wolverian perlcabal.org/syn/S06.html#Macros
lambdabot Title: S06
xinming weirdo: read the synopsis, and you will see the what language features after 20 years we still use. :-) 09:32
weirdo do i see correctly, the spec defined macros as text to be parsed with regexes? 09:33
wolverian macros may return strings as code or syntax trees. 09:34
weirdo can macros accept syntax trees as argument?
s/arguments
wolverian the spec seems to indicate so. 09:36
I'm very unfamiliar with lisp macros, so I can't really say any better, sorry. 09:37
I suppose I'm equally unfamiliar with perl 6 macros. :)
but, yes, the arguments are ASTs, afaik. 09:38
weirdo IMO perl could win really big with adequate macros 09:39
wolverian well, if you don't think the macros in the spec are adequate enough, please suggest improvements (here or on perl6-language)
if, on the other hand, you think the spec is simply unclear, do the same. :)
weirdo i haven't yet researched the matter, but i don't understand why macros aren't simple nested arrayrefs 09:41
wolverian probably because perl 6's syntax isn't sexprs? 09:42
weirdo the main question is whether non-trivial cases can be expressed as perl macros, but i yet have to get a recent pugs trunk to check them out :-) 09:43
if a DESTRUCTURING-BIND common-lisp macro could be expressed in a not-so-hairy way, they would be really adequate :-) 09:44
wolverian I don't know if pugs has macros at all..
weirdo is there any implementation that does?
wolverian I don't think so
(if pugs doesn't have them)
pugs: macro foo { 'bar' }
exp_evalbot RESULT[\macro :(@_) "$_" := "Scalar" #<Scalar:0xb71c8b04>ā¤ "@_" := "Array" #<Array:0xb71c76fc>ā¤ "&?ROUTINE" := "Sub" #<Sub:0xb6604cec>ā¤ "&?BLOCK" := "Sub" #<Sub:0xb6604cec> {"&foo" := "Sub" #<Sub:0xb7a18830>, "$_" := "Scalar" #<Scalar:0xb7170ce8>ā¤ 09:45
.. ...
wolverian hmm, I guess pugs does have them in some form
rakudo: macro foo { 'bar' }
exp_evalbot OUTPUT[Null PMC access in invoke()ā¤current instr.: '_block10' pc 28 (EVAL_11:14)ā¤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)ā¤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067 (src/PCT/HLLCompiler.pir:587)ā¤called from Sub
..'parrot;PCT::HLLCompiler;command_line' pc 1246 (src/PCT/HLLCompiler.pir:676)...
wolverian rakudo doesn't :)
I have no idea what destructuring-bind does, even after reading the lisp spec :) 09:47
weirdo destructuring-bind binds variables to contents of an expression returning a list
perl5 only allows shallow destructuring, i.e. my ($foo, $bar, @baz) = (1 .. 42) 09:48
d-bind allows recursive destructuring, i.e. (destructuring-bind (foo (bar baz &key test on-error)) ...) 09:49
wolverian I think you can do arbitrary destructuring (extraction / pattern matching in haskell parlance) in any signature context 09:50
see e.g. perlcabal.org/syn/S06.html#Unpackin...parameters and the sections following it in subroutine argument context
lambdabot Title: S06
weirdo i'm not interested in destructuring in particular :) i've only arbitrarily appointed destructuring as a test of a macro facility's capabilities 09:51
wolverian ah. 09:52
well, I don't see why not, as long as your argument grammar specification is loose enough..
weirdo well, that's the problem with algol-ish syntax :/ 09:53
wolverian the grammar is available to the user, so perhaps it's not a problem. 09:54
09:59 wknight8111 joined 10:07 yewenbin left 10:33 DarkWolf84 left 10:35 yewenbin joined 10:38 Aankhen`` left 10:46 Aankhen`` joined, Zaba_ left 10:54 Zaba joined 10:56 ruoso joined 11:16 xinming_ joined 11:24 meppl left, wknight8111 left 11:28 xinming left 11:55 stevan_ left, wknight8111 joined 11:57 iblechbot left 12:06 sscaffidi_ left, sscaffidi_ joined 12:09 r0bby left 12:20 Zaba_ joined 12:22 stevan_ joined 12:26 stevan_ left, stevan_ joined
BinGOs a/win 33 12:26
bugger
12:33 wknight8111 left 12:34 Zaba left
cognominal_ screen misshap? 12:36
12:41 iblechbot joined 12:45 Zaba_ is now known as Zaba 13:16 Zaba_ joined 13:24 cmarcelo joined, pmurias joined 13:28 Zaba left
pmurias weirdo: the macros should be powerfull enough to compile passed code and load it through NCI 13:28
allowing a lispish destructuring bind 13:30
say "this is perl"; (destructuring-bind ((a &optional (b 'bee)) one two three)
`((alpha) ,@(iota 3))
;say "this is still perl" 13:31
should be possible also
weirdo don't mind the parens :) 13:41
i mean, it doesn't actually have lisp syntax
13:42 yves joined
weirdo something along the lines of destructuring-bind ($a, $b, ($c, $d, @f)) { ... } perfectly demonstrates expressibility of a macro facility :) 13:43
13:48 peepsalot left 13:49 peepsalot joined 13:56 penk joined 14:01 TJCRI joined 14:08 rdice joined 14:11 Zaba_ is now known as Zaba 14:16 chris2 joined 14:23 xinming_ left 14:28 kcwu left 14:32 kcwu joined 14:34 alanhaggai joined, yewenbin left 14:37 Auzon joined 14:44 DarkWolf84 joined 14:49 yewenbin joined 14:51 yewenbin left, yewenbin joined 14:52 rindolf joined, peepsalot left
pmurias weirdo: macros don't modifify the way stuff is parsed by default, unless you use 'is parsed' which lets you embed anything you wish 15:02
15:02 yewenbin` joined 15:04 masak left 15:13 yewenbin left 15:17 Auzon left 15:26 rindolf left 15:37 pmurias left 15:54 neenaoffline joined 15:55 Lorn left 16:27 mofino left 17:15 yewenbin` left 17:16 Auzon joined 17:23 justatheory joined 17:38 rindolf joined 17:46 aindilis left 17:48 aindilis joined 17:49 syle left 17:50 Lorn joined, smtms left 17:59 smtms joined 18:05 Lorn_ joined 18:17 Lorn left, Southen_ joined, meppl joined 18:18 chris2 left 18:21 Southen left 18:32 Lorn_ left 18:33 Lorn joined 18:36 mofino joined 18:45 Lorn_ joined 18:50 mofino left 18:58 Lorn left 19:02 Auzon left 19:04 meppl left 19:07 meppl joined 19:16 Auzon joined 19:21 mofino joined 19:24 araujo joined 19:29 rindolf left 19:42 Zaba_ joined 19:47 ruoso left 19:50 r0bby joined 19:54 Zaba left 20:00 Auzon left 20:08 Zaba joined 20:20 Zaba_ left 20:25 meppl left 20:36 wknight8111 joined 20:51 justatheory left, justatheory joined 20:55 Aankhen`` left 21:03 neenaoffline left 21:34 mj41_ joined 21:36 TJCRI left 21:42 iblechbot left, mj41 left 21:53 rdice left 22:26 [particle] left 22:28 renormalist joined 22:30 Juerd left 22:35 [particle] joined 22:37 jiing joined 22:43 meppl joined, Limbic_Region joined 22:47 ruoso joined 22:57 FurnaceBoy joined 23:00 renormalist left 23:02 [particle] left 23:03 [particle] joined 23:07 ruoso left 23:38 FurnaceBoy left 23:45 cmarcelo left 23:51 Auzon joined 23:52 Auzon left 23:57 DarkWolf84 left