Re: Why use dd to convert a string to an integer?

2018-08-07 Thread ToddAndMargo
On Tue, 7 Aug 2018, 08:16 ToddAndMargo, <mailto:toddandma...@zoho.com>> wrote: Hi All, I am confused. This line will convert a string into an integer, but will print out and extra line with "(Int)" on it: $ p6 'my Str $x = "5"; my I

Re: string to integer?

2018-08-07 Thread ToddAndMargo
On 08/06/2018 01:58 PM, ToddAndMargo wrote: Hi All, How do I assign a string that looks like an integer into an interger? $str = "601"  -- > $int = 601 Many thanks, -T Follow up. My notes on String to Integer and Integer to String: Perl 6: convert String to Integer and Inte

Re: Why use dd to convert a string to an integer?

2018-08-07 Thread ToddAndMargo
On 08/07/2018 02:24 AM, Simon Proctor wrote: Moarvm is the Perl6 Virtual Machine that is one of the targets Rakudo compiles to (the JVM is another). Basically at the moment when people talk about Perl6 that mostly mean Perl6 compiled with Rakudo running on MoarVM. (As I understand it). the

Re: string to integer?

2018-08-07 Thread ToddAndMargo
On 08/06/2018 04:58 PM, ToddAndMargo wrote: Hi All, How do I assign a string that looks like an integer into an interger? $str = "601"  -- > $int = 601 Many thanks, -T On 08/06/2018 02:00 PM, Benji wrote: > my $i = "601".Int > > Thank you!

Re: Force integers in an array?

2018-08-07 Thread ToddAndMargo
On 08/06/2018 04:38 PM, ToddAndMargo wrote: Hi All, Is there a way to force all the members of an array to be integers and to error out is a non-integer is written to one of its cells? Many thanks, -T On 08/06/2018 01:40 PM, Benji wrote: > my Int @a = 1, 2, 3; > > @a.push: '

Re: start up delay?

2018-08-07 Thread ToddAndMargo
On Wed, 1 Aug 2018 at 19:15, ToddAndMargo wrote: Hi All, Is it just me or does Perl 6 take about three times as long to start up as Perl 5? I do have a very fast machine and it takes about seven see for some of my Perl 6 stuff to get past the ruminating phase and start running. Any

Re: start up delay?

2018-08-07 Thread ToddAndMargo
On 08/07/2018 01:39 PM, ToddAndMargo wrote: On Wed, 1 Aug 2018 at 19:15, ToddAndMargo wrote: Hi All, Is it just me or does Perl 6 take about three times as long to start up as Perl 5?  I do have a very fast machine and it takes about seven see for some of my Perl 6 stuff to get past the

Re: string to integer?

2018-08-07 Thread ToddAndMargo
On 08/07/2018 10:50 AM, Brandon Allbery wrote: "dd" is a built in Data::Dumper, in Perl 5 terms, not a conversion routine. I wanted it to show clearly the types, but it's not as clear as it might have been because I was dumping expressions instead of variables (where it would have shown name an

is there a limit to a s/ ?

2018-08-10 Thread ToddAndMargo
Hi All, I was thinking of doing a $ p6 'my $x="a\nb\nc\nd\n"; say "$x\n"; $x ~~ s/ .*?c /c/; say "$x";' a b c d c d Except the real deal will be across 1460 lines. Am I pushing the limits? There are other ways of doing what I want. Many thanks, -T

Re: is there a limit to a s/ ?

2018-08-10 Thread ToddAndMargo
On Fri, Aug 10, 2018 at 8:16 PM, ToddAndMargo wrote: Hi All, I was thinking of doing a $ p6 'my $x="a\nb\nc\nd\n"; say "$x\n"; $x ~~ s/ .*?c /c/; say "$x";' a b c d c d Except the real deal will be across 1460 lines. Am I pushing the limits? T

Re: is there a limit to a s/ ?

2018-08-10 Thread ToddAndMargo
On 08/10/2018 08:56 PM, Simon Proctor wrote: If all you are wanting to do is print the lines after a certain point in the file the ff operator might be what you're looking for. See my response to Yary to see what I am after. Thank you!

Re: is there a limit to a s/ ?

2018-08-10 Thread ToddAndMargo
On 08/10/2018 09:22 PM, Simon Proctor wrote: It's 5am and I should be asleep but I think this is a perfect case for ff then. Check out the docs for it. Hi Simon, I am not following. :'( https://docs.perl6.org/routine/ff -T

Re: is there a limit to a s/ ?

2018-08-10 Thread ToddAndMargo
On 08/10/2018 08:59 PM, ToddAndMargo wrote: On Fri, Aug 10, 2018 at 8:16 PM, ToddAndMargo wrote: Hi All, I was thinking of doing a $ p6 'my $x="a\nb\nc\nd\n"; say "$x\n"; $x ~~ s/ .*?c /c/; say "$x";' a b c d c d Except the real deal will be acr

I need the rules for running modules from the command line

2018-08-14 Thread ToddAndMargo
Hi All, I presume this is failing as the current directory is not in the "lib" path: $ perl6 -MPrintColors 'PrintBlue( "Blue\n" );' Could not open PrintBlue( "Blue" ). Failed to stat file: no such file or directory This does work, but what a lot of extra work: $ perl6 -e 'use lib "/home/lin

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

2018-08-14 Thread ToddAndMargo
> 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 'PrintBlue( "Blue\n" );' >>

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

2018-08-14 Thread ToddAndMargo
On 08/14/2018 03:01 AM, ToddAndMargo wrote: Hi All, I presume this is failing as the current directory is not in the "lib" path: $ perl6 -MPrintColors 'PrintBlue( "Blue\n" );' Could not open PrintBlue( "Blue" ). Failed to stat file: no such file or di

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

2018-08-14 Thread ToddAndMargo
On 08/14/2018 03:20 AM, JJ Merelo wrote: Since I haven't done this for a long time, let me remind you the possibility of posting, if you will, your questions _also_ in StackOverflow. You'll (possibly) get more answers (or just different ones), and will help spread the word about Perl 6 (which l

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

2018-08-14 Thread ToddAndMargo
On 08/14/2018 03:48 AM, Timo Paulssen wrote: 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

How do I test my substitutions?

2018-08-14 Thread ToddAndMargo
Hi All, The Perl 5 guys have it pounded into my head that I always had to check my substitutions to see if they worked if not working would crash the program. So in Perl 6 I have: $ p6 'my $x="abc"; if s/b/z/ {say "sub worked"}else{say "sub failed"}; say "$x";' Use of uninitialized value of

Re: How do I test my substitutions?

2018-08-14 Thread ToddAndMargo
> On 14/08/18 13:08, ToddAndMargo wrote: >> Hi All, >> >> The Perl 5 guys have it pounded into my head that I >> always had to check my substitutions to see if they >> worked if not working would crash the program. >> >> So in Perl 6 I have: >&g

Re: How do I test my substitutions?

2018-08-14 Thread ToddAndMargo
On 08/14/2018 08:29 AM, yary wrote: Or, store the string in $_, and take advantage of less to type- perl6 -e '$_="abc"; say so /z/; say so /b/; s/c/defg/ ?? .say !! say "Failed!"' -y Thank you! Well I can see it working, but what does "so" "??" ".say" "!!" do? My actual c

Re: How do I test my substitutions?

2018-08-14 Thread ToddAndMargo
On 08/14/2018 06:33 PM, yary wrote: "so" coerces to True or False. "say /c/" would output the match object "say so /c/" says True. Depends on what you want to see. " $x ?? $y !! $z" is a shortcut - "if $x use value of $y else use value of $z" and ought to be used for the final value. You may

date conversions?

2018-09-07 Thread ToddAndMargo
Hi All, I want to convert "2018 Jun 7" into 2018.06.07". I know I can do this myself, but is there a utility already written for this? https://docs.perl6.org/routine/Date does not seem to enlighten me. Many thanks, -T -- ~~ Computers are like air conditione

RFE: contains documentation

2018-09-07 Thread ToddAndMargo
Dear Perl6, Would you please consider updating https://docs.perl6.org/routine/contains to explain what the second parameters means? say "Hello, World".contains(',', 10); # OUTPUT: «False␤» and include how to do case insensitive matches. Many thanks, -T

case insensitive "contains"?

2018-09-07 Thread ToddAndMargo
Hi All, How do I use "contains" without regard to case? $ p6 'if "2018 Jul 7".contains( "jul", 3 ) {say "Yes";}' Many thanks, -T

Re: case insensitive "contains"?

2018-09-07 Thread ToddAndMargo
On 09/07/2018 03:49 PM, ToddAndMargo wrote: Hi All, How do I use "contains" without regard to case? $ p6 'if "2018 Jul 7".contains( "jul", 3 ) {say "Yes";}' Many thanks, -T The chat line helped me figure it out: $ p6 'if "201

"contains" beginning, end?

2018-09-07 Thread ToddAndMargo
Hi All, Does "contains" have options for "at the start of" and "at the end" of matches? Many thanks, -T

Re: RFE: contains documentation

2018-09-07 Thread ToddAndMargo
On 09/07/2018 05:08 PM, Curt Tilmes wrote: On Fri, Sep 7, 2018 at 7:59 PM ToddAndMargo <mailto:toddandma...@zoho.com>> wrote: >  From the page you linked to "Coerces the invocant and first argument to > Str <https://docs.perl6.org/type/Str>, and sea

Re: date conversions?

2018-09-07 Thread ToddAndMargo
On 09/07/2018 05:10 PM, Vadim Belman wrote: Anyway, often googling with 'perl6 ' might provide one with even more information than expected! 😀 The only pain-in-the-*** I find with Perl 6 is that Googling it gives you hordes of Perl 5 hits. I am just going to do this: my %Month = ( "Jan"=

Re: "contains" beginning, end?

2018-09-07 Thread ToddAndMargo
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 On 09/07/2018 05:01 PM, Timo Paulssen wrote: > It does not, but there are methods .starts-with and .ends-with

Re: RFE: contains documentation

2018-09-07 Thread ToddAndMargo
On 09/07/2018 06:25 PM, Curt Tilmes wrote: The documentation isn't a tutorial, but is still improving every day. For the function it is documenting, it had better be a tutorial. Otherwise, why would anyone other than a developer seek its input? Seriously. If you can't figure it out from the

Re: RFE: contains documentation

2018-09-09 Thread ToddAndMargo
On 09/07/2018 09:18 PM, Vadim Belman wrote: You're pretty much mistaken here. No documentation can replace a good book. No documentation is capable of providing enough in-depth understanding of The Concept. Hi Vadim, You are, of course, correct. And we are also talking at cross purposes. Y

Re: RFE: contains documentation

2018-09-09 Thread ToddAndMargo
On 09/09/2018 11:16 AM, JJ Merelo wrote: Here it is: https://github.com/perl6/doc/issues/2303 just in case you want to add something more. Cheers El dom., 9 sept. 2018 a las 20:11, JJ Merelo (<mailto:jjmer...@gmail.com>>) escribió: El sáb., 8 sept. 2018 a las 4:39, Tod

Re: RFE: contains documentation

2018-09-09 Thread ToddAndMargo
On 09/09/2018 11:16 AM, JJ Merelo wrote: Here it is: https://github.com/perl6/doc/issues/2303 just in case you want to add something more. I added my suggested wording

Re: case insensitive "contains"?

2018-09-09 Thread ToddAndMargo
On 09/08/2018 12:23 PM, Laurent Rosenfeld via perl6-users wrote: Using the fc method is certainly a good way to do case insensitive string comparisons, but you may at this point also use a regex with the :i (ignore case) adverb. > if "2018 xJul 7" ~~ /:i jul/ {say "Yes";} Yes Hi Laurent,

Re: RFE: contains documentation

2018-09-09 Thread ToddAndMargo
On 09/09/2018 03:12 PM, Peter Scott wrote: On Sep 9, 2018, at 2:50 PM, ToddAndMargo wrote: My point is that the dictionary should teach you how to use the word in question. I do believe I am correct in my assertion too. Let's be clear that reference documentation is not the same

Re: RFE: contains documentation

2018-09-09 Thread ToddAndMargo
On 09/09/2018 06:21 PM, Peter Scott wrote: "Learning Perl 6" by brian d foy https://www.amazon.com/Learning-Perl-Keeping-Impossible-Within-ebook/dp/B07GT9KPP1/ref=sr_1_1_twi_kin_2 $30 U$D for the Kindle edition

Re: RFE: contains documentation

2018-09-10 Thread ToddAndMargo
On 10/09/18 10:00, ToddAndMargo wrote: On 09/09/2018 06:21 PM, Peter Scott wrote: "Learning Perl 6" by brian d foy https://www.amazon.com/Learning-Perl-Keeping-Impossible-Within-ebook/dp/B07GT9KPP1/ref=sr_1_1_twi_kin_2 $30 U$D for the Kindle edition On 09/10/2018 12:07 A

Re: case insensitive "contains"?

2018-09-10 Thread ToddAndMargo
e a difference if the adverb is somewhere else within the pattern. For example, this would fail: say "Yes" if "2018 xJul 7" ~~ m:i/j :i ul/; because the ignore case adverb would apply only on the 'ul' characters of the pattern, but not on the 'j&#x

Re: case insensitive "contains"?

2018-09-10 Thread ToddAndMargo
On 09/10/2018 08:36 AM, Laurent Rosenfeld via perl6-users wrote: Yes, copy and paste error on the last code snippet. say "Yes" if "2018 xJul 7" ~~ m/j :i ul/; Cheers, Laurent. Now that is down right cleaver! I can change my mind as I go. Thank you!

Re: case insensitive "contains"?

2018-09-10 Thread ToddAndMargo
On 09/10/2018 08:15 AM, Ralph Mellor wrote: Hi Todd, What are the rules for what goes inside and what goes outside? Also, do y have a link to what the various ":x" commands are that I can use? See https://docs.perl6.org/language/regexes#Adverbs The first section explains the two

Perl 6 Design specification?

2018-09-11 Thread ToddAndMargo
Hi All, Is the Perl 6 design specification (the one the developers use) out there somewhere on the web that I could look at? Many thanks, -T

how do I do this index in p6?

2018-09-11 Thread ToddAndMargo
Hi All, How do I clean this up for use with Perl 6? $ perl -E 'say index("abc", "z") == -1 ? "False" : "True"' False Many thanks, -T -- Yesterday it worked. Today it is not working. Windows is like that.

Re: Perl 6 Design specification?

2018-09-11 Thread ToddAndMargo
rt of the only language compiler existing for the time being. Hope this helps JJ El mar., 11 sept. 2018 a las 10:04, ToddAndMargo (<mailto:toddandma...@zoho.com>>) escribió: Hi All, Is the Perl 6 design specification (the one the developers use) out there somewhere on

Please explain this to me

2018-09-11 Thread ToddAndMargo
multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos) Okay, I know that Str is a string Cool is an object that can be treated as both a string and a number $needle is the second optional parameter What is "D"? $needle is optional, why is it not stated as "$needle?" How is bot

Re: Perl 6 Design specification?

2018-09-11 Thread ToddAndMargo
On 09/11/2018 02:50 AM, JJ Merelo wrote: Hi JJ, Yes it helps a bunch.  Thank you! Follow up: where would I find the design specifications for the functions? There's a search engine in design.perl.org , Got a ton of hits. But no joy. they should all

Re: how do I do this index in p6?

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:11 AM, Simon Proctor wrote: Why not use contains though? Because I am torturing myself. I am trying to learn what all this does. I love contains, start-with, and ends with. I need to learn this other stuff too.

Re: how do I do this index in p6?

2018-09-11 Thread ToddAndMargo
On 09/11/2018 02:57 AM, JJ Merelo wrote: perl6 -e 'say "abc".index("z") =:= Nil  ?? "False" !! "True"' -e runs the script from the CL https://github.com/rakudo/rakudo/wiki/Running-rakudo-from-the-command-line "abc" is on front (but it could be in the same way) index return Nil if it does not f

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
, but I'd say that's an oversight that should be fixed. I hope that helps!   - Timo On 11/09/18 12:09, ToddAndMargo wrote: multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos) Okay, I know that    Str is a string    Cool is an object that can be treated as both a string and

Re: Please explain this to me

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

Functions and subroutines?

2018-09-11 Thread ToddAndMargo
Hi All, I use subs like ducks use water. It is about time I learned what to properly call them. I come from Modula2 and Pascal (as well as bash), "functions" return a value outside the declared parameters and "(sub)routines" only can modify values through the declarations parameters. Sort of l

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:09 AM, ToddAndMargo wrote: multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos) What the heck (not my exact word) is "multi method"? What is wrong with calling it a "function"?

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:30 AM, JJ Merelo wrote: Also, "is no help whatsoever" is no help whatsoever. Saying what part of it is not clear enough, or could be explained better, is. Well now, > method ($a: @b, %c) {}; # first argument is the invocant 1) why is it a "method" and not a "function

A comparison between P5 docs and p6 docs

2018-09-11 Thread ToddAndMargo
Hi All, Not to beat a dead horse, but Perl 6's docs are miserably hard to understand. Here is a comparison of Perl 5's perldocs and Perl 6's docs: Perl 5: $ perldoc -f index index STR,SUBSTR,POSITION index STR,SUBSTR The index function searches for one string within another,

Re: A comparison between P5 docs and p6 docs

2018-09-11 Thread ToddAndMargo
On 09/11/2018 04:53 AM, Tom Browder wrote: Todd, some free advice: 1. DOCUMENTATION The docs are a volunteer effort. You can help by contributing changes and submitting issues. Hi Tom, I have started contributing to this effort as well. One of the big hurdles is that those maintaining the d

Re: A comparison between P5 docs and p6 docs

2018-09-11 Thread ToddAndMargo
On 09/11/2018 08:52 AM, Tom Browder wrote: On Tue, Sep 11, 2018 at 10:39 AM Parrot Raiser <1parr...@gmail.com> wrote: One of the paradoxes of documentation, and the teaching of many abstract topics, is that those with the most in-depth knowledge of the ... I agree with you for the most part.

Re: A comparison between P5 docs and p6 docs

2018-09-11 Thread ToddAndMargo
On 09/11/2018 08:17 AM, Laurent Rosenfeld via perl6-users wrote: Hi Todd, I fully agree with Tom B.'s message that you should really set out to read a Perl 6 book. Many of the things you asked are covered in most of the available books. And the available books are easier than the official doc

Re: Functions and subroutines?

2018-09-11 Thread ToddAndMargo
On 09/11/2018 10:35 AM, Larry Wall wrote: On Tue, Sep 11, 2018 at 03:47:46AM -0700, ToddAndMargo wrote: : In Perl, what is the proper terminology? We're not picky, since Perl has never made a hard and fast distinction between routines that return values and routines that don't. Yo

Re: case insensitive "contains"?

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:53 PM, Trey Harris wrote: And my response to his response that also was unintentionally off-list. I got it. I will probably be writing it down later today in my documents. My failing was thinking rx was some kind of command I had not seen before. As soon as you showed me it

Re: how do I do this index in p6?

2018-09-11 Thread ToddAndMargo
On 09/11/2018 08:11 AM, yary wrote: "Nil... it's a constant, so you have to use =:= to check for equality." Constants? I thought we did not have constants! Am I mixing Perl 5 with Perl 6, again?

!

2018-09-11 Thread ToddAndMargo
On 09/11/2018 10:14 AM, Larry Wall wrote: On Tue, Sep 11, 2018 at 02:42:20AM -0700, ToddAndMargo wrote: : How do I clean this up for use with Perl 6? : : $ perl -E 'say index("abc", "z") == -1 ? "False" : "True"' : False I'm a litt

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:09 AM, ToddAndMargo wrote: multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos) Okay, I know that    Str is a string    Cool is an object that can be treated as both a string and a number    $needle is the second optional parameter What is "D"?

Re: how do I do this index in p6?

2018-09-11 Thread ToddAndMargo
context. But constant @a = <1 2 3>; works as expected. I could leave it as a homework for you to find out why! 😜 A tip which you wouldn't find in the documentation: '=' in array context does element-by-element assign to the left hand array. 11 вер. 2018 р. о 20:17 ToddAn

Nil ?

2018-09-11 Thread ToddAndMargo
What am, I missing? $ p6 'my $x; if $x =:= Nil { say "Nil" } else { say "Not Nil"; };' Not Nil $ p6 'my $x = Nil; if $x =:= Nil { say "Nil" } else { say "Not Nil"; };' Not Nil

Re: Nil ?

2018-09-13 Thread ToddAndMargo
On 09/12/2018 10:09 AM, Larry Wall wrote: Basically, ignore any advice to treat Nil as a normal value, because it really is intended to represent the *absence* of a value as much as possible. It's a bit like the way solid-state electronics treats "holes" as if they were real particles, and gets

Re: how do I do this index in p6?

2018-09-13 Thread ToddAndMargo
On 09/12/2018 07:14 AM, Parrot Raiser wrote: Built-in constants: pi, tau, e, i Do you know where I can find the list ? https://duckduckgo.com/?q=perl6+built+in+constants&t=ffab&ia=web is no help

Re: how do I do this index in p6?

2018-09-13 Thread ToddAndMargo
On 09/13/2018 12:10 PM, Parrot Raiser wrote: https://docs.perl6.org/language/terms#Identifier_terms On 9/13/18, ToddAndMargo wrote: On 09/12/2018 07:14 AM, Parrot Raiser wrote: Built-in constants: pi, tau, e, i Do you know where I can find the list ? https://duckduckgo.com/?q=perl6

Re: Nil ?

2018-09-13 Thread ToddAndMargo
On 09/13/2018 12:29 PM, Elizabeth Mattijsen wrote: On 13 Sep 2018, at 20:47, ToddAndMargo wrote: On 09/12/2018 10:09 AM, Larry Wall wrote: Basically, ignore any advice to treat Nil as a normal value, because it really is intended to represent the *absence* of a value as much as possible. It&#

->

2018-09-14 Thread ToddAndMargo
Hi All, I use `->` all the time. What is its official name? for @x.kv -> $I, $Line {...} Many thanks, -T

Re: ->

2018-09-14 Thread ToddAndMargo
On 09/14/2018 01:00 PM, Larry Wall wrote: On Fri, Sep 14, 2018 at 09:30:51PM +0200, Elizabeth Mattijsen wrote: : The combination of “->” and “{ }” is sometimes referred to as a “pointy block”, or even maybe just a “pointy”. Note that "pointy" is specifically referring to the syntax here, not th

Re: ->

2018-09-14 Thread ToddAndMargo
On 09/14/2018 12:27 PM, ToddAndMargo wrote: Hi All, I use `->` all the time.  What is its official name? for @x.kv -> $I, $Line {...} Many thanks, -T Me thinks I am pushing "pointy" here! #!/usr/bin/env perl6 sub Stooges() { return ( "Larry", "Curley&q

Re: ->

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 4:16 PM ToddAndMargo <mailto:toddandma...@zoho.com>> wrote: On 09/14/2018 12:27 PM, ToddAndMargo wrote: > Hi All, > > I use `->` all the time. What is its official name? > > for @x.kv -> $I, $Line {...} &

Ping Larry and Friends: Need NativeCall help

2018-09-14 Thread ToddAndMargo
Hi Larry and Friends, Fedora 28 `NativeCall` is a total mystery to me. I asked the guys on they "C" newsgroup how they did it and they only got crabby with me. Sometimes an example is work a 1000 words. Would you mind throwing together an example of how to use NativeCall to talk to XGetWindowA

Re: ->

2018-09-14 Thread ToddAndMargo
On 09/14/2018 01:09 PM, Mike Stok wrote: On Sep 14, 2018, at 4:03 PM, ToddAndMargo wrote: On 09/14/2018 01:00 PM, Larry Wall wrote: "-> is how we spell λ in Perl 6" Larry Hysterical! Thank you! I would like to think https://kwangyulseo.com/2015/06/23/the-origin-

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 09:26 AM, Brad Gilbert wrote: You can read https://en.wikipedia.org/wiki/Option_type for more information Tell me if you find any of the Perl 6 section confusing. https://en.wikipedia.org/wiki/Option_type#Perl_6 Hi Brad, I had to read to top over very slowly. Part of the issue

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 04:31 AM, Simon Proctor wrote: Just look at Curt's explanation. I found it last night. I rather admire his technical writing ability. He made the complex look simple. And that is a talent.

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 02:55 PM, ToddAndMargo wrote: In Perl, variables are structures.  There is a bunch of house keeping involved.  The "my" declaration triggers this house keeping including where it is and all the rules to access it.  The variable is pre-salted" (null) very much so.

Re: ->

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 5:10 PM Parrot Raiser <1parr...@gmail.com > wrote: Obviously, discussions about "->" will be easier if it has a name. How about "lance", or, if you want to be less martial, "poker'? On 09/14/2018 02:11 PM, Brandon Allbery wrote: And t

tip: that annoying character at the end

2018-09-14 Thread ToddAndMargo
Hi All, A tip to share. I work a lot with downloaded web pages. I cut out things like revision numbers and download locations. One of the things that use to drive me a bit nuts was that web pages can come with all kind of weird line terminators. I'd wind up with a link location that bombed bec

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 03:03 PM, ToddAndMargo wrote: On 09/14/2018 02:55 PM, ToddAndMargo wrote: In Perl, variables are structures.  There is a bunch of house keeping involved.  The "my" declaration triggers this house keeping including where it is and all the rules to access it.  The varia

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 03:10 PM, Brandon Allbery wrote: On Fri, Sep 14, 2018 at 5:56 PM ToddAndMargo <mailto:toddandma...@zoho.com>> wrote:       'To opt into a non-nullable version of a type add the :D       "smiley" to it." This is confusing.  And I don&#x

method vs multi method

2018-09-14 Thread ToddAndMargo
Hi All, In the following: https://docs.perl6.org/routine/kv multi method kv(Any:U: -->List) multi method kv(Any:D: -->List) Does the "multi" mean ther are moe than one way to use the method, as in see the two instances above? Or something else? Also, it there was only one way to use

Can methods have multiple inputs?

2018-09-14 Thread ToddAndMargo
Hi All, Can a method be given multiple inputs? ( $a, $b ).foo and how would the docs write it? method foo(Any:D Any:D: -->Bool) Is there a comma or a space between the two "any"'s? Many thanks, -T

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On 09/14/2018 12:49 PM, Larry Wall wrote: I would like to see a citation of this use of the word "lexiconical". In the first place, the word "lexiconical" has not been used in perl5-porters in living memory, and if had been used there, it is unlikely to have meant "figured out on the fly". Hi L

Re: Can methods have multiple inputs?

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 6:47 PM ToddAndMargo <mailto:toddandma...@zoho.com>> wrote: Hi All, Can a method be given multiple inputs? ( $a, $b ).foo and how would the docs write it? method foo(Any:D Any:D: -->Bool) Is there a comma or a space

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On 09/14/2018 12:49 PM, Larry Wall wrote: On Fri, Sep 14, 2018 at 04:15:02AM -0700, Todd Chester wrote: : Also, did you answer my question about "::" and did it : just go over my head? The implication was that "::" didn't change, but the default package scoping of p5 that you're relying on is no

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
What is this all about? $ p6 'my $x="abc"; my $y="def"; say "$x::$y";' ===SORRY!=== Error while compiling -e Malformed lookup of ::$y; please use ::('$y'), ::{'$y'}, or ::<$y> at -e:1 --> my $x="abc"; my $y="def"; say "$x⏏::$y"; $ p6 'my $x="abc"; my $y="def"; say "$x\::$y";' abc::def $ p6

Re: .new?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 03:39 AM, Timo Paulssen wrote: Telemetry::Sampler isn't a routine, it's a class. You can follow the link labelled "from Telemetry::Sampler" to get to the documentation 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

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 7:32 PM ToddAndMargo <mailto:toddandma...@zoho.com>> wrote: What is this all about? $ p6 'my $x="abc"; my $y="def"; say "$x::$y";' ===SORRY!=== Error while compiling -e Malformed lookup of ::$y; ple

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On 09/14/2018 04:37 PM, Brandon Allbery wrote: "{$x}::{$y}" Most of my programming before Perl 5 was bash. I did a lot of "${x}abc" to keep the variables from being confused with each other. I carried the practice over to perl 6 with "{$x}abc" but the developers over on the chat line told m

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On 09/14/2018 05:33 PM, Brad Gilbert wrote: On Fri, Sep 14, 2018 at 7:10 PM ToddAndMargo wrote: On 09/14/2018 04:37 PM, Brandon Allbery wrote: "{$x}::{$y}" Most of my programming before Perl 5 was bash. I did a lot of "${x}abc" to keep the variables from being conf

Re: tip: that annoying character at the end

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 5:22 PM ToddAndMargo wrote: Hi All, A tip to share. I work a lot with downloaded web pages. I cut out things like revision numbers and download locations. One of the things that use to drive me a bit nuts was that web pages can come with all kind of weird line

Re: method vs multi method

2018-09-14 Thread ToddAndMargo
On 09/14/2018 04:33 PM, Ralph Mellor wrote:      multi method kv ... Use of `multi` means there *may* be more than one *declaration* using the same declared routine name (`kv` in this case). There usually *will* be more than one. (Otherwise, why was it declared `multi`?) The normal way

Re: Please explain this to me

2018-09-14 Thread ToddAndMargo
On 09/11/2018 10:41 AM, Brandon Allbery wrote: I'd like to point out that Todd is from Perl 5, which doesn't distinguish between subs and methods because its built-in OO is a minimalist hack. An introduction to true objects might be in order. I never used a method in p5. When I found them in

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:16 PM, Brad Gilbert wrote: The author greatly appreciates the time spent on writing this critique. (I'm the author) Responses written inline On Fri, Sep 14, 2018 at 4:55 PM ToddAndMargo wrote: On 09/14/2018 09:26 AM, Brad Gilbert wrote: You can read

Re: tip: that annoying character at the end

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:34 PM, Brad Gilbert wrote: On Fri, Sep 14, 2018 at 7:49 PM ToddAndMargo wrote: On Fri, Sep 14, 2018 at 5:22 PM ToddAndMargo wrote: Hi All, A tip to share. I work a lot with downloaded web pages. I cut out things like revision numbers and download locations. One of the

Re: Please explain this to me

2018-09-14 Thread ToddAndMargo
Okay, see if I got it right, finally: multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos --> Bool) "multi method" This means there are multiple ways to address this, as in multi method contains(Str:D: Cool:D $needle --> Bool) multi method contains(Str:D: Str:D

Re: tip: that annoying character at the end

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:34 PM, Brad Gilbert wrote: $x ~~ s/ <:Cc>+ $ //; What exactly is <:Cc> again?

Re: Can methods have multiple inputs?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:48 PM, Brad Gilbert wrote: On Fri, Sep 14, 2018 at 6:03 PM ToddAndMargo wrote: On Fri, Sep 14, 2018 at 6:47 PM ToddAndMargo mailto:toddandma...@zoho.com>> wrote: Hi All, Can a method be given multiple inputs? ( $a, $b ).foo and how wou

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:52 PM, Curt Tilmes wrote: On Fri, Sep 14, 2018 at 10:42 PM ToddAndMargo <mailto:toddandma...@zoho.com>> wrote: When I said "yet", I presumed the a variable can be redefined at will: $ p6 'my $x; say $x.perl;        

<    4   5   6   7   8   9   10   11   12   13   >