Re: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread Patrick R. Michaud
"say $x" is essentially equivalent to "put $x.gist". Since Nil is undefined (roughly equivalent to a type object), Nil.gist has a string value of "Nil" and can be printed. However, attempting to convert Nil directly into a Str throws an error because that's attempting to stringify an undefined

Re: Help with grammar

2020-05-21 Thread Patrick R. Michaud
On Thu, May 21, 2020 at 08:40:08PM +, David Santiago wrote: > Can someone explain me why my grammar isn't working? Unfortunately i > can't figure it out :-( > > | headers > | | header > | | * MATCH "Proxy-Connection" > | | header-value > | | * MATCH "keep-alive\n" > | | crlf > | |

Re: I need help sorting a list

2020-05-24 Thread Patrick R. Michaud
On Mon, May 25, 2020 at 12:07:22AM +0200, Tobias Boege wrote: > @things.sort: { > .comb(/ \d+ | \D+ /) > .map({ .Int // .self }) > } Or how about even somethig like @things.sort: *.Version; which does handle a reasonable set of version semantics...? (The .Version method was

Re: junctions and parenthesis

2020-06-21 Thread Patrick R. Michaud
The "any" function is just like any other function taking an arbitrary list of arguments (including user-defined functions). As such it parses with lower precedence than comparison operators -- so "eq" binds more tightly than "any". Thus say so any eq any ; parses like say(so(any( eq

Re: "ICU - International Components for Unicode"

2020-09-25 Thread Patrick R. Michaud
On Fri, Sep 25, 2020 at 12:37:49PM +0200, Elizabeth Mattijsen wrote: > > On 25 Sep 2020, at 04:25, Brad Gilbert wrote: > > Rakudo does not use ICU > > > > It used to though. > > > > Rakudo used to run on Parrot. > > Parrot used ICU for its Unicode features. > > I do remember that in the Parrot

Re: Brace interpolation in strings creates a new scope?

2020-10-26 Thread Patrick R. Michaud
On Mon, Oct 26, 2020 at 08:04:21PM +0100, Elizabeth Mattijsen wrote: > > On 26 Oct 2020, at 18:40, Sean McAfee wrote: > > Is this the intended behavior? The doc page on quoting constructs > > just says that values can be interpolated with braces, but (at least > > to my eyes) doesn't suggest th

Re: Missing NullPointerException

2020-12-01 Thread Patrick R. Michaud
The difference is between the result of "Nil.c" and "Any.c". On my current version of Rakudo, "Nil.c" returns Nil, while Any.c throws the "No such method" exception. In fact, Nil.any_non_existent method always seems to return Nil. I'm not sure where this is documented, but it's likely the re

Re: for and ^ question

2021-01-01 Thread Patrick R. Michaud
On Fri, Jan 01, 2021 at 05:41:04PM -0800, ToddAndMargo via perl6-users wrote: > On 1/1/21 6:32 AM, David Santiago wrote: > > say $_ for {0.1+$_}...^5 > > Is there a way to do this without the finger wagging? > > say $_ for {0.1+$_}...^2 If you're going to a sequence operator ("...") instead of a

Re: I need help with ~~m/

2021-01-30 Thread Patrick R. Michaud
On Sat, Jan 30, 2021 at 05:52:54PM -0800, Joseph Brenner wrote: > Which means there's some potential confusion if you really need > to match quotes: > > my $str = 'string_632="The chicken says--", voice="high"'; > > say > $str ~~ m:g{ ( " .*? " ) }; # False > say > $str

Re: [naive] hash assingment

2021-07-14 Thread Patrick R. Michaud
On Wed, Jul 14, 2021 at 07:41:14PM +, Daniel Sockwell wrote: > (Also, you may already know this, but when the keys of your hash are > strings, you can write %a instead of %a{'column1'} ) A minor nit: this only works if the string keys don't contain whitespace. (The single angle bracket postf

Re: callbacks with placeholder vars

2021-08-09 Thread Patrick R. Michaud
On Mon, Aug 09, 2021 at 01:00:52PM -0700, Joseph Brenner wrote: > There's this much: > > https://docs.raku.org/language/variables#index-entry-$$CIRCUMFLEX_ACCENT > > > If you have self-declared a parameter using $^a once, you may refer to it > > using only $a thereafter. > > But it doesn't go a

Re: intermixed types and resulting types

2021-08-21 Thread Patrick R. Michaud
On Sat, Aug 21, 2021 at 12:50:21PM -0700, Joseph Brenner wrote: > But then, in a case like this one, how would you know in advance > that it would work, without Just Trying It: > > my @monsters = < godzilla grendel wormface blob >; > my $cool_monsters = < godzilla ghidra mothera >.Set; >

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread Patrick R. Michaud
This is a place where .comb() is likely much better than .split() -- .comb() allows you to specify what you're wanting instead of what you're wanting to avoid: $ raku -e "say sqrt(2).comb(/\d/).join(', ');" 1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 1 If you want only the first 10 di

Re: Need regex ^? help

2024-04-29 Thread Patrick R. Michaud
Perhaps not really what you're intending, but here's how I'd start: $ raku -e 'my $x="1.2.3.4"; $x ~~ s!\d+$!0/24!; say $x;' 1.2.3.0/24 The pattern part of the substitution matches all of the digits at the end of the string (\d+$), then replaces them with the string "0/24". Everything p

Re: support for editing and history in the REPL?

2012-06-30 Thread Patrick R. Michaud
On Sat, Jun 30, 2012 at 06:39:55PM +0300, Gabor Szabo wrote: > hi, > > what do I need to install or enable in order to get a better REPL? > > Things like history with up and down arrow and editing capabilities? In Ubuntu (12.04), this requires the libreadline6-dev library to be installed at the

Re: support for editing and history in the REPL?

2012-06-30 Thread Patrick R. Michaud
On Sat, Jun 30, 2012 at 07:21:10PM +0300, Gabor Szabo wrote: > On Sat, Jun 30, 2012 at 7:16 PM, Patrick R. Michaud > wrote: > > On Sat, Jun 30, 2012 at 06:39:55PM +0300, Gabor Szabo wrote: > > Is there a list of recommended package to install before building Parrot

Re: IO stat exception when using :l

2012-07-05 Thread Patrick R. Michaud
On Thu, Jul 05, 2012 at 05:34:43PM +0300, Gabor Szabo wrote: > use v6; > my $f = "a".IO; > if $f ~~ :r { >say 'file readable'; > } > if $f ~~ :l { > say 'symlink'; > } > > the readability and most other test fail and return some undef, but > checking for :l (symlink) throws an excepti

Re: IO.s size how?

2012-07-05 Thread Patrick R. Michaud
On Thu, Jul 05, 2012 at 05:51:09PM +0300, Gabor Szabo wrote: > I can write either > $path.IO ~~ :e > or > $path.IO.e > > to check if a $path exists. Is either of those recommended? > > How can I check for size? Based on my understanding of src/core/IO.pm > I'd think it is > $path.IO.s

Re: File content is not written if close not called

2012-07-12 Thread Patrick R. Michaud
On Thu, Jul 12, 2012 at 05:36:58PM +0300, Gabor Szabo wrote: > The following script leaves and epty 'data.txt' behind. > Only if I call $fh.close is the file contents saved. > > Is this a feature? > > use v6; > > my $fh = open 'data.txt', :w; > $fh.print("hello\n"); While Rakudo and Parrot _sho

Rakudo Star 2012.07 released

2012-07-28 Thread Patrick R. Michaud
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the July 2012 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the July 2012 release is available from . In the Perl 6 world, we make a distinc

Rakudo Star 2012.08 released

2012-08-31 Thread Patrick R. Michaud
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the August 2012 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the August 2012 release is available from . A Windows .MSI version of Rakudo St

Rakudo Star 2012.09 released

2012-09-30 Thread Patrick R. Michaud
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the September 2012 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the September 2012 release is available from . A Windows .MSI version of Rak

Re: implementing every(N)

2013-01-08 Thread Patrick R. Michaud
On Tue, Jan 08, 2013 at 12:14:22PM -0500, Ted Zlatanov wrote: > On Mon, 7 Jan 2013 17:51:52 +0100 Carl Mäsak wrote: > > CM> Ted (>): > >> Are state variables available now, or is the every(N) functionality > >> possible in some other way now? > > CM> Why not try it by writing a small program? :

Re: Packaging Perl 6 (or rather, Rakudo Star)

2013-03-05 Thread Patrick R. Michaud
On Tue, Mar 05, 2013 at 11:13:51AM +0100, Rob Hoelz wrote: > I already have my own package for Arch Linux for Rakudo Star, and I keep > the OS X homebrew package up-to-date as well. I'd like to create an RPM > spec file and a DEB spec file as well. I have two questions: > > 1) Do these spec file

Re: Packaging Perl 6 (or rather, Rakudo Star)

2013-03-05 Thread Patrick R. Michaud
On Tue, Mar 05, 2013 at 12:02:01PM +0100, Rob Hoelz wrote: > On 3/5/13 11:44 AM, Patrick R. Michaud wrote: > > It may also be worth noting/reminding that Rakudo Star has never been > > intended to be the "only" or even "primary" module collection, it's j

Re: prove that the meaning of live is math

2013-05-26 Thread Patrick R. Michaud
On Sun, May 26, 2013 at 09:54:21AM -0500, Hao Wu wrote: > However, why 42? any relation to meaning of life? It seems I miss > something. Thanks. 42 is the "Answer to the Ultimate Question of Life, the Universe, and Everything", which is sometimes shortened to be "meaning of life". See https://e

Rakudo Star 2013.05 released

2013-05-30 Thread Patrick R. Michaud
## A useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the May 2013 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball and Windows .MSI for the May 2013 release are available from

Re: Rakudo Star 2013.05 released

2013-05-30 Thread Patrick R. Michaud
On Thu, May 30, 2013 at 11:08:13PM -0500, Patrick R. Michaud wrote: > This Star release includes [release 2013.05] of the > [Rakudo Perl 6 compiler], version 5.2.0 of the [Parrot Virtual > Machine] ... Oops. The 2013.05 release actually contains Parrot 5.3.0. Sorry about the typo. Pm

Re: as perl6 has no $/ ...

2013-09-23 Thread Patrick R. Michaud
On Tue, Sep 24, 2013 at 02:14:50AM +0200, Marc Chantreux wrote: > Come on, Perl6 people! did i miss something that takes carre of separators? > it would be nice to have something like: I think it's currently specced in S32 as :nl("\n"). See http://perlcabal.org/syn/S32/IO.html#open and http://p

Re: Stickers of Parrot and Perl 6 for GSoC

2013-10-07 Thread Patrick R. Michaud
https://github.com/perl6/mu/blob/master/misc/camelia.svg https://github.com/perl6/mu/blob/master/misc/camelia.odg I have a .ai of the Parrot head logo if you need it and can send it to you. Pm On Mon, Oct 07, 2013 at 06:32:57PM -0500, Bruce Gray wrote: > At the upcoming GSoC Mentor Summit

Re: match's replacement name?

2014-05-23 Thread Patrick R. Michaud
On Fri, May 23, 2014 at 03:08:38PM -0400, Peter Schwenn wrote: > Still it would be more straightforward to have something like > $layn ~~ s:g/ (\W) [[RMA\.]? OpenNURBS\.]? I? On (<[2..4]>) dPoint > /$0Rhino.Geometry.Point$1d/; > and have a more perl6-built-in way of getting hold of the /replac

Re: Moar Parrots

2014-09-09 Thread Patrick R. Michaud
On Tue, Sep 09, 2014 at 10:07:46PM +0200, Alex Becker wrote: > Hitting the download button for Perl 6 leads to this page: > http://rakudo.org/downloads/star/ > There is a set of undocumented files. For 2014.08, there is one msi file > with the Suffix moar, and one with the Suffix parrot. To avoid

Re: Is this a strange regex bug in my code?

2014-12-29 Thread Patrick R. Michaud
Out of curiosity, is the bug still present if you use /\.txt$/ instead of m/\.txt$/ ? At the moment it looks like a Rakudo bug to me, but I haven't been able to golf it further to be certain. Pm On Tue, Dec 30, 2014 at 09:11:52AM +0200, Gabor Szabo wrote: > Just to follow-up: > The problem a

Re: Is this a strange regex bug in my code?

2014-12-29 Thread Patrick R. Michaud
4 at 09:29:39AM +0200, Gabor Szabo wrote: > No. If I remove the leading m from the regex, then the bug is gone. > Gabor > > On Tue, Dec 30, 2014 at 9:19 AM, Patrick R. Michaud > wrote: > > > Out of curiosity, is the bug still present if you use /\.txt$/ instead of > &

Re: Profiling Perl 6 code

2014-12-31 Thread Patrick R. Michaud
If you're running Rakudo on MoarVM, try the --profile option. It will create an HTML file that shows a lot of useful information, including time spent in each routine, call graphs, GC allocations, etc. Pm On Wed, Dec 31, 2014 at 09:35:33AM +0200, Gabor Szabo wrote: > The Perl 6 Maven site is a

Re: generating grammars, capturing in regex interpolation, etc.

2015-04-14 Thread Patrick R. Michaud
On Tue, Apr 14, 2015 at 08:58:27PM -0400, Nathan Gray wrote: > I've run into a snag, in that my strptime processing in Perl 5 > relies on building a string that looks like a regex with named > captures, and then interpolating that into a real regex. >[...] > my $pattern = Q/$=[hello]/; > my

Re: Sub args: choose one of two?

2015-06-30 Thread Patrick R. Michaud
On Sat, Jun 27, 2015 at 05:39:32PM -0500, Tom Browder wrote: > I'm trying to take advantage of the MAIN suroutine to handle most all of my > routine command line arg handling. One idiom I use a lot is for the user > to choose only one of two args, but one must be chosen. Perhaps you want that the

Re: Sub args: choose one of two?

2015-07-02 Thread Patrick R. Michaud
On Thu, Jul 02, 2015 at 03:22:17PM -0400, Brandon Allbery wrote: > On Thu, Jul 2, 2015 at 3:08 PM, Tom Browder wrote: > > > 1. Write the 'main' program as another subroutine and call it from > > each of the appropriate multi > > subs--aarghh! > > > > This seems like the right one to me; it also

Re: Sub args: choose one of two?

2015-07-02 Thread Patrick R. Michaud
On Thu, Jul 02, 2015 at 03:21:11PM -0500, Tom Browder wrote: > Okay, a second look shows me that's not quite as bad as I first though. Another possibility is to let MAIN unpack the args for you, but then check the exclusivity directly instead of using multisubs to do it: sub MAIN(:$need, :$h

Re: How to call a super class method?

2015-10-28 Thread Patrick R. Michaud
On Wed, Oct 28, 2015 at 03:31:09AM +, TS xx wrote: > > Can I call the Person's constructor (in non static context), > pass the required parameter and do more things before returning? There are two answers to this question, both of which likely deserve a few lines in doc.perl6.org/language/fa

Re: Missing documentation

2015-10-28 Thread Patrick R. Michaud
I suspect that http://doc.perl6.org/language/5to6 should at least have be a redirect to somewhere useful, if not an index of the available 5to6 pages. Pm On Wed, Oct 28, 2015 at 09:22:55PM +0100, Kaare Rasmussen wrote: > On 10/28/2015 08:31 PM, Parrot Raiser wrote: > >This Perl 5 to 6 Translatio

Re: release?

2015-12-29 Thread Patrick R. Michaud
On Tue, Dec 29, 2015 at 01:57:57AM -0800, Darren Duncan wrote: > On that note, are there going to be Perl 6 versions 6.x.y where {x,y} are > integers? Will 6.0.0 be the first such one? -- Darren Duncan This was the topic of my FOSDEM talk last year, and then again at YAPC::NA. "Perl 6" is a lang

Re: c99 hexadecimal floating point support?

2015-12-31 Thread Patrick R. Michaud
On Thu, Dec 31, 2015 at 04:13:40PM +0900, Dan Kogai wrote: > Anyway, is there a plan to support hexadecimal floating point support? > % perl6 -e 'say 0x1.921fb54442d18p+1' > ===SORRY!=== Error while compiling -e > Malformed postfix call > at -e:1 > --> say 0x1.⏏921fb54442d18p+1 $ ./perl6 -e 's

Re: Recalling previous commands

2016-01-01 Thread Patrick R. Michaud
While I recall that we've often discussed building command history into Rakudo's REPL directly, the workaround suggested to me was to use 'rlwrap': $ rlwrap ./perl6 Then the arrow keys work, as well as CTRL-P and other bash-like history commands. I've never used CTRL-K for history, but rlw

Re: is there a Perl 5 converter?

2016-01-21 Thread Patrick R. Michaud
On Thu, Jan 21, 2016 at 01:39:15PM -0600, Aaron Baugher wrote: > Tom Browder writes: > > > Thanks, Aaron, good explanation. But can you find a description of > > '<->' in the Perl 6 docs? > > It's mentioned here: https://doc.perl6.org/language/control#for > > And here, where it's called the "d

Re: capture through regex variable

2016-02-22 Thread Patrick R. Michaud
Dynamic subregexes such as <$top> are non-capturing by default. You can easily capture the result by using something like instead: $ cat xyz.p6 my $match; my $top = rx/ \( $ = [ \w* ] \) /; given "(abc)" { $match = m/^ /; } if $match { say

Re: can Perl 6 bootstrap itself

2016-08-25 Thread Patrick R. Michaud
On Thu, Aug 25, 2016 at 10:37:45AM -0700, Dipesh Sharma wrote: > Dependency on perl5 for building perl6 looks like a concern. It means that > we can't have and environment with perl6, without perl5. I disagree. Just because perl5 is currently required to *build* Rakudo doesn't mean that perl5 h

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Patrick R. Michaud
On Tue, Sep 13, 2016 at 10:35:01AM -0400, Bennett Todd wrote: > Having the minutia of the programmatic run-time state of the parse then > influence the parse itself, is at the heart of the perl5 phenomenon "only > Perl can parse perl", which I rather hope isn't going to be preserved in > perl6.

Re: grammars and indentation of input

2016-09-13 Thread Patrick R. Michaud
I don't have an example handy, but I can categorically say that Perl 6 grammars are designed to support exactly this form of parsing. It's almost exactly what I did in "pynie" -- a Python implementation on top of Perl 6. The parsing was done using a Perl 6 grammar. If I remember correctly, Pynie

Re: Startup performance on OS X

2016-10-02 Thread Patrick R. Michaud
On Sun, Oct 02, 2016 at 11:00:38AM +0200, Thor Michael Støre wrote: > Thormicks-MacBook-Pro-3:~ thormick$ time perl6 -e "say 'foo'" > foo > > real 0m0.205s > user 0m0.150s > sys 0m0.045s > > [...] > > Foo indeed! ~200ms for this seems awfully slow to me. On another hand, my machine shows: $

Re: Startup performance on OS X

2016-10-03 Thread Patrick R. Michaud
On Mon, Oct 03, 2016 at 04:26:10PM +0200, Elizabeth Mattijsen wrote: > > On 02 Oct 2016, at 11:00, Thor Michael Støre wrote: > > Is this normal startup performance? > > https://www.promptworks.com/blog/public-keys-in-perl-6 > > I wonder what would be needed to run this in Perl 5, module wise, an

Re: for loop index question

2017-02-28 Thread Patrick R. Michaud
I think the canonical Perl 6 answer is: for @array.kv -> $index, $value { do something } Pm On Tue, Feb 28, 2017 at 01:20:47PM -0800, ToddAndMargo wrote: > Hi All, > > There are times when I want to know th4e index of an array > when I am in a "for @array" loop. I can do it with a > variab

Re: RFE: throw an error on a single "="when used in an "if"

2017-03-20 Thread Patrick R. Michaud
On Mon, Mar 20, 2017 at 02:36:49PM +0100, Francesco Rivetti wrote: > On 18. mars 2017 11:54, Elizabeth Mattijsen wrote: > > > if (my $x = frobnicate(42)) { > > say $x > > } > [...] > > if frobnicate(42) -> $x { > > say $x > > } > > which is way more elegant. Should this make it wise to ha

Re: maintainability and "or"

2017-03-21 Thread Patrick R. Michaud
On Tue, Mar 21, 2017 at 02:25:02PM -0400, Brandon Allbery wrote: > On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo wrote: > > $Name.IO.f or $Name.IO.open(:w).close; > > fwiw I consider this a perl3_to_5-ism; it's an optimization, and a fairly > poor one for readability and maintainability, but one

Re: maintainability and "or"

2017-03-21 Thread Patrick R. Michaud
On Tue, Mar 21, 2017 at 02:46:43PM -0400, Brandon Allbery wrote: > On Tue, Mar 21, 2017 at 2:37 PM, Patrick R. Michaud > wrote: > > > On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo > > wrote: > > > > $Name.IO.f or $Name.IO.open(:w).close; > > > > >

Re: Parse a string into a regex?

2017-05-11 Thread Patrick R. Michaud
Since we went to a lot of trouble to get lexical and closures to work correctly in Perl 6, it seems fair to use it here: $ cat rxstr sub rxstr($s) { rx/<$s>/ } my $str = 'foo'; my $foorx = rxstr($str); # create /foo/ regex say 'foo' ~~ $foorx; # matches $

Re: Invoking method by name found in variable

2017-05-23 Thread Patrick R. Michaud
On Tue, May 23, 2017 at 09:01:54PM +0300, Gabor Szabo wrote: > given an object $o and the name of a method in $method = "run" > how can I invoke the $o.run() ? > > Something like $o.call($method) At one point it was done as $o."$method"() . > my $method = 'say'; 123."$method"(); 123 Pm

Re: Perl6 shell, Was: command auto-completion in perl6 shell

2017-05-31 Thread Patrick R. Michaud
On Wed, May 31, 2017 at 09:33:59AM -0400, Brock Wilcox wrote: > One of my dreams is to adopt a client/server + middleware model from nREPL > (clojure) which I think works really well, and likely to do that in > userspace as a regular module. Moving everything into REPL.pm (perl6 > instead of nqp) l

Re: getting help in the REPL

2017-06-14 Thread Patrick R. Michaud
On Wed, Jun 14, 2017 at 04:00:05PM +0300, Gabor Szabo wrote: > In the python interactive shell one can write dir(object) and it > lists the attributes and methods of the object. One can write > help(object) and get the documentation of the object. > Is there anything similar in Perl 6? I think th

Re: Need awk print sub

2017-08-04 Thread Patrick R. Michaud
How about... $ echo "a b c d" | ./perl6 -n -e '.words[1].say' b Pm On Fri, Aug 04, 2017 at 01:00:52PM -0700, ToddAndMargo wrote: > Hi All, > > How do I do this with a perl one liner? > > $ echo "a b c d" | awk '{print $2}' > b > > Many thanks, > -T

Re: Any "note" without the "say"?

2017-09-15 Thread Patrick R. Michaud
On Fri, Sep 15, 2017 at 04:54:33PM -0400, Brandon Allbery wrote: > On Fri, Sep 15, 2017 at 4:51 PM, ToddAndMargo wrote: > > On 09/15/2017 01:29 PM, Brandon Allbery wrote: > >> Everyone does at one time :) It's really useful for debugging, but you > >> generally strip it out of production code. > >

Re: Need match character help

2018-05-20 Thread Patrick R. Michaud
On Fri, May 18, 2018 at 03:28:20PM +0200, Timo Paulssen wrote: > On 18/05/18 13:30, The Sidhekin wrote: > > > >   / ^ <[d..z]>* $/ > > That's pretty good! Putting the beginning-of-string anchor ^ anywhere > but the very start is surely an advanced move :) FWIW, sometimes I think it's worth invert

Re: Need match character help

2018-05-20 Thread Patrick R. Michaud
On Sun, May 20, 2018 at 03:02:34PM -0700, ToddAndMargo wrote: > On 05/20/2018 10:40 AM, Patrick R. Michaud wrote: > > On Fri, May 18, 2018 at 03:28:20PM +0200, Timo Paulssen wrote: > > > On 18/05/18 13:30, The Sidhekin wrote: > > > > > > > >   / ^ &l

Re: -c bug to report

2018-07-25 Thread Patrick R. Michaud
On Wed, Jul 25, 2018 at 11:48:30AM -0700, ToddAndMargo wrote: > Maybe I am trying to get "-c" to do too many things. > > What I would like it to do is to check everything right up to but not > actually run the program. Part of the challenge here is that unlike many other programming languages, P

Re: can't match unicode chars?

2018-07-31 Thread Patrick R. Michaud
On Tue, Jul 31, 2018 at 09:28:08PM +0200, Marc Chantreux wrote: > @*ARGS.map: { > gather { > my @lines; > for .IO.lines -> $l { >if /'›'/ { >@lines and take @lines; >@lines = $l; >} >else { >@lin

Re: need regex help

2018-08-03 Thread Patrick R. Michaud
The + essentially indicates that this is a character-class match. It's to distinguish things from <.alpha>, , , <-alpha>, and (among others). Pm On Fri, Aug 03, 2018 at 08:48:24PM +0200, Timo Paulssen wrote: > The + is required, perhaps because the first character after the opening > < is sup

Re: Catching exceptions in expressions

2018-08-03 Thread Patrick R. Michaud
Maybe something like...? $ cat t.p6 sub infix:(Callable $block, $otherwise) { CATCH { return $otherwise; } $block(); } sub divide($a, $b) { die "Zero denominator" if $b == 0; $a / $b } my $sixdivzero = { divide(6,0) } rescue -1; say "6/0 = ", $sixdivzero; my $sixdivtwo = { divide(6,2) }

Re: Catching exceptions in expressions

2018-08-03 Thread Patrick R. Michaud
we could use Thunk as a type: > > sub infix:(Thunk:D $block, $otherwise) { } > > which would then allow you to do: > > my $sixdivzero = divide(6,0) rescue -1; # note absence of curlies > > > > One can wish, can’t one? > > > Liz > > > On 3 Aug 2

Re: Grammar doesn't seem to match any token

2018-09-23 Thread Patrick R. Michaud
I suspect the rule: rule other { . } means that in $input = '~i << to match (although will also end up matching the space after the "i" in the text string, since white spaces are no longer significant). Or try just changing the rule to be a token and leave the others as rules. Ph

Re: split and nils?

2019-02-06 Thread Patrick R. Michaud
On Wed, Feb 06, 2019 at 12:38:01PM -0800, ToddAndMargo via perl6-users wrote: > $ p6 'my Str $x="abcd"; for $x.comb.kv -> $i, $j {say "Index <$i> = <$j> = > ord <" ~ ord($j) ~ ">";}' > > Index <0> = = ord <97> > Index <1> = = ord <98> > Index <2> = = ord <99> > Index <3> = = ord <100> > > Cer

Re: Need help with a regex

2019-05-07 Thread Patrick R. Michaud
The (.*?) pattern will match an empty string. Thus $0 gets the dollar sign, $1 is "", and "$" ~ "" (i.e., "$") gets replaced by "" ~ "USD" (i.e., "USD"). So the net result is to replace the single dollar sign by "USD", resulting in "USD1.23". You might want to remove the ? modifier from .*?

Re: while(<>){...} analog?

2019-07-29 Thread Patrick R. Michaud
My guesses at Perl 6 versions of the Perl 5 example: say .split(':')[0, 2, 1, 5].join("\t") for lines; -or- for lines { say .split(':')[0, 2, 1, 5].join("\t") } Pm On Mon, Jul 29, 2019 at 12:49:51PM -0700, William Michels via perl6-users wrote: > Hello, Just a short backgrounder to say

Re: Substr behaviour with CRLF

2020-02-10 Thread Patrick R. Michaud
Because Str is treated as a set of graphemes, and "\r\n" is treated as a single character, .substr() is doing the right thing here. If you really want to treat it as a series of codepoints, you may want to go through Blob/Buf to get there: > "1234\r\n78".encode.subbuf(*-4) utf8:0x<0D 0A

Re: Metamethods: WHERE

2020-02-12 Thread Patrick R. Michaud
On Wed, Feb 12, 2020 at 10:27:20AM -0300, Aureliano Guedes wrote: > So, I'd like to find a way to test if two variables are bound or not, > especially concerning their memory address. > > If the address is not fixed for a lifetime, I must be able to test it in > just one cycle. > > $a.WHERE == $b.

Re: In lieu of "This Week in Perl 6"

2008-04-13 Thread Patrick R. Michaud
On Sat, Apr 12, 2008 at 11:52:44PM +0200, Moritz Lenz wrote: > Conrad Schneiker wrote: > > Also, please consider referring people to the Perl 6 wiki (and > > any relevant subsections thereof) for more information when > > writing things that may get wider attention beyond the immediate > > Perl 6 c

Re: Recommended Perl 6 best practices?

2008-09-14 Thread Patrick R. Michaud
On Sun, Sep 14, 2008 at 04:18:44PM +0200, Carl Mäsak wrote: > Conrad (>): > > Is there something more up-to-date concerning "Perl 6 best practices" that > > are presently-recommended (by p6l or @Larry) than the following item on the > > Perl 6 wiki? > [...] > That said, I do have one Perl 6-specifi

Re: Recommended Perl 6 best practices?

2008-09-30 Thread Patrick R. Michaud
On Tue, Sep 30, 2008 at 02:31:46PM +1000, Jacinta Richardson wrote: > Carl Mäsak wrote: > > The "correct" form using junctions would be this: > > > > die "Unrecognized directive: TMPL_$directive" > >if $directive ne 'VAR' & 'LOOP' & 'IF'; > > which makes sense, because this does give us: > >

Re: Argument scoping error or bug?

2008-10-27 Thread Patrick R. Michaud
On Sat, Oct 25, 2008 at 10:52:13AM +0200, Moritz Lenz wrote: > Chris Dolan wrote: > > I stumbled across this issue while descending into a recursive Match > > structure. Consider the following reentrant subroutine: > > You have just experienced this bug: > http://rt.perl.org/rt3/Ticket/Display.

Re: Why {{}} for regexp closures instead of just {}?

2008-10-28 Thread Patrick R. Michaud
On Mon, Oct 27, 2008 at 04:07:39PM -0500, [EMAIL PROTECTED] wrote: > > On Sun, Oct 26, 2008 at 10:45 PM, Chris Dolan <[EMAIL PROTECTED]> wrote: > >> S05 always uses single curlies for closures, but throughout Parrot, code > >> seems to use double curlies in PGE regexps. Why is that? > >> > >> That

Rakudo bug reports still go to [EMAIL PROTECTED]

2008-11-19 Thread Patrick R. Michaud
Some of you may have seen the announcements on the Parrot lists that Parrot will be starting to use trac.parrot.org for its issue tracking and bug reporting system. This is just a note that Rakudo's bug reports will continue to be hosted on the rt.perl.org server, and we will continue to use <[EM

Re: grammar question

2008-11-29 Thread Patrick R. Michaud
On Sat, Nov 29, 2008 at 05:57:07PM +1000, Илья wrote: > Hi there, > I have tried to fix our HTML::Template in November which is blocked by > Rakudo segaful. > I was trying to create simple example, but can`t reproduce it. By the > way now I have short > example(much shorter then when I start), and

Re: .kv

2008-12-14 Thread Patrick R. Michaud
On Sun, Dec 14, 2008 at 11:55:54PM +1000, Илья wrote: > (23:24:09) ihrd: hi > (23:24:28) ihrd: question about .kv > (23:24:39) ihrd: rakudo: my @a = {a => 1}, {b =>2}; my %h = foo => @a; > say %h.kv.perl; > (23:24:41) p6eval: rakudo 33880: OUTPUT[["foo", {"a" => 1}, {"b" => 2}]␤] > (23:24:59) ihrd:

Perl 6 Scripting Games

2008-12-22 Thread Patrick R. Michaud
Are you interested in playing with Perl 6 and Rakudo Perl but can't figure out what to do? Here's an idea that came up during Jon Allen's talk "The Camel and the Snake" [1] at YAPC::EU in Copenhagen. For the past few years Microsoft has sponsored an annual Scripting Games [2] competition, where

Re: reporting bugs

2009-01-04 Thread Patrick R. Michaud
On Sun, Jan 04, 2009 at 05:20:56PM +0300, Richard Hainsworth wrote: > I posted an email to per6-all asking about how one should go about > reporting bugs. That message has appeared on the list. > > So again: how can bugs be reported? See the "Reporting bugs" section of README file in languages/p

Re: not wanting something

2009-01-06 Thread Patrick R. Michaud
On Tue, Jan 06, 2009 at 12:42:16PM -0500, Chas. Owens wrote: > On Tue, Jan 6, 2009 at 10:12, Patrick R. Michaud wrote: > snip > > Also, Perl 6 already provides a 'digit' rule by default, although > > it's digits in the Unicode sense as opposed to simply the 0..9

Re: what is going on here?

2009-01-13 Thread Patrick R. Michaud
On Mon, Jan 12, 2009 at 12:11:59PM +0300, Richard Hainsworth wrote: > But > my @ranking = %players.sort :{.value}; # white space before :, no ws after : > > generates a syntax error with rakudo. > Is this a raduko bug, or am I not understanding your generic argument? Rakudo doesn't recognize adver

Re: A Logo design for Rakudo Perl 6

2009-01-16 Thread Patrick R. Michaud
On Fri, Jan 16, 2009 at 03:45:48AM -0700, Perl wrote: > Moritz was one of the first to guide it to the idea of making a logo for > Rakudo Perl 6 - as there's nothing yet (really) available. I thought that > would be a neat project and scratch some of my person itches. It would be a very neat pro

Rakudo Perl development release #14 ("Vienna")

2009-02-26 Thread Patrick R. Michaud
On behalf of the Rakudo development team, I'm pleased to announce the February 2009 development release of Rakudo Perl #14 "Vienna". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the February 2009 release is available from http://www.pmichaud.com/perl

Re: Rakudo Perl development release #14 ("Vienna")

2009-02-27 Thread Patrick R. Michaud
On Fri, Feb 27, 2009 at 09:07:10PM +, Ross Kendall wrote: > Thanks for the Vienna release. All of a sudden Perl 6 feels a lot more > accessible. Yay, that was one of the big goals for the release. > Are there plans to set up a new website for Rakudo now it's on its own? > If so, I would be

Rakudo Perl development release #15 ("Oslo")

2009-03-20 Thread Patrick R. Michaud
On behalf of the Rakudo development team, I'm pleased to announce the March 2009 development release of Rakudo Perl #15 "Oslo". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the March 2009 release is available from http://www.pmichaud.com/perl6/rakudo

Re: YALI (yet another logo idea)

2009-03-24 Thread Patrick R. Michaud
On Tue, Mar 24, 2009 at 11:29:08AM -0400, Guy Hulbert wrote: > On Tue, 2009-24-03 at 14:17 +, Ross Kendall wrote: > > I was thinking that a logo doesn't really need to incorporate a symbol > > (e.g. camel, onion etc.), and that one of the more important aspects of > > a logo is the typography.

Re: Logo considerations

2009-03-24 Thread Patrick R. Michaud
On Tue, Mar 24, 2009 at 10:24:47AM -0700, Larry Wall wrote: > I want something > with gut appeal on the order of Tux. In particular I want a logo > for Perl 6 that is: > > Fun > Cool > Cute > Named > Lively > Punable > [...] +2 to this approach. Pm

Re: Logo considerations - 3 logos needed

2009-03-25 Thread Patrick R. Michaud
On Wed, Mar 25, 2009 at 10:36:56AM -0400, Mark J. Reed wrote: > Rakudo is a particular implementation of Perl 6 using Parrot. While > it is a separate project from both Perl 6 and Parrot, it is intimately > tied to both, and I think its logo should reflect that. I don't see > much point in having

Oslo Perl 6 Hackathon Notes

2009-04-13 Thread Patrick R. Michaud
As some of you are aware, this week is the Nordic Perl Workshop [1], and in the days immediately following the workshop we will have the Oslo Perl 6 Hackathon [2]. During the first day of the hackathon Gabor Szabo will be doing a "Hands-on Perl 6 training" course [3], the other two days will be fo

Rakudo Perl 6 development release #16 ("Bratislava")

2009-04-22 Thread Patrick R. Michaud
On behalf of the Rakudo development team, I'm pleased to announce the April 2009 development release of Rakudo Perl #16 "Bratislava". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the April 2009 release is available from http://github.com/rakudo/rakudo/dow

Rakudo Perl 6 development release #17 ("Stockholm")

2009-05-21 Thread Patrick R. Michaud
On behalf of the Rakudo development team, I'm pleased to announce the May 2009 development release of Rakudo Perl #17 "Stockholm". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the May 2009 release is available from http://github.com/rakudo/rakudo/download

Re: Rakudo Perl 6 development release #17 ("Stockholm")

2009-05-26 Thread Patrick R. Michaud
On Sat, May 23, 2009 at 07:33:06PM +0200, Christian Aperghis wrote: > Reini Urban a écrit : > > Patrick R. Michaud schrieb: > >> On behalf of the Rakudo development team, I'm pleased to announce > >> the May 2009 development release of Rakudo Perl #17 "Stockho

Error running parrot_config (was: Rakudo Perl 6 development ...)

2009-05-26 Thread Patrick R. Michaud
On Tue, May 26, 2009 at 10:37:41PM +0100, Nelo Onyiah wrote: > All I am seeing is just the message: > > Reading configuration information from parrot/parrot_config ... > Died at Configure.pl line 104. Okay, this is definitely helpful. What do you get from manually running "parrot/parrot_config -

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

2009-06-03 Thread Patrick R. Michaud
On Thu, Jun 04, 2009 at 12:12:06AM +0200, Chris Mair wrote: > I'm new here, so forgive me if this is not the right list. You're in the right place! > After having used perl5 a lot years ago, this weekend I > finally decieded to have a look at perl6. > [...] > Anyway, the parrot and rakudo files w

Rakudo Perl 6 development release #18 ("Pittsburgh")

2009-06-18 Thread Patrick R. Michaud
On behalf of the Rakudo development team, I'm pleased to announce the June 2009 development release of Rakudo Perl #18 "Pittsburgh". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the June 2009 release is available from http://github.com/rakudo/rakudo/down

  1   2   >