pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: irc.pugscode.org/ Set by Tene on 29 July 2008. |
|||
00:00
jferrero joined,
sri_work_ joined
00:03
Limbic_Region left
00:05
ruoso joined
|
|||
ruoso | Hello! | 00:06 | |
lambdabot | ruoso: You have 1 new message. '/msg lambdabot @messages' to read it. | ||
00:07
sri_work left
|
|||
ruoso | @tell pmurias, memory leaks can eventually cause bugs... it's better to hunt them down... | 00:10 | |
lambdabot | Consider it noted. | ||
00:13
jferrero left
00:51
kanru joined
00:53
eternaleye left
01:13
baest left,
baest joined
|
|||
ruoso found out that there is a problem when a mold frame is executed with a slime frame as back... | 01:21 | ||
01:21
eternaleye joined
|
|||
ruoso | there is some bug in mold that leaves an additional reference to the back frame... | 01:22 | |
01:23
wknight8111 left
01:25
Ehtyar joined
01:27
xiaoyafeng_ joined
01:29
xiaoyafeng__ joined
01:41
wknight8111_ left
01:42
wknight8111 joined
01:46
xiaoyafeng left
01:48
xiaoyafeng_ left
01:51
[particle] joined
01:59
alester left,
sri_work_ left
02:02
wknight8111 left
02:03
[particle]1 left
02:06
xiaoyafeng joined
02:13
xiaoyafeng_ joined
02:14
xiaoyafeng__ left
02:29
xiaoyafeng_ left
|
|||
Khisanth | o_O :ratchet is the only flag without a short form? | 02:29 | |
02:31
xiaoyafeng left
02:33
a-jing joined,
a-jing left
03:02
elmex_ joined
03:11
alanhaggai joined
03:15
drbean joined
03:16
elmex left,
elmex_ is now known as elmex
03:24
eternaleye left
03:28
alester joined
04:10
eternaleye joined
04:18
[particle]1 joined
04:21
ashizawa joined
04:25
[particle] left
04:55
justatheory joined
05:12
PZt left
05:18
PZt joined
05:21
Auzon left,
Auzon joined
05:22
Psyche^ joined
05:24
REPLeffect left
05:36
yves joined
05:37
Patterner left,
Psyche^ is now known as Patterner
|
|||
moritz_ | Khisanth: it's implied in rule { } and in token { } | 05:47 | |
06:07
masak joined
06:10
dduncan left
06:22
ashizawa left,
AzureStone joined,
ashizawa joined
06:26
ashizawa_ joined
06:30
ashizaw__ joined
06:31
ashizaw__ left,
ashizawa left
06:34
ashizawa joined
06:36
ashizawa_ left
|
|||
rakudo_svn | r30947 | moritz++ | [rakudo] make .rindex work on non-strings, closes RT #58644 | 06:42 | |
r30947 | moritz++ | Patch courtesy by Vasily Chekalkin, bacek++ | |||
pugs_svn | r22197 | moritz++ | [t/spec] unfudged passing rindex patch for rakudo, added test for index() on | 06:43 | |
r22197 | moritz++ | non-Str's | |||
06:44
alester left,
jferrero joined
06:45
justatheory left
06:46
Bierwagen joined
|
|||
Bierwagen | hi | 06:46 | |
can anybody help me? | |||
moritz_ | if you want Perl 6 help, probably yes | 06:47 | |
06:48
jferrero left
|
|||
masak | Bierwagen: don't ask to ask, just ask. | 06:48 | |
Bierwagen | where are the differences between perl and perl 6 | 06:49 | |
moritz_ | there are quite many, I tried to make some points here: perlgeek.de/blog-en/perl-5-to-6/ | ||
lambdabot | Title: blog | Perlgeek.de Blog :: Category Perl-5-to-6 | ||
masak | Bierwagen: svn.pugscode.org/pugs/docs/Perl6/Pe...rences.pod | ||
Bierwagen | IĀ“m a noob at perl | 06:51 | |
masak | gotta start somewhere :) | ||
Bierwagen | so can anybody say me, whats wrong | ||
rafb.net/p/8nrPqg25.html | |||
lambdabot | Title: Nopaste - No description | ||
moritz_ | Bierwagen: that's perl 5 code | ||
masak | Bierwagen: better to ask at #perl | 06:52 | |
Bierwagen | oh | ||
moritz_ | or #perlhelp or so | ||
Bierwagen | ok | ||
thanks | |||
bye | |||
masak | Bierwagen: good luck! | ||
06:52
Bierwagen left,
sri_work joined
|
|||
moritz_ was never in #perl himself, but heard some stories... scary | 06:52 | ||
masak | yup. | 06:53 | |
moritz_ | maybe I should have recommended #perlde on irc.perl.org, considering his nick... | ||
too late | |||
masak | mm. | ||
Khisanth | hmm maybe having %h<foo> the auto quoting version is a good thing after all ... less work for the right pinky :) | 07:13 | |
07:19
araujo_ joined,
araujo left
|
|||
literal | hey, I was wondering, will %h<$foo> interpolate? | 07:20 | |
moritz_ | no | 07:21 | |
07:21
araujo_ left
|
|||
literal | ok | 07:21 | |
moritz_ | that's what %h{$foo} is for | ||
literal | yeah | ||
07:21
araujo joined
|
|||
moritz_ | you can use %h<<stuff_with_$ending>> though | 07:21 | |
but that only works if $ending doesn't contain spaces, because <<...>> splits on spaces | |||
literal | I see | 07:22 | |
07:23
eternaleye left
07:25
jferrero joined
07:26
eternaleye joined
|
|||
pugs_svn | r22198 | pmurias++ | [smop] mold_frame->back is RELEASEd | 07:31 | |
07:40
iblechbot joined
07:52
pmurias joined
07:57
smg left
08:03
agentzh joined,
ashizawa_ joined,
ashizawa left
|
|||
pmurias | ruoso: hi | 08:08 | |
08:28
a-jing joined,
a-jing left
08:35
Maghnus joined
08:45
zamolxes joined
08:46
Maghnus left
|
|||
masak | moritz_: shouldn't `m boob` be `m bood` ? :) | 08:47 | |
08:47
wknight8111 joined
|
|||
masak is suddenly overcome with relief that the Unicode consortium seemingly consists of sane people | 08:47 | ||
moritz_ | masak: ;) | 08:49 | |
08:50
Maghnus joined
08:51
barney joined
08:59
jferrero left,
BinGOs left,
cosimo left,
s1n left,
Lunchy left
09:00
jferrero joined,
BinGOs joined,
cosimo joined,
s1n joined,
Lunchy joined,
bennymack-work joined,
Guest16015 joined
09:05
[1]Maghnus joined
09:07
bennymack-work left,
s1n left,
cosimo left,
Lunchy left,
Guest16015 left,
BinGOs left,
jferrero left,
jferrero joined,
BinGOs joined,
cosimo joined,
s1n joined,
Lunchy joined,
bennymack-work joined,
Guest16015 joined
09:21
Maghnus left,
[1]Maghnus is now known as Maghnus
09:23
pmurias left
09:27
smg joined,
wknight8111 left
09:31
[1]Maghnus joined
09:38
barney left
|
|||
masak | rakudo: my @x = (1,2,3,4,5); @x.pop while @x.elems > 3; say @x.perl | 09:39 | |
p6eval | rakudo 30954: OUTPUT[[1, 2, 3]ā¤] | ||
masak | any suggestions for an easier way to get the slice @x[0..2]? :) | 09:40 | |
moritz_ | implement slices? | ||
masak | "easier" | ||
moritz_ | I'll apply the patch ;) | ||
masak | I'm in user mode now, not implementor mode :) | 09:41 | |
moritz_ | mode.switch('hacker') | 09:42 | |
masak studies Chinese right now | |||
I've written a short script that rehearses words with me | 09:43 | ||
I need slices because it's more convenient to learn words 10 at a time | |||
oh well. the `.pop while` version works. | 09:45 | ||
09:47
Maghnus left,
[1]Maghnus is now known as Maghnus
09:48
zamolxes left
|
|||
moritz_ | pugs: my $x = 5; { my $x = 2; say $OUTER::x; } | 09:51 | |
p6eval | pugs: OUTPUT[5ā¤] | ||
moritz_ | pugs: my $x = 5; { my $x = 2 * $OUTER::x; say $x } | ||
p6eval | pugs: OUTPUT[10ā¤] | ||
moritz_ | pugs: my $x = 5; { my $x = 2 * $x; say $x } | 09:52 | |
p6eval | pugs: OUTPUT[0ā¤] | ||
moritz_ | wow, all correct | ||
pugs++ | |||
masak | in a perfect world, should that last one get a warning? | 09:57 | |
moritz_ | yes | 09:58 | |
09:59
pmurias joined
10:01
AzureStone left
10:03
ruoso left
10:05
AzureStone joined
10:08
[particle]1 left,
masak left
10:18
alanhaggai left
10:25
alanhaggai joined
10:33
xiaoyafeng joined
|
|||
moritz_ | Auzon: did the submission of your code to google work out? | 10:33 | |
Juerd | Someone requested a p3rl.org redirect but I forgot all about it | 10:36 | |
Please repeat :) | |||
moritz_ | Juerd: smop to www.perlfoundation.org/perl6/index.cgi?smop | 10:37 | |
lambdabot | Title: SMOP / Perl 6 | ||
moritz_ | Juerd: it was pmurias, I think | ||
Juerd | Will do; thanks for repeating | ||
Now active | 10:38 | ||
moritz_ | works, thanks | 10:39 | |
10:40
xiaoyafeng_ joined
10:41
zamolxes joined
10:47
xiaoyafeng__ joined
10:49
xiaoyafeng___ joined
|
|||
pmurias | Juerd: sorry, forgot to send the email | 10:55 | |
Juerd | That's okay | ||
I forgot I asked you to | 10:56 | ||
10:56
xiaoyafeng____ joined
10:57
wknight8111 joined
10:59
xiaoyafeng left,
xiaoyafeng____ is now known as xiaoyafeng
11:04
iblechbot left
11:06
xiaoyafeng_ left
11:09
xiaoyafeng__ left
11:12
ashizawa_ left
11:13
xiaoyafeng___ left
11:20
xiaoyafeng____ joined
11:26
xiaoyafeng_ joined
11:28
barney joined
11:36
meppl joined
11:39
xiaoyafeng left
11:40
xiaoyafeng joined
11:41
charsbar_ joined
11:43
riffraff joined
|
|||
riffraff | hi | 11:43 | |
moritz_ | hi | ||
11:45
xiaoyafeng____ left
11:56
charsbar_ left
12:00
charsbar_ joined
|
|||
smtms | win 19 | 12:02 | |
moritz_ | loose 19 | 12:03 | |
that's life ;) | 12:04 | ||
12:05
ashizawa joined
12:07
sri_work left,
[particle] joined
12:09
xiaoyafeng_ left
12:12
jferrero left
12:40
pmurias left
12:42
iblechbot joined
12:47
riffraff left,
barney left
12:54
alester joined
12:56
cosimo left
13:00
xiaoyafeng_ joined
13:01
a-jing joined,
a-jing left
13:02
xiaoyafeng__ joined
13:05
xiaoyafeng___ joined
13:06
[particle] left
13:07
xiaoyafeng____ joined,
alester left
13:09
[particle] joined
13:10
jferrero joined
13:12
xiaoyafeng__ left
13:13
xiaoyafeng__ joined
13:15
ggoebel joined
13:16
xiaoyafeng____ left
13:17
xiaoyafeng____ joined
13:18
xiaoyafeng left,
xiaoyafeng____ is now known as xiaoyafeng
13:19
xiaoyafeng_ left,
Auzon1 joined,
Auzon left
13:21
smg left,
smg joined,
kanru left
13:23
jferrero left
13:24
jferrero joined
13:27
xiaoyafeng____ joined
13:33
xiaoyafeng__ left,
xiaoyafeng_ joined
13:36
xiaoyafeng__ joined
13:37
xiaoyafeng___ left,
xiaoyafeng___ joined
13:38
Auzon1 left
13:48
Myoma left,
xiaoyafeng left,
Myoma joined
13:52
xiaoyafeng____ left
13:55
xiaoyafeng_ left,
xiaoyafeng__ left
13:57
TJCRI joined
14:00
alanhaggai left
14:02
xiaoyafeng___ left
|
|||
pugs_svn | r22199 | moritz++ | [t] moved char_by_name.t to spec/ | 14:03 | |
r22200 | moritz++ | [t] moved char_by_number.t to spec/ | 14:09 | ||
moritz_ | TimToady: t/syntax/pairs.t uses [,] %hash to interpolate named arguments into a capture - is that still allowed? | 14:12 | |
uhm, seems to be used in S03 as an example, so probably yes | 14:14 | ||
14:15
xiaoyafeng__ joined,
xiaoyafeng__ is now known as xiaoyafeng
|
|||
pugs_svn | r22201 | moritz++ | [t] moved pairs.t to spec/, fudged a bit, added a test | 14:19 | |
rakudo_svn | r30966 | pmichaud++ | [rakudo]: spectest-progress.csv update: 158 files, 3288 passing tests | 14:26 | |
14:28
baest left,
baest joined
|
|||
rakudo_svn | r30967 | pmichaud++ | [rakudo]: Fix .kv method on Mapping to not stringify values (RT #58744) | 14:32 | |
14:32
ashizawa left
14:34
kanru joined
14:35
rdice joined
|
|||
pugs_svn | r22202 | moritz++ | [t] fudged pairs.t for rakudo | 14:43 | |
14:52
nwc10 joined
|
|||
rakudo_svn | r30968 | moritz++ | [rakudo] add tests for pairs to spectest_regression | 14:56 | |
14:59
cookys joined
15:00
alester joined
15:01
xiaoyafeng__ joined
|
|||
pugs_svn | r22203 | moritz++ | [t/spec] unfudged a test for rakudo | 15:01 | |
15:05
alester left,
zamolxes left
15:07
xiaoyafeng_ joined
15:11
xiaoyafeng___ joined,
alanhaggai joined
15:13
TJCRI left
|
|||
speckbot | r14581 | pmichaud++ | Typo fix "last" -> "list" | 15:14 | |
15:16
xiaoyafeng____ joined
15:18
viklund left
15:25
xiaoyafeng__ left
15:30
xiaoyafeng_ left
15:31
xiaoyafeng left
15:33
xiaoyafeng___ left
15:36
justatheory joined
15:37
Jedai left
15:38
Jedai joined
15:45
xinming_ left
15:55
xiaoyafeng joined
16:04
nwc10 left
16:05
paz joined
16:16
xiaoyafeng____ left,
armagad joined
16:49
eternaleye left
16:56
pmurias joined
17:02
xiaoyafeng_ joined
17:05
eternaleye joined
17:09
xiaoyafeng__ joined
17:11
xiaoyafeng___ joined
17:17
xiaoyafeng____ joined
17:21
xiaoyafeng left,
xiaoyafeng joined
17:27
xiaoyafeng_ left
17:30
xiaoyafeng__ left
17:32
xiaoyafeng_ joined
17:33
ruoso joined
|
|||
ruoso | Hello! | 17:33 | |
pmurias, hi | |||
17:35
xiaoyafeng__ joined
17:36
xiaoyafeng___ left
17:37
Myoma left,
xiaoyafeng___ joined
|
|||
ruoso | pmurias++ one less test leaking ;) | 17:38 | |
17:38
eternaleye left
17:39
xiaoyafeng____ left
17:40
Jedai left
17:41
Jedai joined
17:43
xiaoyafeng____ joined
17:51
xiaoyafeng left,
pmurias left
17:52
xiaoyafeng joined
17:54
xiaoyafeng_ left
17:55
xiaoyafeng__ left
17:57
pbuetow joined
18:02
xiaoyafeng___ left
18:07
rdice left
18:10
xiaoyafeng____ left
18:21
TJCRI joined
18:23
eternaleye joined
18:32
Muixirt joined,
Muixirt left
18:46
justatheory_ joined,
justatheory left
|
|||
TimToady | moritz_: I don't see much use for attaching such extra semantic baggage to [,] anymore. All it will do is confuse people, who are already confused enough by prefix:<|> | 18:49 | |
moritz_ | aye | 18:50 | |
TimToady | well, maybe I'd better read S03 first :) | ||
S03 contradicts itself; I'm so suprised... | 18:53 | ||
but I think [,] has to have "reduce" semantics, which means [,] 1,2,3 has to put 1,2,3 into item context, which implies it means [1,2,3], not \(1,2,3), by current spec | 18:54 | ||
so I'd go with the interpretation that says [,] @foo is equivalent to [@foo] | 18:55 | ||
moritz_ | anyway, the current semantics don't seem to make much sense | ||
18:58
Jedai left,
Jedai joined
|
|||
speckbot | r14582 | larry++ | inconsistent meaning of [,] noticed by moritz++ | 19:03 | |
ruoso | I'm having some trouble with the semantics of return values... I mean... in SMOP I have "late context propagation". This means that the method doesn't really predict how its value will be used, but it returns a value that have the appropriate ability to be coerced to the expected contexts... this means that in "my @a = foo()" and "my $a = foo()", the sub foo will work the exact same way... but the runtime will call .List to get the value in list context and | 19:05 | |
.FETCH to get the value in item context... | |||
all this looks Ok at first... | 19:06 | ||
but then you have things like map | 19:07 | ||
which returns an iterator, | |||
that implements prefix:<=> | 19:08 | ||
hmm | |||
wait... | |||
19:08
armagad left
|
|||
ruoso | ok... the problem is... | 19:08 | |
moritz_ | map returns a lazy list, not an iterator | ||
ruoso | moritz_, it returns a lazy list if used in list context | 19:09 | |
moritz_ | ruoso: and in unkown context probably an object that stores the lazy list | ||
ruoso: and that knows how to respond to other contexts | 19:10 | ||
ruoso | moritz_, have you read the wiki page about SMOP and map? | ||
moritz_ | ruoso: no | ||
ruoso | take a look at it... | 19:11 | |
www.perlfoundation.org/perl6/index....p_operator | |||
lambdabot | Title: SMOP map operator / Perl 6 | ||
ruoso | basically, the problem is that postcircumfix:<[ ]> is not very cursor-friendly | 19:12 | |
or flow-friendly... | |||
for instance... | |||
if map returns a list and not an iterator, it will be very hard for it to find out when it can discard the items or when it can't | 19:13 | ||
a lazy list needs to store all the previously-computed-values | |||
an iterator doesn't | |||
thus a lazy list can be constructed using an iterator... | |||
and so can a lazy slice | 19:14 | ||
PerlJam | ruoso: "needs to store" is an optimization | ||
ruoso | PerlJam, if the lazy list is being produced from a network flow... | 19:15 | |
how do you have an actual list without storing the values? | |||
you can't always re-compute the values | |||
which I presume is what you meant... | |||
the problem is that you can't really know where your data is coming from... | 19:16 | ||
I think the feed operators stress that concept a lot | 19:17 | ||
but anyway... | 19:18 | ||
the map block might return an item or a list | |||
as well as any code block | |||
but eventually, you want to take it as a list, and it is just a single item | 19:19 | ||
PerlJam | ruoso: that's what I was implying ... but I guess at some point you do have to know where your data is coming from. (If you could, how would you query a list for its properties to know what it is and is not capable of?) | 19:20 | |
moritz_ | so all this complexity because you don't have exceptions? | 19:21 | |
ruoso | PerlJam, considering all the polymorphism Perl 6 supports, you have to assume you can't infer where the data is coming from... | ||
moritz_, I don't get it... what do exceptions have to do with it? | |||
moritz_ | ruoso: they make the "proper" iterating scheme impossible, don't they? | 19:22 | |
ruoso | moritz_, they do? why? | ||
moritz_ | ruoso: because you can't just say "I want the next value" and catch the exception if it doesn't work? | 19:23 | |
ruoso | moritz_, sorry... I still don't see your point... the semantics I'm proposing presume exceptions in the future, they are not designed in a way to circumvent the absense of exceptions... | 19:25 | |
the problem I'm facing is if I should assume that every return is, at first, a list of values... | |||
PerlJam | moritz_: I think it's the "i want the next value" that's the problem. (i.e., it's not the exceptional case that gives grief, but the common case) | 19:26 | |
ruoso | yes... | ||
specially when it's one value, no values or three values | |||
which is a common usage for map | |||
or grep... | |||
PerlJam | or any lazy thing :) | ||
ruoso | because in list context, that is flattened, but in slice context, you have the return of each individual iteration | 19:27 | |
that is the tricky part | |||
and all that also lazy | |||
19:28
justatheory_ left
|
|||
Khisanth | speaking of flattening ... | 19:29 | |
moritz_: why do you refer to that as interpolation instead? | |||
moritz_ | Khisanth: on the blog? | 19:30 | |
Khisanth | yes | ||
moritz_ | because that's what perl people call it :/ | ||
[particle] | what if lists are coroutines that yield values? | ||
ruoso | considering "my $a = @a" allows you to access the array directly... how do you tell the difference between { my @a = (1,2,3); my $b = @a; $b } and { my @a = (1,2,3); my @b = @a; @b } ? | 19:31 | |
Khisanth | moritz_: erm perl 6 people? | ||
ruoso | [particle], that doesn't solve the problem on how to iterate... only how to implement the iteration... | ||
moritz_ | Khisanth: also perl 5 people | 19:32 | |
Khisanth has never seen anyone call that interpolation | |||
ruoso neither | |||
moritz_ | have you never read the perl documentation? | 19:33 | |
perldoc perlop | 19:34 | ||
search for interpolate | |||
same for various perl\d+delta.pod and perlre | 19:35 | ||
Khisanth | erm that is all for "foo $bar" type stuff in perlop | 19:37 | |
moritz_ | and it's not what I mean in the blog? | 19:38 | |
moritz_ is thoroughly confused | |||
Khisanth | I am referring to "By default arrays aren't interpolated in argument lists, so unlike in Perl 5 you can write something like this:" | 19:39 | |
moritz_ | ah, capture interpolation | ||
in perl 5 there is no such thing | |||
perlcabal.org/syn/S03.html#Argument...erpolating # that's where I got the name from | 19:40 | ||
lambdabot | Title: S03 | ||
pmichaud | ruoso: my $b = @a; is item assignment, my @b = @a; is list assignment | ||
19:41
Auzon joined
|
|||
pmichaud | as such, $b does not interpolate into a list, while @b will. | 19:41 | |
Khisanth wonders which of the meanings of calling functions with & the author of S03 is referring to | 19:44 | ||
moritz_ | pugs: my $x = (1, 2); say (3, $x, 4).perl | ||
p6eval | pugs: OUTPUT[(3, \(1, 2), 4)ā¤] | ||
moritz_ | pugs: my $x = (1, 2); say (3, $x, 4).elems | 19:45 | |
p6eval | pugs: OUTPUT[3ā¤] | ||
moritz_ | Khisanth: maybe &func(@args) which turns off prototype checking | ||
Khisanth | I am aware of that | ||
ruoso | pmichaud, right... I get that... but how do I differentiate that in the lowlevel? | 19:46 | |
pmichaud | ruoso: I haven't completely figured that out myself yet. That's why [1, [2, 3]] isn't working in Rakudo at the moment. | 19:47 | |
ruoso | should I assume that every return value is a list? | ||
pmichaud | well, it acts mostly like an argument list | ||
in particular, return (3,4) and return(3,4) aren't exactly the same. :-) | 19:48 | ||
(same as say (3,4) and say(3,4) do different things) | 19:49 | ||
ruoso | they do? | ||
:D | |||
moritz_ | shouldn't it just return a capture that flattens in list context but not in slice context? | ||
pmichaud | moritz: that's my thinking, yes. | ||
in other words, it's the same as any other call semantics, except 'return' is actually doing a "call back to the caller" and passing some arguments | 19:50 | ||
[particle] | that's the cps-way | ||
pmichaud | the caller then receives the arguments (conceptually in the form of a capture) and binds thems to the calling parameter list | ||
[particle] | return is just call. there is no return. | ||
ruoso | SMOP implements it as cps | 19:51 | |
[particle] | no *distinct* return | ||
19:52
kanru left,
xiaoyafeng_ joined
|
|||
ruoso | pmichaud, "[1,[2,3]]" is actually a very precise example... how do I differentiate "[1,[2,3]]" from "(1,(2,3))"? | 19:52 | |
ruoso considering the first appears as a list of two items even in list context and the second a list of three items in list context | 19:53 | ||
pmichaud | (2,3) is a List | ||
[2,3] is an Array | 19:54 | ||
moritz_ | I think that the first one is actually an array | ||
right | |||
pmichaud | [1,[2,3]] is an Array of two elements | ||
(1, (2, 3)) in list context is a List of three elements | |||
19:54
xiaoyafeng__ joined
|
|||
ruoso | pmichaud, and [1,[2,3]] in List context? | 19:55 | |
pmichaud | is an Array -- equivalent to [[1,[2,3]]] | ||
(note extra brackets) | 19:56 | ||
ruoso | so the distinction of Array and List is the stopper for the flattening? | ||
pmichaud | not completely -- there's something more to it | ||
moritz_ | but otoh my @a = 1, 2; my @b = 3; @b.push(@a). Now @b == 3, right? | ||
pmichaud | moritz_: I think not. | 19:57 | |
I think +@b == 2 | |||
19:57
xiaoyafeng___ joined
|
|||
pmichaud | oops, I'm wrong | 19:57 | |
@b == 3 because @a is evaluated in flattening list context | |||
lambdabot | Maybe you meant: b52s babel bf bid botsnack brain bug . ? @ v | ||
pmichaud | (because .push has a slurpy array parameter) | 19:58 | |
moritz_ | ok, but @b.push([1,2]) would result in +@b == 2, right? | ||
pmichaud | yes. | ||
moritz_ | but we push an exaclty equivalent array, aren't we? | ||
19:58
xiaoyafeng left
|
|||
pmichaud | ruoso: the reason I think there's something more is that even if we say @b is an Array, @b will flatten in list context | 19:59 | |
19:59
xiaoyafeng joined
|
|||
ruoso | I think I found the confusing point... | 19:59 | |
pmichaud | ISTR that TimToady mentioned something about "scalar Arrays", so that [1,2] is a scalar Array, while @b is just an Array | ||
ruoso | we have an indecision on how much power the sigil has | ||
pmichaud | the sigil determines what the variable is allowed to bind to | 20:00 | |
$ can bind to anything. @ binds to things that implement the Positional role. % binds to things that have the Associative role. | |||
ruoso | it also implies the potential contexts the variable can be used | ||
@ implies flattening | |||
moritz_ | pugs: my @a = [1, 2]; say @a.elems | 20:01 | |
p6eval | pugs: OUTPUT[1ā¤] | ||
moritz_ | pugs: my @a := [1, 2]; say @a.elems | ||
p6eval | pugs: OUTPUT[1ā¤] | ||
pmichaud | pugs: my @a = (1,2); say elems @a; | 20:02 | |
p6eval | pugs: OUTPUT[2ā¤] | ||
20:02
xiaoyafeng_ left
|
|||
pmichaud | pugs: my @a := [1,2]; say elems @a; | 20:02 | |
p6eval | pugs: OUTPUT[1ā¤] | ||
ruoso | pugs seems to use Array Ć List as the key | ||
moritz_ | rakudo: my @a := [1, 2]; say @a.elems | 20:03 | |
p6eval | rakudo 30973: OUTPUT[2ā¤] | ||
moritz_ | rakudo: my @a = [1, 2]; say @a.elems | ||
p6eval | rakudo 30973: OUTPUT[1ā¤] | ||
pmichaud | (phone) | ||
moritz_ | somewho rakudo's output feels right | ||
ruoso | TimToady, is it? | 20:04 | |
moritz_ | ruoso: they're having their design minutes now, perhaps they'll discuss it on phone | ||
ruoso | oh... great... | 20:05 | |
rakudo: my @a = (1,2) ; say elems @a; | |||
p6eval | rakudo 30973: OUTPUT[2ā¤] | ||
ruoso | just sanity checking ;) | ||
If that's correct... than List is a very special type... | 20:06 | ||
and I can assume that every item can be seen as a list of a single element... | 20:07 | ||
with the exception of the magical "List" type, which is the only thing that appears as an effective List | |||
and I think that solves all my questions... | 20:08 | ||
in SMOP, every value is a read-only scalar of itself and is also a list of itself... | |||
20:11
justatheory joined
|
|||
ruoso | an Array in List context is also a list of a single element... a "scalar Array" as pmichaud pointed out that TimToady pointed out... | 20:13 | |
;) | |||
and that means I have my sanity back :D | 20:14 | ||
and with that... I should go home & | |||
20:15
ruoso left
20:17
xiaoyafeng___ left
20:26
xiaoyafeng__ left
21:00
iblechbot left
21:01
paz left
21:04
alester joined
21:12
ggoebel left
21:22
justatheory left,
justatheory joined
21:28
Myoma joined
21:37
zamolxes joined
21:44
alester left
21:46
pmurias joined
21:47
TJCRI left
21:52
zamolxes left
22:00
ggoebel joined,
pbuetow left
22:05
pmurias left
22:18
justatheory left
22:41
eternaleye_ joined
22:47
meppl left
22:54
eternaleye left
22:56
Auzon left
22:58
ruoso joined
23:16
BinGOs_ joined
23:28
BinGOs left
23:31
Limbic_Region joined
|
|||
wknight8111 | where is the best source for Perl 6 info? Is it the synopses at this point? | 23:34 | |
23:35
ruoso left
|
|||
PerlJam | wknight8111: what sort of info do you want? | 23:36 | |
23:37
ruoso_ joined
23:39
lambdabot joined
|
|||
literal | wknight8111: perlgeek.de/blog-en/perl-5-to-6/ | 23:41 | |
lambdabot | Title: blog | Perlgeek.de Blog :: Category Perl-5-to-6 | ||
wknight8111 | yeah, I've read over that entire series | 23:43 | |
that's a good source, thanks | |||
Tene | synopses and test suite | ||
PerlJam | wknight8111: there's also the various perl6 articles on perl.com | ||
wknight8111: but the synopses are best for understanding the way the language should be. | 23:44 | ||
wknight8111 | I'm planning to start writing a book about Perl 6 on Wikibooks, and I want to make sure I'm getting all the best information about it | ||
Tene | Synopses and the test suite | ||
wknight8111 | yeah, the dreaded test suite. | 23:45 | |
PerlJam | wknight8111: what Tene said for sure then | ||
23:47
elmex left
|