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.
spinclad ?eval my $str = "abracadabra"; if $str ~~ m:exhaustive/ a (.*) a / { say "{@()}"; } 00:08
evalbot_10587 Error: unexpected "(" expecting "::"
spinclad ?eval my $str = "abracadabra"; if $str ~~ m:exhaustive/ a (.*) a / { @(); } 00:09
evalbot_10587 Error: unexpected "(" expecting "::" 00:10
spinclad ?eval my $str = "abracadabra"; if $str ~~ m:exhaustive/ a (.*) a / { @$/; } 00:18
evalbot_10587 [Match.new( ok => Bool::True, from => 1, to => 10, str => "bracadabr", sub_pos => (), sub_named => {} ),]
spinclad no @(...) yet, i guess 00:21
nor :exhaustive
spinclad ?eval my $str = "abracadabra"; if $str ~~ m:exhaustive/ a (.*) a / { say "@$/"; } 00:22
evalbot_10587 OUTPUT[@abracadabra ] Bool::True
spinclad nor @ interpolation 00:23
?eval my $str = "abracadabra"; if $str ~~ m:exhaustive/ a (.*) a / { say "{@$/}"; } 00:24
evalbot_10587 OUTPUT[bracadabr ] Bool::True
spinclad ?eval my $str = "abracadabra"; if $str ~~ m:exhaustive/ a (.*) a / { say "{**@$/}"; }
evalbot_10587 OUTPUT[bracadabr ] Bool::True
QtPlatypus ?eval my $str = "abracadabra"; if $str ~~ m:exhaustive/ a (.*) a / { say join " ",@$/} 01:25
evalbot_10587 OUTPUT[bracadabr ] Bool::True
svnbot6 r10588 | fglock++ | Pugs-Compiler-Precedence - added 'fixity' info to the ast; fixed ast templates; fixed t/*; more TODO items
r10589 | spinclad++ | - JudyHS: another test program: test/HashSortAsitwere.c 01:31
ludan ciao 07:09
tifo q 07:53
quit
Juerd Do we have infix:<~~=>? 11:15
i.e. for untainting
$foo ~~= /(...)/;
Limbic_Region is there going to be a nice safe way to refer to a very::long::module::name with a short and descriptive lexical alias or similar? 15:15
cognominal_ ::= or something similar allows to make an alias 15:20
particle_ := is runtime, ::= is compiletime, iirc 15:21
Limbic_Region and that works with namespaces in general or just to things inside that namespace
?
particle_ well, :: is a sigil 15:23
so i *imagine* '::foo := very::long::module::name' might work
Limbic_Region okie dokie - p6 question in the PerlMonks CB that I didn't have knowledge to answer 15:24
Limbic_Region salutations b_jonas 15:32
szbalint fellow hungarian. :)
b_jonas hello 15:33
right, I'll ask a question I've just asked on perlmonks 15:34
szbalint oh you're that ambrus. Cool. :)
b_jonas I'd like to know if there'll be a standard way of using a module and giving it a lexical alias name
so that you can refer to it with a shorter handle 15:35
Limbic_Region from about 13 minutes ago
[11:23] <particle_> so i *imagine* '::foo := very::long::module::name' might work
b_jonas I'd like if that became a standard thing to do (that is, supported by the docs and community and possibly a simple syntax) 15:38
so that we can have descriptive module names but use such modules easily
particle_ i'm sure it'll be idiomatic perl 6 15:40
Limbic_Region which S covers namespaces anyway?
b_jonas S10 to S12
particle_ yep 15:41
S02 covers sigils, that's where i started looking
however, it's unclear from S02 what the syntax would be
b_jonas I looked at S11 first but didn't see anything like 'Foo := use Bar::Foo;' or 'use Bar::Foo as Foo;'
this of course wouldn't be a problem in a language which only has one kind of variable AND that includes packages too, 15:43
but the only such language I know is lua
b_jonas and there you can indeed assign packages. 15:43
only, packages are mostly just tables
particle_ you might enjoy playing with lua on parrot 15:44
b_jonas in c++, you can alias a namespace by creating a new one and importing the first namespace in it; and alias a class by typedef or inheriting; 15:48
but in perl these operations aren't transparent
b_jonas looks at cltl to see how common lisp packages work 15:50
anyway, there's a strange way I imagine this could be done: 15:51
in this, the module file would contain like 'module { ... }' or 'class { ... }' 15:52
the use statement would return an anon/package which you had to assign to a (lexical) name
like 'Foo := use Foo'
or better 'Foo ::= use Foo' 15:53
and for convenience a use in void context would be equivalent to this with a sensible default name
naturally, it would still run the file once only, and would just return the same module if use is called again 15:54
this idea however disregards imports
particle_ well, i hope the syntax exists (and i think it does) 16:01
but i can't find the magic incantation
b_jonas I hope too
particle_ i can't find tests for it in the pugs repo, either 16:03
Limbic_Region if b_jonas doesn't have a comitt bit I could certainly hand one out 16:07
that way there would be no excuse for not sending a msg to the list confirming speculation and submitting a test case too
b_jonas uh 16:08
Limbic_Region so what's your email again?
szbalint oh yeah 16:09
:)
b_jonas I don't need a commit bit just to write a test 16:10
but anyway, my email is (msg)
Limbic_Region there - commit bit sent 16:13
b_jonas oh no, but I didn't want...
Limbic_Region too late 16:14
we all expect a test case to be comitted now
particle_ expects the AUTHORS file to be modified soon 16:15
b_jonas I don't even have perl6 installed or anything. I don't know what exact syntax I should use and all that. 16:16
szbalint The commit bit is free here and its handed out liberally. :)
particle_ i had mine for almost a year before i used it
Limbic_Region b_jonas - there are plenty of examples svn.perl.org/perl6/pugs/trunk/examples/ 16:17
b_jonas I mean what syntax for assigning a module 16:18
Limbic_Region there are also plenty of tests svn.perl.org/perl6/pugs/trunk/t/
b_jonas - perhaps you missed the part where I said send a message to the list confirming speculation (and then commit a test)
make something up that seems reasonable - send it to the list - let @larry chew on it and spit something back out - commit the masticated cud 16:19
particle_ you make it sound so romantic :) 16:21
Limbic_Region really is trying to hoodwink b_jonas into joining the funny farm 16:22
Limbic_Region is not a smart man....but he recognizes smart people 16:23
fglock Limbic_Region: were you looking for a precedence parser?
Limbic_Region fglock - it would be way OT for me to describe what I am really doing here 16:24
fglock - but in short, I am looking for general purpose parsers - so yes
Limbic_Region found Parse::Yapp to be amazingly better than Parse::RecDescent despite not having nearly the documentation and having to write your own lexer 16:25
fglock I'm working on misc/pX/Common/Pugs-Compiler-Precedence - it wraps Parse::Yapp into something more usable by the p6 compiler 16:26
I'm planning to integrate it into the PCR distro - it will return a Match object
and accept rules as the lexer 16:27
Limbic_Region ok - so this will all be useable for us mortals still in p5 land? 16:27
fglock sure
Limbic_Region well - any ETA on usability? 16:28
I have finished rolling my own, a half dozen P::RD implementations, a Parse::Yapp implementation, and moving on to HOP::Parser next and have about 4 others beyond that to try
I am going on vacation for the next week and a half so there will likely be about a month or more before I am ready to publish a series of meditations 16:29
fglock it is already in use by Pugs-Grammar-Perl6 - but PGP6 is currently broken, possibly because of the token/regex/rule implementation in PCR - I plan to fix it later on
Limbic_Region I would absolutely love to be able to include a "and here is what p6 has to say on the matter that you can use today in p5"
ok - will touch base with you when I am closer to finishing up with the other parsers I know about to date 16:30
fglock I plan to change PC-Precedence API to make it interact with rules more easily 16:31
fglock you can try Pugs::Compiler::Token if you don't need backtracking - it's the fastest parser I could implement so far 16:33
there is a benchmark in misc/pX/Common/Pugs-Compiler-Rule/benchmark.pl - it would be nice to have P::RD in that benchmark 16:35
Limbic_Region fglock - I don't <i>need</i> anything - this is an experiment in breaking the rules
fglock breaking the rules, tokens, and regexes 16:36
Limbic_Region more specifically - in what lessons one learns (both good and bad) by breaking the rules
fglock oh, that's what misc/pX/ is about 16:37
Limbic_Region well, so far I have learned quite a bit 16:38
I was expecting most of the lessons to reinforce the rule(s) but so far, that hasn't been the case
fglock I look forward for reading your meditations 16:39
Limbic_Region oh, btw, it's getting contagious - see perlmonks.org/index.pl?node_id=554516 # bart posted his own operator precedence parser
fglock I'm going to class - back in 2hr & 16:44
Kattana TimToady: ping 18:16
cmarcelo audreyt && spinclad: i'm going to be (almost-)off next few days (probably until wednesday 14th) because of school works and tests. next small steps: cabal, test hsiter, changing Pugs.Prim to use BitSet... audreyt, I'll try my chances (and NOT commiting) with Pugs.Prim =) 21:00