list comprehension

2019-02-10 Thread mimosinnet
Hi all, I wonder what would be the Perl notation for 'set-builders', as exposed in this wikipedia article: https://en.wikipedia.org/wiki/Set-builder_notation#Parallels_in_programming_languages This is the Python notation: Example 1: {l for l in L} Example 2: {(k, x) for k in K for x in X

Re: list comprehension

2019-02-10 Thread Brad Gilbert
In {l for l in L} The reason it is in `{}` is to create a Set from iterating over `L`. > In Python, the set-builder's braces are replaced with square brackets, > parentheses, or curly braces, giving list, generator, and set objects, > respectively. So in Python: [ l for l in L ]

Re: subs and variables speed question

2019-02-10 Thread ToddAndMargo via perl6-users
On 2/9/19 2:28 PM, ToddAndMargo via perl6-users wrote: On 2/9/19 1:56 PM, ToddAndMargo via perl6-users wrote: Hi All, sub xxx( Buf $YugeBuf is ro ) {some midricle} Is $YugeBuf (up to 100 MB) a copy of just the structure? I don't want the time time of a copy. Many thanks, -T Without all

Re: subs and variables speed question

2019-02-10 Thread ToddAndMargo via perl6-users
On 2/9/19 2:28 PM, ToddAndMargo via perl6-users wrote: On 2/9/19 1:56 PM, ToddAndMargo via perl6-users wrote: Hi All, sub xxx( Buf $YugeBuf is ro ) {some midricle} Is $YugeBuf (up to 100 MB) a copy of just the structure? I don't want the time time of a copy. Many thanks, -T Without all

Re: subs and variables speed question

2019-02-10 Thread ToddAndMargo via perl6-users
WHERE is pretty sweet command! $ p6 'sub a (Buf $b) { say $b.WHERE.base(0x10) }; my $c = Buf.new(1,2,3); say $c.WHERE.base(0x10); a($c);' 7F385D41334C 7F385D41334C