Re: On Sets (Was: Re: On Junctions)

2009-03-28 Thread Daniel Ruoso
Em Sáb, 2009-03-28 às 13:36 +0300, Richard Hainsworth escreveu: > Daniel Ruoso wrote: > > The thing is that junctions are so cool that people like to use it for > > more things than it's really usefull (overseeing that junctions are too > > much powerfull for that use

Re: On Junctions

2009-03-30 Thread Daniel Ruoso
nothing" in Perl6, but I'll > guess that undef can serve the purpose, since I can't think of a > useful use of undef as part of a Junction. Well, you return nothing simply by calling "return;" it will produce an empty capture, which could be seen simply as (). daniel

Re: S08 Draft questions (Captures and Signatures)

2009-04-01 Thread Daniel Ruoso
meters normally provided by the default signature (i.e., > *...@_ and *%_)? I'm guessing not. Yes, it does. The default signature is the *default*. Having placeholder parameters imply defining a signature, one could argue that *...@_ and *%_ are still part of that generated signature, but @_ certainly won't contain the values that were in the placeholder parameters. daniel

Re: S08 Draft questions (Captures and Signatures)

2009-04-01 Thread Daniel Ruoso
Em Qua, 2009-04-01 às 05:41 -0700, Jon Lang escreveu: > On Wed, Apr 1, 2009 at 5:07 AM, Daniel Ruoso wrote: > > The concept of "invocant" only exists in terms of syntax now. In runtime > > the invocant is simply the first positional argument. This simplifies > >

Re: FYI - modern Muldis D code examples

2009-04-09 Thread Daniel Ruoso
lve? I mean, what is so bad about SQL? and how does Muldis D solves it? Honestly, it feels weird to me that you propose a query as simple as SELECT 1 turning itself into a function declaration, with a lot of boilerplate around... daniel

Re: Call for review: traits, lift

2009-05-05 Thread Daniel Ruoso
#x27;t easily distinguish, In fact, i really think there isn't a sane way of distinguishing... lifting really means looking up from the perspective of the caller, so you see what the caller sees, so no need for $a and $b to be context... daniel

Re: Meditations on a Loop

2009-05-21 Thread Daniel Ruoso
[.prime] works is because the method-call > syntax will call an ordinary non-member sub also." > I think this is no longer the case (and hasn't been for some time). It is no longer the case. I was about to send a mail about this... so I'll just make sure that is noticed ;) daniel

Re: Meditations on a Loop

2009-05-21 Thread Daniel Ruoso
is fantastic... it's really awesome how you got into the guts of Perl 6 while still preserving brevity and clarity... daniel

Re: Meditations on a Loop

2009-05-21 Thread Daniel Ruoso
Em Qui, 2009-05-21 às 21:33 -0300, Daniel Ruoso escreveu: > my @x = map { $_ * 2 for 1,2,3 }, 1,2,3; > say @x[0]; # 1; > say @x[0;0]; # ERROR > say @x[1]; # 1; > say @x[1;0]; # ERROR er... there should be a 2 as output of the fourth line there... daniel

Re: Meditations on a Loop

2009-05-22 Thread Daniel Ruoso
ide, "$_ when prime($_)" looks more natural than "do $_ if prime($_)" daniel

Re: Meditations on a Loop

2009-05-22 Thread Daniel Ruoso
is mine), That's because dot is an operator as well and might be subject to be overriden... but don't tell anyone that... daniel

Re: Meditations on a Loop

2009-05-22 Thread Daniel Ruoso
Em Sex, 2009-05-22 às 18:27 -0500, John M. Dlugosz escreveu: > Daniel Ruoso wrote: > > That's because dot is an operator as well and might be subject to be > > overriden... but don't tell anyone that... > You mean by installing a different dispatcher for the object? By

Re: Question for Larry

2009-05-25 Thread Daniel Ruoso
) > @A is BOUND TO a list container of type Array. > my $y := @A; > $y is BOUND TO the Array, same as @A is. Again, binding to a variable is an operation in the lexpad, much the same way as: %a := 1; is an operation in the hash itself, not in that specific cell of the hash. daniel

Idea: Literate programing

2009-05-25 Thread Daniel Carrera
Hello, I really like POD and I like the changes in the upcoming Perl 6 Pod. Have you ever heard of literate programing? (see Wikipedia). I think it would be neat if Pod could do literate programing. It is already very close. For reference, please see this article: For reference, please see

Re: Idea: Literate programing

2009-05-25 Thread Daniel Carrera
at it is perfectly reasonable to make this a separate module. How would it work? Daniel.

Unexpected behaviour with @foo.elems

2009-05-26 Thread Daniel Carrera
er it makes sense to alter the language because of this. You are the language experts. I just wanted to raise a likely point of confusion among users. Cheers, Daniel.

Re: Unexpected behaviour with @foo.elems

2009-05-27 Thread Daniel Carrera
othing. I simply raised a point of confusion and I can prove that it is a point of confusion because someone who does know about Perl 6 got confused. But what to do about it is something I leave to the experts. Daniel.

Re: Unexpected behaviour with @foo.elems

2009-05-27 Thread Daniel Carrera
ms" doesn't appear in the documentation. Instead, whoever writes the docs should use @foo.keys and @foo.kv. Those are *very* clear, and they do the right thing. Daniel.

Submission for Perl 6 examples

2009-05-27 Thread Daniel Carrera
regex-dna benchmarks. You use regexes to analyze DNA code. Currently Rakudo is very slow at it, but that's not surprising at this stage. http://daniel.carrera.bz/_2009/perl/shootout-perl6-2009.05.27.tgz Cheers, Daniel.

Re: Submission for Perl 6 examples

2009-05-27 Thread Daniel Carrera
Daniel Carrera wrote: http://daniel.carrera.bz/_2009/perl/shootout-perl6-2009.05.27.tgz To run the benchmark: perl6 regex-dna.p6.pl < regex-dna.input On my computer it takes about 99s to run on Rakudo, compared to 0.18s for Perl 5 (the Perl 5 benchmark is included in the .tgz f

RFC: Implicit threading and Implicit event-loop (Was: Re: Continuations)

2009-05-27 Thread Daniel Ruoso
g" state. And a scheduler that takes this continuations and assign to the "worker threads", while you can use a command line switch to control the minimum/maximum number of worker threads as well as the parameter for when to start a new worker thread and when to deactivate it... Well, this is my current view on the state of affairs, and is thougth a lot in the context of SMOP, so it would be really interesting to have some feedback from the parrot folks... daniel

Amazing Perl 6

2009-05-27 Thread Daniel Ruoso
Perl 6 code snippets, we all know there are several, and I really would like to give people some idea of why Perl 6 is so cool. I started a page in the Perl 6 wiki for that: http://www.perlfoundation.org/perl6/index.cgi?amazing_perl_6 daniel

Re: Amazing Perl 6

2009-05-27 Thread Daniel Carrera
Hi Daniel, Sounds very interesting. Can you post slides? It'd be cool if the talk was taped, like the Google tech talks. Will it be in English? I don't speak Portuguese (I do speak Spanish and some German). I'm planning to do a presentation to highlight the most impressive as

Re: Amazing Perl 6

2009-05-27 Thread Daniel Ruoso
Em Qua, 2009-05-27 às 18:46 +0200, Daniel Carrera escreveu: > Hi Daniel, Hi Daniel, :P > Sounds very interesting. Can you post slides? It'd be cool if the talk > was taped, like the Google tech talks. Will it be in English? I don't > speak Portuguese (I do speak Spanish

Re: Amazing Perl 6

2009-05-27 Thread Daniel Carrera
Daniel Ruoso wrote: I know this is not the approach you had in mind, but what do you think? Well, you really made me realize that I'm looking for things that make me impressed, and probably I don't get impressed that easy nowadays ;) I understand. Your experience with Perl 6 makes

Re: Amazing Perl 6

2009-05-27 Thread Daniel Carrera
postfix: myself, but the rest is obscure to me. I do think captures are inherently impressive, but not easy to explain... Got a link? Daniel.

Re: Amazing Perl 6

2009-05-27 Thread Daniel Carrera
Daniel Carrera wrote: sub postfix: { [*] 1..$^n } say 5!; WOW!! That *IS* cool. Can you explain to me how it works? I figured out postfix: myself, but the rest is obscure to me. Here is another idea: Is it possible to declare a circumfix function that calculates the magnitude of a vector

Re: Amazing Perl 6

2009-05-27 Thread Daniel Carrera
, [*] generates their product, etc. Wow... That's a foldl! In a functional language, that would be called a fold. It's very popular in Haskell. I like that Perl 6 seems to be taking steps in the direction of functional languages. First lazy lists (0..Inf) and now a fold. :-D Daniel.

Re: Amazing Perl 6

2009-05-27 Thread Daniel Carrera
m is not just from Haskell. I've seen it elsewhere. If you had said "inject" I wouldn't have known what you meant. Daniel.

Re: Amazing Perl 6

2009-05-27 Thread Daniel Carrera
t. Haskell does that too, but I don't know if you can make the function a postfix in Haskell. Daniel.

Re: How to write this "properly" in Perl 6?

2009-05-27 Thread Daniel Ruoso
d be prettier if it was lazy... for 2..* -> $n { (, "bon" xx $n, "digi" xx $n).join(", ") } ==> $*OUT; Or put that into an array for more controlled fun... my @a <== map { (, "bon" xx $n, "digi" xx $n).join(", ") }, 2..*; say @a[5]; But that still doesn't run in rakudo, since it doesn't support lazyness yet... daniel

Re: Amazing Perl 6

2009-05-27 Thread Daniel Carrera
Larry Wall wrote: $dot_product = <@vector1,@vector2>; Is that possible? That would be uber-cool. More likely just use sub infix:<·> (@a,@b) { ... } $dot_product = @vector1 · @vector2; Thanks. And for Daniel R. and other observers, how about this: # Courtesy of Lar

Re: Amazing Perl 6

2009-05-28 Thread Daniel Carrera
how the same thing written in Java. >;-) It might be appropriate to compare some examples with Ruby or Python. Daniel.

Re: Illustration of stuff we've been discussing

2009-05-28 Thread Daniel Ruoso
1" is a readonly value, not a container, so you can't store into it. Of course this is the theoretical model, and implementations should optimize whenever they can... daniel

Re: Amazing Perl 6

2009-05-28 Thread Daniel Ruoso
2, 3 isn't a prefix, but a [ ] meta with + inside and the list as argument... daniel

New CPAN

2009-05-28 Thread Daniel Carrera
new CPAN format. 5. We can port Software::Package to Perl 6 and package them as a way to test the new CPAN format with Perl 6. ... What do you think? Daniel.

RFC: How does using CPAN with Perl 6 would look like (Was: Re: New CPAN)

2009-05-28 Thread Daniel Ruoso
Em Qui, 2009-05-28 às 16:18 +0200, Daniel Carrera escreveu: > Hello all, > There was some talk on IRC about a new version of CPAN to match the new > version of Perl. I just wanted to point out some previous conclusion on this issue. What currently we generically name "CPAN" i

Re: Illustration of stuff we've been discussing

2009-05-28 Thread Daniel Ruoso
Em Qui, 2009-05-28 às 09:27 -0500, John M. Dlugosz escreveu: > Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: > > Em Qui, 2009-05-28 às 00:24 -0500, John M. Dlugosz escreveu: > >> Please see <http://www.dlugosz.com/Perl6/web/info-model-1.html> > >> and talk to

Re: New CPAN

2009-05-28 Thread Daniel Carrera
F) In summary, we have a possible course of action: There is a lot more structurally problematic. Please read one of my papers on the cpan6.org website. I have scanned through the first one. It's 30 pages... Daniel.

Re: New CPAN

2009-05-28 Thread Daniel Carrera
Jonathan Scott Duff wrote: See http://perlcabal.org/syn/S11.html#Versioning Yeah, I reached that part earlier today (but after I sent my email). Thanks. Daniel.

Re: New CPAN

2009-05-28 Thread Daniel Carrera
wrote that I hadn't yet read S11. The new CPAN needs to handle all the metadata in S11. use Whiteness:from; So we have to give some thought to how the modules are going to be stored in the system. Daniel. -- This message has been scanned for viruses and dangerous content by Mail

Re: [RFC] CPAN6 requirements analysis

2009-05-28 Thread Daniel Carrera
ing I agree with. It seems smart to be able to download the metadata before downloading the source tree. This allows dependency resolution, searches, etc. Daniel.

Re: [RFC] CPAN6 requirements analysis

2009-05-28 Thread Daniel Carrera
front reliably, that's probably sufficient. Yes. Daniel.

Re: [RFC] CPAN6 requirements analysis

2009-05-29 Thread Daniel Carrera
Alex Elsayed wrote: On Thursday 28 May 2009 4:54:50 pm Daniel Carrera wrote: On the other hand, distributing Parrot bytecode (or PIR, or PASM) seems fine. But I don't know what to suggest for modules that require a C compiler. The problem with that is that Rakudo isn't the

Re: [RFC] CPAN6 requirements analysis

2009-05-29 Thread Daniel Carrera
we may have trouble scaling that to cover all the stuff that S11 says. I'm not saying it can't be done. I'm saying it might be difficult, as we'd be using RPM and DEB in a way that they were not intended. Daniel.

Re: New CPAN

2009-05-29 Thread Daniel Carrera
is a one-way communication medium, so it is less likely to build consensus (unless the paper itself was written through a consensus process). Daniel.

Re: New CPAN

2009-05-29 Thread Daniel Carrera
Mark Overmeer wrote: * Daniel Carrera (daniel.carr...@theingots.org) [090529 08:17]: Workshops, Hackathons and YAPCs are more suitable. But those venues are not available on a day-to-day basis. At least, you get the time to discuss it in depth. Some even basic meta- data issues are just too

Re: New CPAN

2009-05-29 Thread Daniel Carrera
). CPAN, because it has a large enough organisation behind it, has a number of people behind it empowered with keeping it going. People don't want to have to keep up with the fashionable repos. +1 Daniel.

Re: New CPAN

2009-05-29 Thread Daniel Carrera
Nicholas Clark wrote: On Fri, May 29, 2009 at 02:43:13PM +0200, Mark Overmeer wrote: * Daniel Carrera (daniel.carr...@theingots.org) [090529 11:42]: "CPAN shall not piggyback another language" -- from ZCAN. Judging from the ZCAN page, I don't expect that uploading Ruby modules

Re: New CPAN

2009-05-29 Thread Daniel Carrera
P and Perl5. Perl 6 is the next version of Perl 5 and Perl 6 comes with a Perl 5 compatibility mode and Perl 6 is intended to be able to use Perl 5 modules. That makes Perl 5 different from PHP. Daniel.

Re: [RFC] CPAN6 requirements analysis

2009-05-29 Thread Daniel Ruoso
Em Sex, 2009-05-29 às 01:54 +0200, Daniel Carrera escreveu: > Larry Wall wrote: > > I support the notion of distributing binaries because nobody's gonna > > want to chew up their phone's battery doing unnecessary compiles. The > > ecology of computing devices is dif

Re: New CPAN

2009-05-29 Thread Daniel Carrera
or something else that doesn't mean anything. "Comprehensive Peacock Archive Network"? "Comprehensive Platypus Archive Network"? Daniel.

Re: New CPAN

2009-05-29 Thread Daniel Carrera
Daniel Carrera wrote: Btw, if the majority wants to start uploading Ruby, Python and Lua modules to CPAN, we can rename CPAN so that the P stands for something else that doesn't mean anything. "Comprehensive Peacock Archive Network"? "Comprehensive Platypus Archive Network&

Re: New CPAN

2009-05-29 Thread Daniel Carrera
John Macdonald wrote: On Fri, May 29, 2009 at 07:26:11PM +0200, Daniel Carrera wrote: Btw, if the majority wants to start uploading Ruby, Python and Lua modules to CPAN, we can rename CPAN so that the P stands for something else that doesn't mean anything. "Comprehensive Peaco

Re: New CPAN

2009-05-29 Thread Daniel Carrera
n it. In other words, the Perl guys will only maintain the Perl platforms. But the Lua guys are welcome to get people together and administer a Lua platform on CPAN. Just some ideas... Daniel.

Commentary on S22 (CPAN [DRAFT])

2009-05-29 Thread Daniel Carrera
fo 4) Lastly, while we are at it, why don't we add a signature file to the _par directory? _par/ META.info CHECKSUMS.asc The CHECKSUMS.asc file would contain the SHA1 sums of every file in the archive except for itself. The file could be GPG-signed with --armor (.asc extension). What do you think? Daniel.

Re: Commentary on S22 (CPAN [DRAFT])

2009-05-29 Thread Daniel Carrera
Daniel Carrera wrote: 4) Lastly, while we are at it, why don't we add a signature file to the _par directory? _par/ META.info CHECKSUMS.asc The CHECKSUMS.asc file would contain the SHA1 sums of every file in the archive except for itself. The file could be GPG-signed

Re: New CPAN

2009-05-29 Thread Daniel Carrera
ecause in a new Parrot world, there is real opportunity for Perl and Ruby to share libraries with each other (e.g. Perl on Rails). But when you start talking about sharing holiday pictures, you have completely left the Perl realm and I am completely turned off. Daniel.

Re: New CPAN

2009-05-29 Thread Daniel Carrera
5 words are the main point of his email (words are not created equal :) ). Daniel.

Re: Commentary on S22 (CPAN [DRAFT])

2009-05-30 Thread Daniel Carrera
the name everyone else already uses? Daniel.

Is the Perl community just about Code? (Was: Re: New CPAN)

2009-05-30 Thread Daniel Ruoso
Em Sex, 2009-05-29 às 23:37 +0200, Daniel Carrera escreveu: > Your idea of using CPAN to share holiday pictures is one of the things > that really turned me off from your CPAN6 proposal. If you replace "holiday pictures" by 'YAPC pictures', 'Talk slides&#

CPAN -- moving forward

2009-05-30 Thread Daniel Carrera
ally port Perl 5 modules (e.g. Software::Packager) and rewrite the script to remove dependency on shell commands. Think of it as a boot-strapping method. What do you think? Daniel.

Re: CPAN -- moving forward

2009-05-30 Thread Daniel Carrera
an initial step. I don't believe in working in isolation for days or weeks and then handing down a massive ready-made solution to the masses. I offer a small, incremental step on top of Synopsis 22 and hope that it is useful. Daniel.

Re: CPAN -- moving forward

2009-05-30 Thread Daniel Ruoso
Em Sáb, 2009-05-30 às 22:54 +0200, Daniel Carrera escreveu: > In the hopes of helping the CPAN discussion move forward, in the > direction of tangible work, I have made a wiki page with a proposal: > Please read the "Basics" section, which is quite short. The main point >

Re: CPAN -- moving forward

2009-05-30 Thread Daniel Carrera
Daniel Ruoso wrote: The leap you make from the source package to the different binary formats is overlooking a lot of details. It would be interesting if you could take a look in the previous discussions on the matter. I'll be happy to. I was just trying to make a small iterative st

Re: The game of life

2009-05-31 Thread Daniel Ruoso
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ] ])); my @g = $game.generation(4); say .perl for @g; I guess my mindset is too much "imperative" for me to think in a more elegant solution... daniel

Re: CPAN -- moving forward

2009-06-01 Thread Daniel Carrera
one can begin talking about a package format and an installer, and then go from there. So far the discussion has been productive and we have some code written that we can experiment with. So I feel encouraged. Daniel.

Module naming conventions

2009-06-01 Thread Daniel Carrera
Digest::SHA.Parrot Digest::SHA~C Digest::SHA~Parrot What do you think? If anyone can think of a symbol that is already used in Perl with a similar meaning, please let me know. Daniel.

Re: Module naming conventions

2009-06-01 Thread Daniel Carrera
Jon Lang wrote: On Mon, Jun 1, 2009 at 5:44 PM, Daniel Carrera wrote: I think we might need to come up with some sort of standard naming convention to distinguish dependencies. Something that the *user* can recognize quickly when he browses CPAN. Why do we need the dependencies to be part of

Re: Module naming conventions

2009-06-02 Thread Daniel Carrera
igest::SHA modules I want to use for this particular program. Suppose I want to install three versions of SHA. One in C, one in Perl, one in Parrot. I need a way to specify in the "use" statement which one I want. Daniel.

Re: Module naming conventions

2009-06-02 Thread Daniel Carrera
ntics was a non-starter. Daniel.

Re: Module naming conventions

2009-06-02 Thread Daniel Carrera
. Daniel.

Re: Module naming conventions

2009-06-02 Thread Daniel Carrera
;t seem to run into "tenserity" problems on IRC, and I seem to be much more productive there. I don't know why there is a difference (different people? different topics? different medium?). But whatever the reason, I think that I'll stay mostly on IRC, at least for now. Daniel.

Re: Module naming conventions

2009-06-03 Thread Daniel Carrera
valid reasons why he might choose one option or another. A SMOP user might install a module that uses C bindings, or one that is all Perl. There are valid reasons why he might want one or the other. Daniel.

Re: Module naming conventions

2009-06-03 Thread Daniel Carrera
pect one would/could do: > > use SHA:from; > > (See the :from adverb in S11.) That looks great. I didn't think of that. Perhaps it can be used for C as well. We might have to abuse the :from a little to include the name of the C bindings (if there is more than one option). Daniel.

Re: rakudo-current loop 2-3 orders of magnitude slower than perl 5?

2009-06-03 Thread Daniel Carrera
an language shootout to Perl 6. I figure this is a good place to start because each benchmark is designed to test one specific aspect of the language. I've only done a couple of benchmarks. If you are interested, why don't you help me? Porting benchmarks is a good way to learn Perl 6. Cheers, Daniel.

Re: rakudo-current loop 2-3 orders of magnitude slower than perl 5?

2009-06-04 Thread Daniel Carrera
the benchmarks are well designed, your page will be not only nice but also useful. Daniel.

Implicit threading vs Imperative barriers

2009-06-04 Thread Daniel Ruoso
magic is *not* in the feed operator. The feed operator is simply a capture constructor that fits well with slurpies. So the questions are: * Are there any imperative barriers in Perl 6? * Does that mean we need to spec a common way of implementing implicit-threading and implicit event-based programming? daniel [1] http://www.nntp.perl.org/group/perl.perl6.language/2009/05/msg31682.html

Re: rakudo-current loop 2-3 orders of magnitude slower than perl 5?

2009-06-04 Thread Daniel Carrera
king on the reverse-complement benchmark. Cheers, Daniel.

Re: rakudo-current loop 2-3 orders of magnitude slower than perl 5? (Benchmarking Tool?)

2009-06-04 Thread Daniel Carrera
ctors. I am interested in a tool that can benchmark both perl 5 and perl 6 natively. If you write such a tool, I'd like to try it. Daniel.

Re: rakudo-current loop 2-3 orders of magnitude slower than perl 5? (Benchmarking Tool?)

2009-06-04 Thread Daniel Carrera
things to even out. I look forward to seeing your code. Daniel.

Re: the file slurping is not working

2009-06-05 Thread Daniel Carrera
Carl Mäsak wrote: Aruna (>): I tested the below code on parrot-1.1.0 and it read all the lines in the file and tested same code on the latest git update (4th June 2009), it outputs only the first line. That's what C<$file.get> does -- it gives you one line per default. You want C<$file.lines>.

Re: the file slurping is not working

2009-06-05 Thread Daniel Carrera
ank line!! Daniel.

RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
seful. http://daniel.carrera.bz/2009/06/rpn-calculator-in-perl-6/ Cheers, Daniel.

Re: RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
Daniel Ruoso wrote: TIMTOWTDI ;) The objective of the blog was more about the learning + teaching experience than anything else. http://sial.org/pbot/37075 % perl rpn.pl "2 2 +" Semicolon seems to be missing at rpn.pl line 2. String found where operator expected at rpn.

Re: RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
Daniel Carrera wrote: http://sial.org/pbot/37075 % perl rpn.pl "2 2 +" Tee hee... that should have been "perl6". :-) Ok, try again: % perl6 rpn.pl "2 2+" 2 2

Re: RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
Daniel Carrera wrote Ok, try again: % perl6 rpn.pl "2 2+" 2 2 You can probably fix that with a different split() line. I tried using instead of \s+ but the program just hangs forever. I also tried a more complex expression, and the calculator didn't like it: % perl6 rpn.pl

Re: RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
Daniel Ruoso wrote: You can probably fix that with a different split() line. I tried using instead of \s+ but the program just hangs forever. Hmm.. it certainly is in the split, I'm not sure how to get the barrier between the 2 and the + Does Perl 6 still have the word barrier \b

Re: RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
Daniel Ruoso wrote: Yes... that's what wasn't implemented... But now it is ;) http://sial.org/pbot/37085 Close, but... % perl6 rpn.pl "5 4 + 3 / 5 3 - *" -6 That should be a positive 6. Are you planning to write a post explaining how your program works? I figure tha

Re: RPN calculator in Perl 6

2009-06-06 Thread Daniel Carrera
Daniel Ruoso wrote: Are you planning to write a post explaining how your program works? Maybe, but if you want to beat me to it, feel free ;) I figure that the explanation is as useful as the example. I sure spent a lot of time writing the blog post. I'm not sure I'll have t

Re: RPN calculator in Perl 6

2009-06-08 Thread Daniel Ruoso
http://sial.org/pbot/37077 A slightly improved syntax, as per jnthn++ suggestion... Em Sáb, 2009-06-06 às 18:08 +0200, Daniel Carrera escreveu: > Daniel Carrera wrote > > Ok, try again: > > % perl6 rpn.pl "2 2+" > > 2 2 > You can probably fix that with a dif

Re: RPN calculator in Perl 6

2009-06-08 Thread Daniel Ruoso
Em Sáb, 2009-06-06 às 19:45 -0400, Minimiscience escreveu: > my $ls = @a.shift; > my $rs = @a.shift; > To: > my $rs = @a.pop; > my $ls = @a.pop; Thanks... this was already solved in the latest version I sent http://sial.org/pbot/37089 daniel

Re: RPN calculator in Perl 6

2009-06-08 Thread Daniel Ruoso
Em Dom, 2009-06-07 às 00:07 +0200, Daniel Carrera escreveu: > Daniel Ruoso wrote: > >> Are you planning to write a post explaining how your program works? > > Maybe, but if you want to beat me to it, feel free ;) > >> I figure that the explanation is as useful as the e

Re: RPN calculator in Perl 6

2009-06-08 Thread Daniel Ruoso
Em Sáb, 2009-06-06 às 14:06 +0200, Daniel Carrera escreveu: > I just wrote a blog post showing how to make a reverse polish notation > calculator in Perl 6. In the process I show some of Perl 6's grammar > features. TIMTOWTDI ;) http://sial.org/pbot/37075 daniel

Re: RPN calculator in Perl 6

2009-06-08 Thread Daniel Ruoso
Em Sáb, 2009-06-06 às 18:22 +0200, Daniel Carrera escreveu: > Daniel Ruoso wrote: > > er... that's because I didn't tried to implement it... but it > certainly > > is possible to, just by declaring the :(@a, Num $a) variant... > Well, * is implemented, so I gues

Re: RPN calculator in Perl 6

2009-06-08 Thread Daniel Ruoso
Em Sáb, 2009-06-06 às 19:51 +0200, Daniel Carrera escreveu: > Daniel Ruoso wrote: > > Yes... that's what wasn't implemented... But now it is ;) > > http://sial.org/pbot/37085 > Close, but... > % perl6 rpn.pl "5 4 + 3 / 5 3 - *" > -6 > That should be

The Josephus Problem

2009-06-12 Thread Daniel Carrera
one can no longer say that Perl's OOP is awkward. I put a lot of effort in writing the code the same way in all languages and I tried very hard to avoid any bias. Cheers, Daniel.

Array Dimensionality (Was: Re: Multi-d array transforms (was Re: Array rotate))

2009-06-12 Thread Daniel Ruoso
capture sigil here, which has '@%a' as its expanded form) my ¢a = 1,(2,(3,4); say ¢a[1][1][1]; say ¢a[1;1;1]; I think that makes the semantics of the API more clear... daniel

Re: Array Dimensionality (Was: Re: Multi-d array transforms (was Re: Array rotate))

2009-06-12 Thread Daniel Ruoso
Em Sex, 2009-06-12 às 11:52 -0700, Jon Lang escreveu: > On Fri, Jun 12, 2009 at 11:51 AM, Daniel Ruoso wrote: > > Ok, There's one thing that is not clear in the thread, which is when an > > array is multidimensional or not... > > For instance: > > @a = (1, 2

Re: Multi-d array transforms (was Re: Array rotate)

2009-06-12 Thread Daniel Carrera
@c if (@c = new_customers()); serve_customer(@customers.shift); } I'm sure the more experienced people can suggest a better example. Daniel.

<    1   2   3   4   5   6   7   8   9   10   >