Re: my zenity adventure

2023-03-26 Thread Timo Paulssen via perl6-users
Hey Todd, Its likely that because you are using the shell sub the < and > characters have been interpreted by the shell to mean redirection. Check for odd files in your working directory that have the text you saw zenity output in them, and perhaps there is even a file with heat the capital

Re: the MAIN questions

2021-12-29 Thread Timo Paulssen
Hey marc, since the default value for a "Bool" is an undefined Bool, you can just boolify whatever happens to be in :$diff, which will be False for "no flag passed" or True for "flag passed and was True". Hope that helps   - Timo On 29/12/2021 13:00, Marc Chant

Re: dimensions in a multidimensional array

2021-02-05 Thread Timo Paulssen
Shaped Arrays and Native Shaped Arrays already use one contiguous blob to store all their data; in Shaped Arrays that's an array of pointers to the stored objects, in a Native Shaped Array it'll be like a big array of 32bit integers or whatever you have. Regards   - Timo On 05/02/2021 16:48

Re: msi of 2020.10?

2020-12-02 Thread Timo Paulssen
Hi todd, please give this a try:     https://setxkbmap.de/rakudo-2020-11-windows-32bit.zip good luck! btw I forgot you wanted 2020.10 so I just made 2020.11. And I assumed you wanted a 32bit build, since that was what I remember you wanted last time? HTH   - Timo On 02/12/2020 22:39

Re: Missing NullPointerException

2020-12-02 Thread Timo Paulssen
On 02/12/2020 17:18, William Michels via perl6-users wrote: Does this explain why calling "dd" in the REPL returns Nil on the final line, but Nil doesn't seem to be returned on the final line when using "dd" from the Bash shell? user@mbook:~$ raku -e 'dd "0123456789";' "0123456789"

Re: Metamodel parent and return values ...

2020-10-30 Thread Timo Paulssen
ject. Hope that helps!   - Timo

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-10 Thread Timo Paulssen
ometric methods like sin, cos, tan, are all "numerical cool methods" so the first thing they do is coerce to Numeric, that's why "99".tan.say gives you roughly -25.1. Please check out the table near the beginning of this documentation page:     https://docs.raku.org/type/Cool hope that makes things more clear   - Timo

Re: zef: too many files in ~/.raku/short

2020-08-08 Thread Timo Paulssen
ory or something, so tracking that down further could be interesting if that is the case. HTH   - Timo On 01/08/2020 22:46, Fernando Santagata wrote: > Hello, > > I found out that on my system at a certain point zef was unable to > read the content of ~/.raku/short and because of th

Re: Raku version of "The top 10 tricks of Perl one-liners" ?!?

2020-07-22 Thread Timo Paulssen
Try it with a very filled folder, though. I would expect the majority of the time spent is setup and actually going through the lines themselves isn't very slow. On 22/07/2020 22:31, Aureliano Guedes wrote: > That is a little bit disappointing: > > $ time ls -l | perl -lane 'print "$F[7] $F[1]"'

Re: I cannot install any lib with Zef

2020-07-21 Thread Timo Paulssen
I would assume the ffi, tommath, atomic_ops, and uv linker flags come straight from moarvm's linker flags, probably because the build script of Digest::SHA256::Native uses the flags used to compile moarvm itself. If you've compiled your moarvm yourself, this is a safe bet; these libraries are

Re: junctions and parenthesis

2020-06-24 Thread Timo Paulssen
available on the object you've got, or you want a different function, you can . LMKWYT   - Timo

Re: fill in form

2020-05-13 Thread Timo Paulssen
Is this not anything like what you're after? https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.w3.org%2FTR%2F2016%2FCR-css-grid-1-20160929%2Fimages%2Fauto-placed-form.png=1=1 Kind Regards   - Timo On 12/05/2020 20:44, ToddAndMargo via perl6-users wrote: > > On 12/05/2020

Re: fill in form

2020-05-12 Thread Timo Paulssen
so it (almost) touches the end of the label, so different words ("city" vs "first name") could result in different-sized text inputs. hope that helps   - Timo On 12/05/2020 00:47, ToddAndMargo via perl6-users wrote: > Hi All, > > I want to create a fill in form i

Re: NativeCall questions

2020-05-08 Thread Timo Paulssen
to be passed as argument or received as return value in NativeCall, you will get "TheStruct *" on the C side. Not sure if that's all it takes to fix this. Feel free to write back to the list. Hope to Help   - Timo On 08/05/2020 12:44, David Santiago wrote: > Hello, > > I'm po

Re: subst :g and captures in the replacement

2020-04-19 Thread Timo Paulssen
:g)' > ( w )osd( w )gg Hope that helps   - Timo On 19/04/2020 23:53, yary wrote: > Question from today's Raku meetup. This works in a way I expect > > > 'fosdffgg'.subst(/f+/,"( "~ * ~" )", :g); > ( f )osd( ff )gg > > This one, $0 gets the single f each t

Re: OAuth2?

2020-03-23 Thread Timo Paulssen
The link was just missing a "../" at the beginning. The example code lives here:     https://github.com/tbrowder/Google-API-Client/blob/master/eg/get-calendar-data.p6 Hope that helps   - Timo On 23/03/2020 04:34, ToddAndMargo via perl6-users wrote: > On 2020-03-22 16:43, Tom

Re: stashing an array in a hash and yanking it back out

2020-03-05 Thread Timo Paulssen
l wormface blob fingfangfoom tingler]>> my %stash{'monsters'} = @monsters;> {fingfangfoom => tingler, godzilla => grendel, wormface => blob}>> my @m = %stash{'monsters'};> [(Any)]>> say @m> [(Any)]>> exit timo@schmand ~> perl6 -e 'my %stash{"mo

Re: Question about Blob and Buf

2020-02-11 Thread Timo Paulssen
side of the assignment into the existing object. This is why "my %foo = SetHash.new()" will result in a Hash. For this example, you would want "my %foo is SetHash = " instead. Hope that clears things up   - Timo

Re: Question about Blob and Buf

2020-02-11 Thread Timo Paulssen
xing strings and bufs. I'm not sure if there is a good solution for inside rakudo or the raku language. Setting an initial value for the variable is one correct way to do this, though. Hope that helps!   - Timo

Re: printf question

2020-02-10 Thread Timo Paulssen
e / :i, :global, etc) have been moved to the front of regexes. Hope that's interesting   - Timo On 10/02/2020 07:48, Paul Procacci wrote: > Named parameters must come after all positional parameters. > Your example subroutine is invalid for this reason, while the > following would be fine:

Re: NQPMu ??

2020-01-09 Thread Timo Paulssen
Yes, native integers/nums don't work in the REPL (that's any uint or int with number after it, or num32 or num64 or num or int or long etc). On 09/01/2020 19:16, ToddAndMargo via perl6-users wrote: > On 2020-01-09 10:11, ToddAndMargo via perl6-users wrote: >> Hi All, >> >> What am I doing wrong

Re: rmdir question

2019-12-03 Thread Timo Paulssen
ectory"), backtrace > => Backtrace.new) > # mkdir a ; `which perl6` -e "try { 'b'.IO.rmdir.perl.say; CATCH { > default { 'tsk tsk'.say }}}" > tsk tsk Hi Paul, thanks to your email I found and fixed an oversight in the Raku docs: it says it throws an exception, when actually it returns a Failure. Thank you!   - Timo

Re: Quoting issue in Windows

2019-11-30 Thread Timo Paulssen
ly the code. You want to compare here, not assign, i.e. use == instead of = HTH   - Timo

Re: split to walk into an HoH ?

2019-11-22 Thread Timo Paulssen
2,garbage .",   "B,2,garbage .",   "B,2,garbage ."     ]   } } Things to note are: it makes hashes, so the order isn't retained. if that's important, you could, for example, use/build a Hash that retains its key insertion order and call .categorize-list on a

Re: getting comb to return match objects

2019-11-16 Thread Timo Paulssen
n the code from my mail will retroactively become correct ;) HTH   - Timo On 16/11/2019 18:35, William Michels wrote: > Hello Timo, and thank you for taking the time to explain how "comb" > routine signatures work. I have no doubt your description is the > correct way to use comb rou

Re: getting comb to return match objects

2019-11-16 Thread Timo Paulssen
gt; say comb(/\w+/, "a;b;c", 2, True).perl; > Too many positionals passed; >> expected 2 or 3 arguments but got 4 in > block at line 1 There's no syntax here that distinguishes 2, a positional parameter, from True, also a positional parameter. >> say comb(/\w+/, "a;b;c", 2, :True).perl; > Unexpected named argument 'True' >> passed in block at file> line 1 The issue here is that :True is short for True => True, i.e. passing the value True to the named parameter called "True", easy to get confused by the error message here! > Any help appreciated, Bill. I hope the explanations make sense!   - Timo

Re: FC31 can't find my module subs

2019-11-04 Thread Timo Paulssen
:ModuleTst; ModuleTest; ModuleTst;  # missing the comma' it should look like in the first line, the comma right between :ModuleTest and :ModuleTst Thanks   - Timo On 04/11/2019 03:56, ToddAndMargo via perl6-users wrote: > On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote: >> Hi All, >&

Re: Typed Pairs

2019-09-05 Thread Timo Paulssen
You can try defining a subset type a bit like this: subset StrArrStrsPair of Pair where .key ~~ Str && .value ~~ Positional[Str]; Please be aware that the arrays have to be explicitly created with the type constant of Str for this to work. On 5 September 2019 14:34:05 CEST, Mikkel wrote:

Re: is inlinable trait missing from docs

2019-07-13 Thread Timo Paulssen
/src/Perl6/Actions.nqp#L4193 On top of that, there's MoarVM's spesh, which also does inlining. The profiler can tell you what was inlined and what wasn't, and IIRC the spesh log can give you more specific info on why an inline was not performed in a given case. HTH   - Timo On 13/07/2019 12:51, Marcel

Re: is inlinable trait missing from docs

2019-07-13 Thread Timo Paulssen
I wouldn't put "is inlinable" in the docs; it requires the user to put a QAST tree in the value, which isn't a thing an end-user would touch, IMO. In fact I'm not sure why we have a trait for that at all, since it's not used anywhere in rakudo's source. On 13/07/2019 12:33, Marcel Timmerman

Re: Odd Complex behavior

2019-06-14 Thread Timo Paulssen
that it would come up at just the right time to ruin your day :( On 14/06/2019 00:28, Elizabeth Mattijsen wrote: We could potentially give 0e0 and -0e0 the same .WHICH, which would solve the bag issue. On 13 Jun 2019, at 21:02, Timo Paulssen wrote: Unfortunately, that's what the IEEE prescribes, so

Re: Odd Complex behavior

2019-06-13 Thread Timo Paulssen
Unfortunately, that's what the IEEE prescribes, so all we can really do is: *shrug* On 13/06/2019 21:01, Sean McAfee wrote: On Thu, Jun 13, 2019 at 11:12 AM Brad Gilbert > wrote:     > (-i).reals     (-0 -1) Ah, so it's nothing particular to Complex: > bag

Re: LogP6 not working as I expect

2019-05-10 Thread Timo Paulssen
Hi Patrick, It could be that compile time is too early for the logger object to properly be set up; try to see if "my \Log" instead of "constant Log" fixes it, then we can perhaps find a better solution that still has "constant" (for example a feature request for LogP6) Kind Regards   - Timo

Re: Short term Zef fix

2019-04-30 Thread Timo Paulssen
Doesn't updating zef to the latest version fix everything up nicely?   - Timo On 30/04/2019 12:06, Simon Proctor wrote: > Until the p6c system is fixed here's a short term fix that will at > least let zef install modules from cpan. > > zef --help > This lists a c

Re: library search path ?

2019-04-29 Thread Timo Paulssen
you can use these one-liners:     perl6 -e '.say for $*REPO.repo-chain'     perl6 -e '.perl.say for $*REPO.repo-chain' On 29/04/2019 00:33, ToddAndMargo via perl6-users wrote: > Hi All, > > Could not find xxx::yyy at line zz in: >     file#/home/linuxutil/p6lib >     inst#/home/tony/.perl6 >    

Re: Something happened to the chat line

2019-04-28 Thread Timo Paulssen
I'm just about to go to bed, but you can use this link instead (i think what was there before was just a redirect anyway):     https://webchat.freenode.net/?channels=#perl6 HTH   - Timo On 29/04/2019 00:38, ToddAndMargo via perl6-users wrote: > Hi All, > > Going to > >     htt

Re: Why so slow

2019-04-28 Thread Timo Paulssen
nds in them, but i'm not exactly sure how it influences precompilation and such. On 28/04/2019 09:21, ToddAndMargo via perl6-users wrote: Hi Timo, This tell you anything? $ perl6 --stagestats GetUpdates.pl6 Stage start  :   0.000 Stage parse  :  13.150 Stage syntaxcheck:   0.000 Stage

Re: Why so slow

2019-04-28 Thread Timo Paulssen
sis. HTH   - Timo On 28/04/2019 08:41, ToddAndMargo via perl6-users wrote: > On 21/04/2019 05:58, ToddAndMargo via perl6-users wrote:>> Hi All, >> >> One liners are fast, but my own programs are very slow to start. >> >> I download >> >> https://githu

Re: Why so slow

2019-04-28 Thread Timo Paulssen
ur browser to get an interactive performance inspection tool thingie. Be aware, though, that it can become very big in the case of --profile-compile, depending on the structure of the program being compiled. Hope any of that helps   - Timo On 21/04/2019 05:58, ToddAndMargo via perl6-users wrot

Re: gtk widget?

2019-04-22 Thread Timo Paulssen
GUI together. https://glade.gnome.org/ Good Luck!   - Timo On 22/04/2019 05:44, ToddAndMargo via perl6-users wrote: > Hi All, > > I see > > https://github.com/perl6/gtk-simple/tree/master/examples > > but I have no clue what is going on. > > Is there some kind

Re: Why so slow?

2019-04-22 Thread Timo Paulssen
It's the second line: use v6; use lib 'lib';  # ← this line right here use GTK::Simple; use GTK::Simple::App;   -Timo On 22/04/2019 12:51, ToddAndMargo via perl6-users wrote: >>> On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: >>>> Hi All, >>>> >

Re: Why so slow?

2019-04-22 Thread Timo Paulssen
.") and removed the line "use lib 'lib';", it might start a lot faster when you run it the second time. Hope that helps!   - Timo On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: > Hi All, > > One liners are fast, but my own programs are very slow to start. > >

Re: perl6.org down and documentation

2019-04-21 Thread Timo Paulssen
why zef is trying to install p6doc system-wide, but you could try creating and giving your user write access to /usr/share/perl6/site/doc to see what it comes up with next … Cheers,   - Timo On 21/04/2019 10:27, mimosinnet wrote: > Dear perl6 users, > > Perl6 web [1] seems to b

Re: .payload

2019-02-28 Thread Timo Paulssen
NotifyStr\"" ); >>> } >>> >>> >>> But keep pulling the following error: >>> >>>   No such method 'payload' for invocant of type >>>   'X::TypeCheck::Assignment' in block >>>   at ./GetUpdates.pl6 line 60 >

Re: .payload

2019-02-28 Thread Timo Paulssen
rintRedErr("$Payload\n") anyway. On top of that, every Exception object implements message. Hope that helps!   - Timo On 28/02/2019 12:46, ToddAndMargo via perl6-users wrote: > Hi All, > > https://docs.perl6.org/language/exceptions#Catching_exceptions > > I am trying t

Re: Typed Arrays and for-loops

2019-02-13 Thread Timo Paulssen
You could use the @ sigil for your files variable, too. Then you can just "for @files". There's two ways to get that to work: my Str @files = "Test", "Test 2"; or my @files := Array[Str].new("Test", "Test 2"); Hope to help   - Timo On 13/02/

Re: subs and variables speed question

2019-02-11 Thread Timo Paulssen
> On 2/11/19 3:27 AM, Timo Paulssen wrote: > > WHICH doesn't give you a numerical value. just print it as it is. > > > $ p6 'sub a (Buf $b) { say $b.WHICH }; my $c = Buf.new(1,2,3); say > $c.WHICH; a($c);' > Buf|71848984 > Buf|71848984 > > If "moarvm has a

Re: subs and variables speed question

2019-02-11 Thread Timo Paulssen
Please be aware that WHERE will give you the actual memory address of an object, but moarvm has a moving garbage collector, which means that objects can change their memory location. at the moment it will only happen up to two times, i believe. you'll probably have a better result with .WHICH for

Re: filever.exe sub?

2019-02-01 Thread Timo Paulssen
that are used in the code are defined: https://source.winehq.org/source/dlls/version/version.c Sorry for not giving a super simple solution. Perhaps there's something on the net for "PE metadata parser" or "PE file parser" or whatever. Hope that gets you closer to your goal!   - Timo

Re: I need m/ help

2019-01-13 Thread Timo Paulssen
CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM On 13/01/2019 09:42, ToddAndMargo via perl6-users wrote: > On 1/12/19 3:04 PM, Timo Paulssen wrote: >> On 12/01/2019 23:40, ToddAndMargo via perl6-users wrote: >>> But this does not.  What is wrong with (<:N>**2)  ? >>> >&g

Re: I need m/ help

2019-01-12 Thread Timo Paulssen
Hi Todd, it looks like you have an accidental l in there: the third capture group has <:Nl> instead of <:N>. Changing that makes it work for me   - Timo

Re: Exactly what is type match?

2018-12-21 Thread Timo Paulssen
~= $b" does almost the same as "$a = $a ~ $b". it works for every infix operator, too: $a += 1 is probably known to many $a max= 5 will leave $a containing either $a or 5, whichever is higher $a **= 2 will leave $a with the result of $a ** 2 and so on, and so forth. Does that clear things up?   - Timo

Re: Exactly what is type match?

2018-12-21 Thread Timo Paulssen
probably wrong. Then you get errors for using uninitialized Str, which $D0 and $D1 are in both situations (since you never assign anything to it). What you need is to put a = between $D0 and ~$0 and between $D1 and ~$1 That should work. Hope that made some sense   - Timo

Re: wxWidgets nativecall

2018-11-27 Thread Timo Paulssen
r on Stack Overflow, or real-time discussions on IRC, links can be found on perl6.org I haven't actually tried the C++ stuff in NativeCall, but we can surely figure it out together :) HTH   - Timo On 21/11/2018 03:31, Perry Sebastian wrote: > Hi, > I built an odd little application using

Re: How to use sub/method 'dir'

2018-11-24 Thread Timo Paulssen
what "a/b".IO.d outputs? Maybe that can give us a clue. HTH   - Timo On 24/11/2018 22:18, Fernando Santagata wrote: > Hello, > > I think that I don't understand how the 'test' argument of 'dir' works. > I have a directory 'a', which contains a subdirectory 'b' and a

Re: sub name has unexpected interaction with s///

2018-10-23 Thread Timo Paulssen
n't defined, so it errors out at the end of compilation. I hope that makes things a bit clearer   - Timo

Re: Testing Was: Appropriate last words

2018-10-21 Thread Timo Paulssen
u there, and not some random exception like "file not found". On 21/10/2018 10:32, Richard Hainsworth wrote: > How does this answer the question about testing? > > Ok so there is code, but where do I go to find what that code is? > Where in the Rakudo repo would I start looking,

Re: Testing Was: Appropriate last words

2018-10-21 Thread Timo Paulssen
https://docs.perl6.org/language/variables#index-entry-%24%2AEXIT this should help you get to where you want to be. Someone™ can feel free to open up a ticket on the doc repository that the routine page for exit doesn't have a link to or explanation of &*EXIT. HTH   - Timo

Re: Run tests only if a module is available

2018-10-11 Thread Timo Paulssen
I'd go with run-time loading and if the module doesn't exist, just "flunk" or "skip" or what Test.pm6 offers. Here's a link that explains checking if a module is installed and loading it if it is:     https://rakudo.org/post/lexical-require-upgrade-info Hope that helps!   -

Re: Use of the --output flag

2018-10-09 Thread Timo Paulssen
--output is for the compiler's compilation stages for example: > timo@schmand ~> perl6 --output=/tmp/outputtest --target=mbc -e 'say "hi"' > timo@schmand ~> moar --dump /tmp/outputtest | head > > MoarVM dump of binary compilation unit: > >   SC_0 : B1DFAD

Re: routine declaration line question

2018-10-05 Thread Timo Paulssen
You're probably thinking of ;; in a signature. On 05/10/2018 20:02, Trey Harris wrote: > But right now we have a situation where “everything within the > signature /except for/ the return constraint can participate in multi > dispatch”, which does feel weird. But is that actually true? >

Re: bitwise or?

2018-10-05 Thread Timo Paulssen
It's important to point out that inside metaoperators ("composed operators", "combined operators", ...) the [ ] are just for bracketing things together — sometimes it's needed to disambiguate, but you can put it in anyway to make things clearer. This has nothing to do with [+] 1, 2, 3, which is a

Re: routine declaration line question

2018-10-03 Thread Timo Paulssen
t;, but I felt i should really point it out before causing too much confusion. On 04/10/2018 03:07, ToddAndMargo wrote: > Hi All, > > In another thread, Timo wrote me: > >    The "-->" part of the signature is optional. If there isn't >    one, it defaults to M

Re: What are the official names?

2018-10-02 Thread Timo Paulssen
I just saw that this was already kind of answered in the other thread, sorry about that!

Re: What are the official names?

2018-10-02 Thread Timo Paulssen
rcumfix is kind of a combination of postfix and circumfix where there is one thing that the routine goes after, and another thing that the routine goes around. That's how you get @a[1]; the [ ] from the view of @a is a postfix and from the view of 1 is a circumfix. Hence, postcircumfix. Hope that helps   - Timo

Re: need doc help with []

2018-10-02 Thread Timo Paulssen
to Mu, which is the type that everything conforms to, i.e. the sub or method that either has "--> Mu" explicitly, or has it by leaving it out, may return absolutely whatever it wants. After all, the "-->" part is a constraint, and it gets validated at compile time every time a sub or method returns. > Yours in confusion, > -T Hope that helps a little   - Timo

Re: Could this be any more obscure?

2018-09-26 Thread Timo Paulssen
he strings and numbers inside the (), which is the difference that people are trying to explain, but not finding the right words to make you understand. Can you help us by explaining how you get from "every method takes [ ]" to "i'll try it with ()"? Perhaps some place wrongly claimed that () and [] are the same? That might require a bit of re-wording in the docs, then. Hope any of that helps   - Timo

Re: Ping Larry and Friends: Need NativeCall help

2018-09-18 Thread Timo Paulssen
that helps!   - Timo

Re: need p5/p6 :: help

2018-09-14 Thread Timo Paulssen
It's important for the PrintRed sub inside PrintColors to be declared "our", otherwise it is "my" scoped, i.e. limited to the lexical extent of the module file. On 14/09/2018 12:59, Todd Chester wrote: > Hi All, > > I am in the process of converting a YUGE program I wrote in > Perl 5 to Perl 6. 

Re: I need -M help

2018-09-14 Thread Timo Paulssen
The equivalent of "use lib 'blah'" on the commandline is "-I blah", just like "-M bloop" is the equivalent of "use 'bloop'" in code. HTH   - Timo On 14/09/2018 12:52, Todd Chester wrote: > Hi All, > > With a one liner, how to I load a module

Re: .new?

2018-09-14 Thread Timo Paulssen
tion of the class by that name, which explains what it is, how you get it, and how you use it. I'll file a bug for the "new" routine page. Hope that helps!   - Timo On 14/09/2018 12:30, Todd Chester wrote: > Hi All, > > What exactly is going on with .new? > >   https://docs.

Re: how do I do this index in p6?

2018-09-11 Thread Timo Paulssen
ock at -e line 1 using ~~ instead of =:= should also be okay, or checking for definedness with either .defined or using "with" instead of "if", which is very useful especially for index and friends. HTH   - Timo

Re: Please explain this to me

2018-09-11 Thread Timo Paulssen
.new; $tc.test-method("hello"); $tc.test-method(1234); So you have the same name, but multiple candidates that have different signatures. Does that help?   - Timo

Re: Please explain this to me

2018-09-11 Thread Timo Paulssen
On 11/09/18 12:38, Curt Tilmes wrote: > > On Tue, Sep 11, 2018 at 6:27 AM ToddAndMargo > wrote: > > method ($a: @b, %c) {};       # first argument is the invocant > > > I might say rather that $a is a parameter for the invocant.  The @b > parameter holds all the

Re: Please explain this to me

2018-09-11 Thread Timo Paulssen
On 11/09/18 12:18, JJ Merelo wrote: > > > El mar., 11 sept. 2018 a las 12:15, Timo Paulssen ( <mailto:t...@wakelift.de>>) escribió: > > The colon at the end of "Str:D:" signifies that it's a type > constraint on what you call the method on. For ex

Re: "contains" beginning, end?

2018-09-07 Thread Timo Paulssen
It does not, but there are methods .starts-with and .ends-with that probably do what you need. HTH   - Timo On 08/09/18 02:00, ToddAndMargo wrote: > Hi All, > > Does "contains" have options for "at the start of" and > "at the end" of matches? > > > Many thanks, > -T

Re: A grammar to provide substitution

2018-08-29 Thread Timo Paulssen
I should point out that the trans method has a mode that lets you pass placeholders and substitutions and it will Do The Right Thing regarding overlaps and order and everything. On 29/08/18 16:21, Timo Paulssen wrote: > There's a problem with your code, if any of the substitutions conta

Re: A grammar to provide substitution

2018-08-29 Thread Timo Paulssen
There's a problem with your code, if any of the substitutions contains something that looks like the placeholder thing, and if it comes later in the iteration of the hash keys (which is randomized now) it will substitute again. This is very likely not what you want, though. HTH   - Timo On 28/08

Re: How do I test my substitutions?

2018-08-14 Thread Timo Paulssen
You're putting your starting string in a variable, $x, but aren't telling the s/// operator specifically what to operate on, so it defaults to $_, which is still at its default value. On 14/08/18 13:08, ToddAndMargo wrote: > Hi All, > > The Perl 5 guys have it pounded into my head that I >

Re: I need the rules for running modules from the command line

2018-08-14 Thread Timo Paulssen
Please be aware that passing a folder with many files in it as the -I path will cause a tremendous slowdown when loading modules, since it goes through the whole file hierarchy starting at that path. If /home/linuxutil is actually a typical home folder with dotfiles and documents and what have

Re: I need the rules for running modules from the command line

2018-08-14 Thread Timo Paulssen
rintColors -e 'PrintBlue( "Blue\n");' should do what you meant to do. HTH   - Timo On 14/08/18 12:01, ToddAndMargo wrote: > Hi All, > > > I presume this is failing as the current directory is not > in the "lib" path: > > > $ perl6 -MPrintColors 'Pri

Re: Special token names, or my mistake

2018-08-12 Thread Timo Paulssen
The grammar will never by itself try to call a subroutine, it only looks for methods in the action object. However, there is a "sum" method that An-Action inherits from Any. You can find it here: https://github.com/rakudo/rakudo/blob/master/src/core/Any.pm6#L440 It's probably a good idea to put

Re: string to integer?

2018-08-07 Thread Timo Paulssen
oops, i only now saw the thread you had about it. never mind, then! On 07/08/18 15:31, Timo Paulssen wrote: > dd is a function that outputs a value, and dd returns Nil. You're > assigning the result of dd to $x, which resets the variable to its > default value, which is the (Str) you

Re: string to integer?

2018-08-07 Thread Timo Paulssen
dd is a function that outputs a value, and dd returns Nil. You're assigning the result of dd to $x, which resets the variable to its default value, which is the (Str) you see, i.e. an undefined String. Just throw out the dd, you don't need it to stringify things, only the ~ or + prefix is

Re: need regex help

2018-08-03 Thread Timo Paulssen
any number of times, but at least once, and the $ at the end, together with the ^ at the start, ensures that every character in the string has to match, not just any character. Hope that makes sense   - Timo On 03/08/18 20:04, ToddAndMargo wrote: > On 08/02/2018 05:18 AM, Timo Paulssen wrote: &g

Re: need regex help

2018-08-02 Thread Timo Paulssen
Is this what you want? perl6 -e 'say "12345" ~~ /^<+alnum -alpha>+$/' 「12345」 perl6 -e 'say "123a45" ~~ /^<+alnum -alpha>+$/' Nil HTH   - Timo

Re: parsing in different modes

2018-08-01 Thread Timo Paulssen
Hello Theo, have you considered placing the code for the actions directly inside the grammar's tokens and rules instead? You can just { make 123 } right in the middle and it'll have the same effect as doing that in an action method, but you'll be able to put code after it, too. HTH   - Timo

Re: EVAL?

2018-06-14 Thread Timo Paulssen
ubs, even from the core, so subs like "die" and "exit" are reachable, but it's less dangerous than accepting any random code. For one, it will only work with subs that don't take arguments. HTH   - Timo

Re: mixin syntax: does vs but

2018-06-12 Thread Timo Paulssen
You can override WHAT with a method, you just have to use a syntax that's not literally .WHAT, like this:     class Test { method WHAT() { say "i'm here" } }; Test."WHAT"();     # → i'm here

Re: need second pair of eyes

2018-06-12 Thread Timo Paulssen
quot;wine-patched/archive/staging-/") && $line.ends-with(".tar.gz") { }     if $line ~~ m{ "wine-patched/archive/staging-/" .* ".tar.gz" } { } What do you think?   - Timo

Re: need sort help

2018-06-09 Thread Timo Paulssen
The last part of the puzzle is how sort will sort lists of lists (because it has now replaced every string with a list of the parts we've supplied); By default, sort uses the earliest entry in the list that is different, so it's very much like lexicographic sort. Does that explain everything?   - Timo

Re: need sort help

2018-06-08 Thread Timo Paulssen
your list @x has only a single item, because you're slurping the whole file contents into it. replacing slurp with lines should do the trick. On 09/06/18 07:23, ToddAndMargo wrote: > On 06/08/2018 09:51 PM, Timo Paulssen wrote: >> That's unnecessarily long and complicated, here's how y

Re: need sort help

2018-06-08 Thread Timo Paulssen
If you want to make it robust in the case of fields being different length, like having entries with the day as "5" instead of "05", you can put a >>.Int after the .comb(/\d+/) and that'll give you proper numeric sorting for all fields regardless of width. On 09/06/18

Re: need sort help

2018-06-08 Thread Timo Paulssen
that was mentioned in another mail. why it wasn't actually shown, i have no clue :) Hope that helps   - Timo

Re: Need match character help

2018-05-18 Thread Timo Paulssen
On 18/05/18 13:30, The Sidhekin wrote: > On Thu, May 17, 2018 at 12:51 PM, Timo Paulssen <t...@wakelift.de > <mailto:t...@wakelift.de>> wrote: > > character classes are fundamentally the wrong thing for "phrases", > since they describe only a charac

Re: Need match character help

2018-05-17 Thread Timo Paulssen
ably leads to an infinite loop (the regex engine tries to make you proud by matching it as often as it possibly can. which if the assertion is true, is infinitely often. it is very diligent, but it does not really think much about what it does). Hope that helps   - Timo On 17/05/18 12:51, Tim

Re: Need match character help

2018-05-16 Thread Timo Paulssen
On 16/05/18 00:10, ToddAndMargo wrote: > What would the syntax be for d..z, but not g or m? You can subtract [gm] from [d..z] like this:     say "c" ~~ /<[d..z]-[gm]>/;     say "d" ~~ /<[d..z]-[gm]>/;     say "f" ~~ /<[d..z]-[gm]>/;     say "g" ~~ /<[d..z]-[gm]>/;

Re: number of letters question

2018-05-16 Thread Timo Paulssen
That is absolutely correct, thanks!

Re: number of letters question

2018-05-15 Thread Timo Paulssen
I'd suggest combing for the regex instead of combing and then grepping with the regex: say + "abcrd-12.3.4".comb(//); though from the problem question it sounds a lot more like what todd wants is     my $input = "abcrd-12.3.4";     my $letters = $input.comb(/<[a..z]>/);     my $numbers =

Re: Need match character help

2018-05-15 Thread Timo Paulssen
On 15/05/18 14:03, ToddAndMargo wrote: > On 05/15/2018 04:49 AM, ToddAndMargo wrote: >> Hi All, >> >> This should be a "no".  What am I doing wrong? >> >> $ perl6 -e 'my $x="rd"; if $x~~/<[rc]+[a]+[b]+[.]>/ {say >> "yes"}else{say "no"}' >> yes >> >> >> Many thanks, >> -T > > And how do I turn this

  1   2   3   >