Re: Exactly what is type match?

2018-12-21 Thread Timo Paulssen
On 21/12/2018 20:38, ToddAndMargo via perl6-users wrote: > $ p6 'my $x="11.2."; my Str $D0; my Str $D1; $x~~m{ (<:N>+) [.] (\d+) > }; $D0 ~$0; $D1 ~ $1;  print "$D0 $D1\n";' > WARNINGS for -e: > Useless use of "~" in expression "$D1 ~ $1" in sink context (line 1) > Useless use of "~" in expressio

Re: Exactly what is type match?

2018-12-21 Thread Timo Paulssen
> Like this? > > $ p6 'my $x="11.2."; my Str $D0; my Str $D1; $x~~m{ (<:N>+) > [.] > (\d+)}; $D0 ~= $0; $D1 ~= $1; print "$D0 $D1\n";' > > 11 2 > There's an important difference between "$D1 ~= $0" and "$D1 = ~$0". They only do the same thing if $D0 (and $D1) are empty at that point; if they hav

Re: I need hash inside a hash help

2019-01-11 Thread Timo Paulssen
Hi Todd, the error you're getting comes from a closing quotation mark missing after "Larry You will also need to give perl6 some hint that you want the list of pairs to actually become a hash. To do that, I would recommend just putting a % in front of the () The working code looks like this: p

Re: I need m/ help

2019-01-12 Thread Timo Paulssen
On 12/01/2019 23:40, ToddAndMargo via perl6-users wrote: > But this does not.  What is wrong with (<:N>**2)  ? > > $ perl6 -e 'my Str $Date=DateTime.now.Str; $Date~~m/ (<:N>**4) "-" > (<:N>**2) "-" (<:Nl>**2) "T" .* /; print "$Date\n\t$0  $1  $2\n"' > Use of Nil in string context >   in block at -

Re: I need m/ help

2019-01-13 Thread Timo Paulssen
VE U VARIANT FORM 74859: 𒑫 CUNEIFORM NUMERIC SIGN SIX U VARIANT FORM 74860: 𒑬 CUNEIFORM NUMERIC SIGN SEVEN U VARIANT FORM 74861: 𒑭 CUNEIFORM NUMERIC SIGN EIGHT U VARIANT FORM 74862: 𒑮 CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM On 13/01/2019 09:42, ToddAndMargo via perl6-users wrote: > On 1/12/19 3

Re: [perl #133791] perl 6 parser bugging out on a comment thinking it is a real var

2019-01-26 Thread Timo Paulssen
I believe the problem comes from `"{"` which actually starts an interpolated code block containing a string immediately. That's also why it doesn't complain about the "else" being in an odd place; it's also inside the string! So here's an equivalent piece of code that shows what's wrong: if reque

Re: filever.exe sub?

2019-02-01 Thread Timo Paulssen
On 01/02/2019 01:33, Bruce Gray wrote: > To call those Windows APIs in Perl 6, you would use NativeCall. > Don't forget that Todd wanted to use this on non-windows with not-wine. NativeCall on linux won't run windows code all by itself. That said, wine is still a good source for info on how windo

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: subs and variables speed question

2019-02-11 Thread Timo Paulssen
WHICH doesn't give you a numerical value. just print it as it is. On 11/02/2019 12:16, ToddAndMargo via perl6-users wrote: > On 2/11/19 2:52 AM, Timo Paulssen wrote: >> Please be aware that WHERE will give you the actual memory address of an >> object, but moarvm has a movi

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 &quo

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/2019 13:29, Mikkel wrote: > Hello. (recurring noob-qu

Re: .payload

2019-02-28 Thread Timo Paulssen
As you can see from the routine page for "payload":     https://docs.perl6.org/routine/payload it only exists on X::AdHoc, which if you follow the link "from X::AdHoc" explains:     X::AdHoc is the type into which objects are wrapped if they are thrown as exceptions, but don't inherit from Excep

Re: .payload

2019-02-28 Thread Timo Paulssen
rap \" \"$NotifyStr\"" ); >>> } >>> >>> >>> But keep pulling the following error: >>> >>>   No such method 'payload' for invocant of type >>>   'X::TypeCheck::Assignment' in block >>&g

Re: perl6.org down and documentation

2019-04-21 Thread Timo Paulssen
Hi mimosinnet, we have a fallback live on http://docs.perl6.wakelift.de/ for the docs and http://perl6.wakelift.de/ for the main website. There is an outage somewhere near the server that hosts all our sites. We'll be able to get physical access and fix whatever's wrong on tuesday. I'm not sure w

Re: Why so slow?

2019-04-22 Thread Timo Paulssen
It's quite possible that when you start that program, you're first waiting for GTK::Simple to be precompiled; the "use lib 'lib'" can interfere with the storage of precompilation results. If you have installed GTK::Simple (for example by going to its folder and running "zef install .") and removed

Re: Why so slow?

2019-04-22 Thread Timo Paulssen
gt;>> >>>> One liners are fast, but my own programs are very slow to start. >>>> >>>> I download >>>> >>>> https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 >>>> >>>> To check it out and it also

Re: gtk widget?

2019-04-22 Thread Timo Paulssen
Please check out Marcel Timmermann's GTK::Glade module. Here's the readme: https://github.com/MARTIMM/gtk-glade Sadly, modules.perl6.org is currently not available, however, you can download the distribution here: https://www.cpan.org/authors/id/M/MA/MARTIMM/Perl6/gtk-glade-0.8.3.tar.gz or you

Re: Why so slow

2019-04-27 Thread Timo Paulssen
You don't happen to have a PERL6LIB or -I pointed at a folder with loads of stuff in it? If that is the case, having a single "use" statement will cause rakudo to iterate through all files and subfolders, which can take a long time if you've got, for example, your home directory in that list (b

Re: Why so slow

2019-04-28 Thread Timo Paulssen
; https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 >> >> To check it out and it also takes ten second to start. >> >> What gives? >> >> Many thanks, >> -T On 4/27/19 11:14 PM, Timo Paulssen wrote: You don't happen to have a PERL6LIB o

Re: Why so slow

2019-04-28 Thread Timo Paulssen
t;> >>> https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 >>> >>> >>> To check it out and it also takes ten second to start. >> >>> What gives? >>> >>> Many thanks, -T > > >On 4/27/19 11:14 PM, Timo Paulssen

Re: Why so slow

2019-04-28 Thread Timo Paulssen
tage ast    :   0.000 Stage optimize   :   0.351 Stage mast   :   1.133 Stage mbc    :   0.019 Stage moar   :   0.000 GetUpdates.pl6  <-- my program starts here Mozilla Mirror Debug is OFF The "Stage parse : 13.150" is eating me alive! -T On 4/28/19

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 > >     https://docs.perl6.org

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: 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 config file mine is : > > CONFIGURAT

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: 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: Odd Complex behavior

2019-06-14 Thread Timo Paulssen
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 prescribe

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 wrote:

Re: is inlinable trait missing from docs

2019-07-13 Thread Timo Paulssen
o On 13/07/2019 12:51, Marcel Timmerman wrote: > On 7/13/19 12:37 PM, Timo Paulssen wrote: >> 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&#

Re: Teaching Rakudo the tricks of Perl 5's regex optimiser

2019-08-13 Thread Timo Paulssen
>     use v6; >     'abcd' ~~ / . <.before( /c/ )> .  / # "bc" >     'abcd' ~~ / . <.before   c   > .  / # "bc" # (exactly identical) > > A person could change the code in the `before` method to have it do > something different At least at the moment, that's not 100% accurate (only by virtue of

Re: Teaching Rakudo the tricks of Perl 5's regex optimiser

2019-08-13 Thread Timo Paulssen
Here's some stuff that anybody who wants to work on regex optimization in perl6 will want to know: You can get a print-out of rakudo's internal AST that is generated for the regex by passing --target=ast or --target=optimize to the perl6 commandline. I recommend grep -C5 Regex to skip some of the

Passing on Fates [was: Re: Teaching Rakudo the tricks of Perl 5's regex optimiser]

2019-08-13 Thread Timo Paulssen
On 13/08/2019 16:32, Brad Gilbert wrote: > Perhaps the biggest one may be the one about passing around “fates”. > (I barely understand the basics of this.) The optimization opportunity Brad is refering to here is relevant mostly to grammars with deeply nested multi-tokens: Longest-Token-Matchin

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: >Hell

Re: FC31 can't find my module subs

2019-11-04 Thread Timo Paulssen
Todd, can you please double-check if putting a comma in between the :import-tags in the "use" statement makes a difference? Like this: # perl6 -I./p6lib -e 'use ModuleTest :ModuleTest, :ModuleTst; ModuleTest; ModuleTst; # correct' # perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst; Modul

Re: getting comb to return match objects

2019-11-16 Thread Timo Paulssen
Hi Bill, In your repl examples you're actually passing the True or False as a positional parameter, which makes it go into the slot for $limit, not the slot for :$match. In order to pass true or false for the "match" named parameter you have different syntactical options:   comb(/\w/, "a;b;c", m

Re: getting comb to return match objects

2019-11-16 Thread Timo Paulssen
7;match' passed > in block at -e line 1 > mbook:~ homedir$ > > As for what's going on, I'm wondering if there might be an issue with > "comb" signatures in general. There exists both a '(Str) routine comb' > and a '(Cool) routine comb&#x

Re: split to walk into an HoH ?

2019-11-22 Thread Timo Paulssen
Hi Marc, here's a one-liner based on the classify method, which you may find to be an interesting jumping-off-point, or centerpiece: perl6 -e 'use JSON::Fast; my %foo = lines()>>.trim-leading.classify(*.split(",").head(2)); say to-json %foo'     A,1,garbage .     A,2,garbage .     A,2,gar

Re: Quoting issue in Windows

2019-11-30 Thread Timo Paulssen
On 30/11/2019 09:05, ToddAndMargo via perl6-users wrote: > One of the weirdest was > > for @Result.kv -> $I, $Line { >    if $I % 2 = 0 > > being told I could not change an immutable object. Here you're trying to assign 0 to the result of $I % 2, if that's actually exactly the code. You want to

Re: rmdir question

2019-12-03 Thread Timo Paulssen
On 03/12/2019 04:46, Paul Procacci wrote: > On success it return a Bool::True. > On failure it throws an exception. > It doesn't crash the program. > If you are interested in handling the exception, add logic to handle it. > > Examples: > --- > # mkdir a ; `which perl6` -e "

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 he

Re: printf question

2020-02-10 Thread Timo Paulssen
Hi Paul and Todd, just a little extra info: the limitation for nameds to come after positionals is only for declarations of signatures. Usage of subs/methods as well as capture literals (which you don't use often, i imagine, so feel free to disregard) allow you to mix nameds and positionals freel

Re: Question about Blob and Buf

2020-02-11 Thread Timo Paulssen
On 11/02/2020 10:56, David Santiago wrote: > Hi! > > Can someone explain me why this doesn't work: > > my Blob $read; > $read ~= $socket.read(1024); > > Dies with error: > > X::Buf::AsStr: Cannot use a Buf as a string, but you called the Stringy > method on it > > This also doesn't work: > > my Bu

Re: Question about Blob and Buf

2020-02-11 Thread Timo Paulssen
On 11/02/2020 14:14, David Santiago wrote: > Awesome explanation! Thank you! > > BTW, >> my Blob $read = Buf.new; > Is it creating either a Blob or a Buf? > > Regards, > David Santiago Hi David, "my Blob $read" will define the variable $read to 1) only accept things that typecheck against Blob,

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

2020-03-05 Thread Timo Paulssen
Hi William, The line that has the important difference is where you put a `my` in front of `%stash{'monsters'} = @monsters`. Probably a copy-paste error or something like that. >> my %stash> {}>> my @monsters = <> fingfangfoom>> tingler>>> [godzilla grendel wormface blob fingfangfoom tingler]>>

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 Browder wrote: >> O

Re: subst :g and captures in the replacement

2020-04-19 Thread Timo Paulssen
Hi Yary, in the first example you've got a WhateverCode, but in the second one you're actually just passing a string to subst, i.e. you're evaluating $0 before subst is even called. Check this as well: > raku -e '"whoa" ~~ /(.)/; say \'fosdffgg\'.subst(/(f+)/,"( $0 )", :g)' > ( w )osd( w )gg Ho

Re: NativeCall questions

2020-05-08 Thread Timo Paulssen
Hi David, the first thing that catches my eye is that your struct and the class have the members switched around, so you're already almost guaranteed to read a bogus pointer when trying to get the data. Also, please note that returning structs directly, or passing structs directly, as arguments i

Re: fill in form

2020-05-12 Thread Timo Paulssen
Hi Todd, normally I'd expect you want to create a grid with labels on the left and text inputs on the right. the examples/ folder in the GTK::Simple distribution (or the source on github) has an example of the Grid class, which is very powerful. The grid is possibly more complicated than you nee

Re: fill in form

2020-05-13 Thread Timo Paulssen
t; On 12/05/2020 00:47, ToddAndMargo via perl6-users wrote: > >> Hi All, > >> > >> I want to create a fill in form in Windows: city, > >> state, etc., you fill in the data. > >> > >> Is there some library out there for that? > >> > &

Re: junctions and parenthesis

2020-06-24 Thread Timo Paulssen
On 22/06/2020 20:12, Joseph Brenner wrote: > > Speculating wildly: could there be a need for a different type of > function with different precedence? I would suggest calling .any on the list, that gives you just the tight preference you want; even if there were no .any method available on the obje

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 guara

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: zef: too many files in ~/.raku/short

2020-08-08 Thread Timo Paulssen
Hi Fernando, do you happen to have the exact error message? The simplest search through the zef source didn't find anything related, so perhaps it was actually "too many open files" caused by a too-low limit on open file descriptors? `ulimit -a` on my system gives me `Maximum number of open file

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

2020-10-10 Thread Timo Paulssen
On 10/10/2020 23:21, William Michels via perl6-users wrote: > So I guess the first question I have is whether the 'auto-joining' of > array elements is specc'ed or not. > > What you seem to be saying is that when calling a function on an > array, the first response is for Raku to call something sim

Re: Metamodel parent and return values ...

2020-10-30 Thread Timo Paulssen
On 30/10/2020 07:58, Paul Procacci wrote: Here is what I have ... trimmed. # use JSON::Pretty; use Staticish; unit class MyClass is Static; method client(::?CLASS:D: Str:D $service! --> MyClass) {         my %data := from-json %?R

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" user@mbook:

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, Todd

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: Performance of matrix arithmetic in Raku

2021-02-08 Thread Timo Paulssen
Hi, raku doesn't have matrix operations built into the language, so you're probably refering to modules out of the ecosystem? Math::Matrix seems to have everything implemented in pure raku, which you should not expect to outperform pure python without some optimization work. Math::libgsl::

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 Chantreux wrote: hello rakoons, I

Re: [perl #130763] [BUG][LTA] Weird error in anonymous class value in Hash

2017-02-12 Thread Timo Paulssen
This is caused by the way we differentiate between anonymous blocks and hashes; we just parse it as a block first, and if at the end it turns out it should be a hash instead, we change it around. I suppose at that point the class will already have been defined and its stuff will point at the "not a

Re: [perl #130793] explicit .resume on Broken promise exception "not resumable", implicit fine

2017-02-16 Thread Timo Paulssen
You might be confusing resuming an exception with leaving the CATCH block with the exception marked as "handled". When you leave the block after having matched the exception successfully with a default or when block (or whatever else), the exception is marked as handled, which means it won't get r

Re: sub for die?

2017-02-18 Thread Timo Paulssen
It is usually considered The Right Thing to output error messages to stderr instead of stdout; you can use "note" to output to stderr (and it'll also put a newline at the end for you, which print doesn't do).

Re: reverse of .lines?

2017-02-18 Thread Timo Paulssen
On 18/02/17 06:09, ToddAndMargo wrote: > On 02/17/2017 07:44 PM, yary wrote: >> Oh, then chain join on the end: >> >> my $StringReversedLines = >> $StringFullOfLineFeeds.lines.reverse.join("\n") >> >> or >> >> my $StringReversedLines = >> $StringFullOfLineFeeds.split("\n",:v).reverse.join >> **//

Re: cifs control

2017-02-18 Thread Timo Paulssen
On 18/02/17 06:04, ToddAndMargo wrote: > Hi All, > > Sorry for the 1000 questions today, but I have anb entire > week to think them up. And I have another one. > > In Windows, I am noticing that Cobian Backup and Windows > Explorer (not Internet Explorer) can tool around CIFS > (Windows) shares ba

Re: intercept STDERR

2017-02-18 Thread Timo Paulssen
Normally it's enough to override $*ERR for this purpose. I suggest using IO::MiddleMan to do that, or maybe IO::Capture::Simple. HTH - Timo

Re: net::SMTP in rpm land?

2017-02-18 Thread Timo Paulssen
Almost no linux distros package perl6 modules for their native package manager yet. The only distro i know of that has any kind of perl6 module packaging at all is archlinux: https://aur.archlinux.org/packages/?O=0&K=perl6 You need to use panda or zef to install perl6 modules until something

Re: need {} help

2017-02-18 Thread Timo Paulssen
/ doesn't have a meaning in regex, but it's not an alpha character, so if you want to "match literally" it "must be quoted" as the first error message tells you. On top of that, balanced characters like () and {} aren't allowed for the s/// form (only for the assignment form which looks like s{ fo

Re: sub for die?

2017-02-19 Thread Timo Paulssen
Hi, On 19/02/17 04:48, ToddAndMargo wrote: >"die" is not all that useful, as it always exits > with a "1". With "exit", you can set the exit code. that's leaving out a whole lot of context, though. "die" is a quick way to throw an exception. If an exception reaches the outermost part of you

Re: print to STDERR problem

2017-02-19 Thread Timo Paulssen
Can you suggest how to improve the warnings about its obsolescence? Right now it says: > > This file is part of the Perl 6 Archive > > Note: these documents may be out of date. Do *not* use as reference! > > To see what is currently happening visit http://www.perl6.org/ > And then a bit low

Re: print to STDERR problem

2017-02-19 Thread Timo Paulssen
Oh, another question: please tell us how you reached that site? I expect you did a google search or something; can you tell us what search terms you've used to get there? We should obviously improve the docs so that they get found instead of the archive …

Re: print to STDERR problem

2017-02-19 Thread Timo Paulssen
On 02/19/2017 11:15 PM, ToddAndMargo wrote: > On 02/19/2017 07:15 AM, Timo Paulssen wrote: >> Oh, another question: >> >> please tell us how you reached that site? I expect you did a google >> search or something; can you tell us what search terms you've used to &

Re: [perl #130845] Some things that are less than 5 aren't

2017-02-23 Thread Timo Paulssen
This is because the implementation of infix:(Rat:D, Rat:D) is kind of bad: multi sub infix:(Rational:D \a, Rational:D \b) is default { a.Num cmp b.Num } We'll have to do a proper comparison of rats, rather than convert to Num which can give wrong results like this. On 23/02/17 04

Re: [perl #130845] Some things that are less than 5 aren't

2017-02-23 Thread Timo Paulssen
Actually, I was mistaken. The code i pointed at there already works for this very case. observe: 131338 timotimo │ m: say 4.999 cmp 5.0 131338 +camelia │ rakudo-moar 1811b8: OUTPUT: «Less␤» The real problem is this implementation of &infix:: multi sub infix:(Real:D \a,

Re: I am having trouble installing panda

2017-02-24 Thread Timo Paulssen
Hey Todd, > Net::SMTP (doesn't support SSL, but others do) > $ zef --force install > Net::SMTP Are you sure that's the case? i definitely see SSL-related verbiage in Net::SMTP's Readme. The simple interface offers an "ssl" and a "starttls" flag in its "new" method, and the raw interface has "swi

Re: [perl #130886] multi subs with inconsistent where clauses don't work correctly

2017-02-28 Thread Timo Paulssen
I'd say this is NOTABUG via the DIHWIDT category. If your where clause has side-effects, you're bound to get in trouble. If you're fine with relying on internals, you can just put True into the one-out-of-ten three times at the end and the program will run through to 100. test 90 90

Re: I need the rules for qx with a pipe inside

2017-03-06 Thread Timo Paulssen
This is because of how xclip works. It keeps running until you kill it, or until the number of pastes has been reached that you specify with -loops. You will want to use Proc::Async or run with an :in parameter instead of shelling into a redirect with echo, here's why: timo@schmand ~> cat Bad

Re: $*DISTRO

2017-03-06 Thread Timo Paulssen
Doesn't seem to be, but there's $*DISTRO.is-win, which is usually enough (i.e. you have to do one dumb thing on windows and another sane thing on literally anything else)

Re: I need the rules for qx with a pipe inside

2017-03-06 Thread Timo Paulssen
> Is there a way to send and "end of file" marker to terminate the pipe? That is exactly what the call to .close does.

Re: program/script question

2017-03-07 Thread Timo Paulssen
On 07/03/17 10:54, Brandon Allbery wrote:> Perl compiles to an internal AST, as does Python --- but there are > "compilers" for both, at various levels [...] more precisely, python code compiles down to bytecode rather than sticking around at an AST level.

Re: Design question re: function parameters

2017-03-07 Thread Timo Paulssen
On 07/03/17 17:59, Sean McAfee wrote: > […] If I want to freely accept both numbers and strings in the manner > of > Perl 5, it looks like I must type all of my function arguments as > Cool, or omit the types altogether. […] Don't forget you can use a coercive type in parameter lists: sub po

Re: I need the rules for qx with a pipe inside

2017-03-07 Thread Timo Paulssen
> For example: > > sub WriteSecondaryClipboard ( $Str ) { # >my $Cmd = "echo \"$Str\" | xclip -selection clipboard"; > shell $Cmd; > } > > > problem solved. Please don't forget that if $Str can be modified by a user or outside process somehow, you've opened the door to remote code execution

Re: Variables in modules

2017-03-09 Thread Timo Paulssen
"my" variables are lexically scoped to the curly braces that contain them. That means that your $IAm is limited exactly to that init block. Also, =~ isn't in perl6. You can put "my $IAm" outside that block and assign to it inside the block, though. HTH - Timo

Re: issues with

2017-03-09 Thread Timo Paulssen
Hey, X11::Xlib::Raw is buggy. It has to have all modules it uses internally inside its "provides" section in the META6.json, otherwise "use" will not find them. I'll open a ticket with the module author. HTH - Timo On 08/03/17 22:08, ToddAndMargo wrote: > Hi All, > > What is wrong with this?

Re: How to defined reversed word in a perl6 grammar ?

2017-03-09 Thread Timo Paulssen
Hi, Wouldn't it be enough to use something that backtracks? As you might know, "token" is "regex + ratcheting" and "rule" is "token + sigspace". HTH - Timo

Re: Your thoughts on Padre?

2017-03-09 Thread Timo Paulssen
On 09/03/17 08:29, ToddAndMargo wrote: > https://atom.io/ > > as it is specifically written for Perl 6 Not quite. It's a general-purpose code editor that you could say comes from the javascript corner of programming. However, we do have active devs improving the perl6-related plugins for atom

Re: debugging modules

2017-03-10 Thread Timo Paulssen
Heyo, the way the debugger works is by changing the compiler to generate code that communicates with the debugger at every step. That means that if you want a module to be debuggable, it has to be compiled by the debugger's compiler, too. There's apparently currently no way to just force a full

Re: Fwd: Re: Variables in modules

2017-03-10 Thread Timo Paulssen
I don't quite understand what's wrong with just my $TheValue = $?FILE.subst(/.* "/"/, "" :g); near the top of your module?

Re: my command line notes:

2017-03-15 Thread Timo Paulssen
On 14/03/17 20:58, ToddAndMargo wrote: > > #!/usr/bin/perl6 > > if not @*ARGS.elems > 0 { say "command line is empty"; exit 0; } > > say "\@\*ARGS has " ~ @*ARGS.elems ~ " elements"; > say " \@\*ARGS = <" ~ @*ARGS ~ ">"; > say " \@\*ARGS.perl = <" ~ @*ARGS.perl ~ ">\n"; > > say "say

Re: [perl #130965] [LTA] `but role { ... }` interacts strangely with outer lexicals, and doesn't warn about it

2017-03-16 Thread Timo Paulssen
On 09/03/17 20:38, jn...@jnthn.net via RT wrote: > On Thu, 09 Mar 2017 07:39:39 -0800, elizabeth wrote: >> But I’ll settle for a warning / exceptione :-) > I think these options are worth consideration. I can't think of a false > positive off hand. class Test { method tester { say "testest" } }

Re: debugging modules

2017-03-16 Thread Timo Paulssen
On 03/16/2017 04:44 PM, Theo van den Heuvel wrote: > Earlier I tried using rakudobrew, before I learnt that that was > actually discouraged, > despite comments in doc/perlintro.pdf. I think I made a full clean-up. perl6intro.com, which is where the pdf is generated from, has been updated to no lon

Re: Question for the developers on splice

2017-03-21 Thread Timo Paulssen
Shifting from the front will just move the "beginning" pointer one slot forwards, and popping will decrease the "element count" number. I'm not sure if splice with an empty "insertion" list that happens to be at the end will also just reduce the number of elements or if it does a bit of unnecessar

Re: Can this OR be shortened?

2017-03-24 Thread Timo Paulssen
I seem to recall you asked about performance recently the regex engine has a significant overhead. Your regex is equivalent to $Terminal.contains('xterm' | 'linux') though of course if you only test this once at the beginning of the program, you can ignore that.

Re: Can this OR be shortened?

2017-03-25 Thread Timo Paulssen
On 25/03/17 06:15, ToddAndMargo wrote: >> while || tries the left side first, then the right side. >> Basically use | in regexes unless you need ||. > > Would this be the logical AND equivalent? > > if $Terminal ~~ /xterm && linux/ {} > > Thank you! > > -T > There is no &&, but there is &. th

Re: Can this OR be shortened?

2017-03-25 Thread Timo Paulssen
On 25/03/17 12:53, Tom Browder wrote: > On Fri, Mar 24, 2017 at 10:36 PM, Timo Paulssen wrote: >> I seem to recall you asked about performance recently >> >> the regex engine has a significant overhead. > ... > > Isn't that somewhat mitigated by defining

Re: Failed to open file .. too many open files

2017-03-25 Thread Timo Paulssen
i highly suggest you slurp instead of open + slurp-rest, because that will automatically close the file for you, too. other than that, you can pass :close to the slurp-rest method and it'll also close the file. if you're not closing the files you're opening, you'll be relying on the garbage colle

Re: Failed to open file .. too many open files

2017-03-26 Thread Timo Paulssen
Please use "$.source_dir/authors.txt".IO.lines instead of open + lines. with the former you're expressing you really only want to read all the lines out of the file and be done with it. when you open and then call .lines, you're saying nothing about what you want to do with the file handle afterwar

Re: "not" question

2017-03-27 Thread Timo Paulssen
!"789" is just False. On 27/03/17 18:53, ToddAndMargo wrote: > Hi All, > > What am I doing wrong in my "AND not 789"? > > $ perl6 -e 'my $x="abc123def456"; > my $y="123"; if $x.contains( $y & "abc" & ! "789" ) > {say "Yes"} else {say "no"};' > > no > > -T >

Re: regex and performance question

2017-03-27 Thread Timo Paulssen
Yeah, junctions are super useful, but not very fast. compare these two pieces of code: so "hello how are you today?".contains("hello" & "u t") for ^1_000_000 and my $target = "hello how are you today?"; so $target.contains("hello") && $target.contains("u t") for ^1_000_000 On my machi

Re: "not" question

2017-03-27 Thread Timo Paulssen
" }' Yes This uses a "none" junction, which takes part in the whole junction evaluation process, as opposed to the prefix: which just negates a value straight-up and doesn't know it's being used inside a junction. HTH - Timo On 27/03/17 19:11, Timo Paulssen wrote: >

  1   2   3   4   >