Check your feather email | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com | www.treehugger.com/files/th_images/paradigm.jpg [set by audreyt on 2006-08-29 05:26:57 -0700] Set by Akwa|user on 14 September 2006. |
|||
00:11
weinig is now known as weinig|bbl
00:14
Qiang_ joined
|
|||
svnbot6 | r13516 | lwall++ | Answer to sqrt question. | 00:19 | |
00:21
nekokak joined
00:23
hikozaemon joined
00:30
rodi joined
00:31
vel joined
00:40
plural_ joined
00:50
Qiang joined
00:52
mjk joined
00:53
justatheory joined,
pen1 is now known as penk
|
|||
svnbot6 | r13517 | markstos++ | S29_spec.t: Add smart link and improve comment. | 01:01 | |
r13518 | markstos++ | mv t/xx-uncategorized/S29_spec.t t/builtins/type_declarations.t | 01:04 | ||
r13518 | markstos++ | (Part of my secret plan to make the test structure layout more closely match | |||
r13518 | markstos++ | the spec layout) | |||
r13519 | lwall++ | Tweaks to character types. Ling and Graf are dead. | |||
r13520 | lwall++ | Fixed tests to go with new S29 types. | 01:08 | ||
ajs_home | Hmmm... there's an S29_spec.t? Perhaps I should be looking at that ;) | ||
TimToady | er, no, it's just the Char types. | 01:09 | |
01:20
mdiep joined
|
|||
svnbot6 | r13521 | markstos++ | [t/operators] - two smart links and a comment. | 01:23 | |
01:31
Qiang_ joined
01:33
mdiep joined
|
|||
TreyHarris | About an hour ago, I got a duplicate copy of markstos's message to perl6-users from last Saturday. Did anyone else? | 01:36 | |
01:36
tcliou joined
|
|||
TimToady | yes | 01:37 | |
TreyHarris | odd. | 01:38 | |
TimToady | yes | 01:42 | |
01:54
mako132_ joined
|
|||
svnbot6 | r13522 | markstos++ | Test.pm: The docs stated that "is_deeply" was a future future. | 02:02 | |
r13522 | markstos++ | Clarify that some version of it works now. | |||
02:12
mako132_ joined
|
|||
svnbot6 | r13523 | markstos++ | Test.pm - POD is further enhanced with "=head3" for each available function, | 02:13 | |
r13523 | markstos++ | so they are easily browsable after pod2html conversion. See: | |||
r13523 | markstos++ | feather.perl6.nl/~markstos/Test.pm.html | |||
lambdabot | Title: Test - Test support module for perl6, tinyurl.com/p2dor | ||
02:14
Qiang joined
|
|||
svnbot6 | r13524 | markstos++ | Test.pm: clarify what I believe to be true: | 02:31 | |
r13524 | markstos++ | - eval_ok should be used if code might be parse, but has some overhead. | |||
r13524 | markstos++ | - die_ok is a better choice if the code parses, but might die. | |||
r13524 | markstos++ | Without this clarification, it was confusing what the difference was. | |||
r13525 | markstos++ | Test.pm: Improve docs for :todo and :depends. | 02:47 | ||
r13526 | markstos++ | classify.t: new tests for newly spec'ed "classify". | 02:55 | ||
03:10
Qiang_ joined
03:12
frederico joined
|
|||
svnbot6 | r13527 | lwall++ | 1st whack at exporting methods. | 03:46 | |
r13527 | lwall++ | Some bogus package names are turning into export tags. | |||
r13527 | lwall++ | Added generalized pick method. | |||
r13527 | lwall++ | Added signatures as sort criteria | |||
TimToady | I'm not done with that file, so don't expect complete consistency... | 03:49 | |
'course, it won't be completely consistent after I'm done with it either... | 03:58 | ||
Eidolos | Completeness or consistency. Choose one, maybe. :) | 04:56 | |
Teratogen | thus spake Godel | 05:00 | |
svnbot6 | r13528 | ajs++ | Per Larry answer, moved radical glyph to API doc with :UNI export tagging and cleaned up API doc a bit | 05:04 | |
r13529 | trey++ | Deleting test pm files used by old use_import_not_found.t, which was | 05:19 | ||
r13529 | trey++ | deleted in r13468. | |||
05:19
BooK_ joined
05:21
kyrbe joined
|
|||
TreyHarris | ?eval my $a = (1,2,3); my ($b) = [,] @$a; $b | 05:30 | |
05:30
evalbot_r13492 is now known as evalbot_r13529
|
|||
evalbot_r13529 | [1, 2, 3] | 05:30 | |
TreyHarris | is that right? | ||
TimToady | no, should just end up with 1 | 05:34 | |
in fact [,] should generally be a noop on @ in list context. | 05:35 | ||
the Capture generated by [,] is supposed to reinterpolate. | 05:36 | ||
now if there weren't parens around $b, that'd be different, I think. | |||
since [,] in scalar context would just return the Capture. | 05:37 | ||
TreyHarris | right | ||
?eval my $a = (1,2,3); my ($b) = @$a; $b | |||
evalbot_r13529 | \1 | ||
TreyHarris | that works fine | ||
svnbot6 | r13530 | trey++ | [t/operators/splat.t] | 05:38 | |
r13530 | trey++ | Added failing test for flattened dereffed arrayref in list context. | |||
TreyHarris | though i guess 'splat' is no longer a good name for that test file... | 05:39 | |
05:46
f0rth joined
|
|||
TreyHarris | "Lazy of Pair"? Lazy is a type? | 05:58 | |
just noticed that in docs/Perl6/Spec/Functions.pod | 05:59 | ||
TimToady | probably just means a List | 06:08 | |
since List is already presumably lazy | 06:09 | ||
but maybe we'll end up calling them all Feeds anyway... | 06:11 | ||
TreyHarris | "multi Lazy Array::reverse (@values:)" should be written "multi Array::reverse (@values:) is lazy", no? | 06:12 | |
TimToady | that's bogus syntax several ways. | 06:13 | |
TreyHarris | which one? | ||
oh... yes. | 06:14 | ||
i just cut and pasted, and edited and pasted | |||
TimToady | our Lazy multi method reverse (@values:) | ||
plus an "is export" so we can say reverse(@foo). | |||
I've been trying to get rid of all the bogus Array:: thingies too. | 06:15 | ||
it's just in the List package, so anthing that does the List role and can bind to @values can be reversed. | 06:16 | ||
TreyHarris | couldn't reverse of an actual array be optimized over reverse of a list potentially? | 06:17 | |
TimToady | maybe, maybe not. | ||
It's probably a lot faster to reverse 1..100000 than 1,2,3,4,....100000 | 06:18 | ||
TreyHarris | but i guess you don't have to specify in the docs any multis of subclasses you do specify... that should be transparent. (unless you want to play games with .wrap or .assuming or other Code methods...) | 06:19 | |
TimToady | since you can just turn it into 100000..1:by(-1) | ||
TreyHarris | right... | 06:20 | |
TimToady | these are interfaces, which is why I started putting in mumbojumbo about roles/classes. | ||
reverse probably comes from the Ordered role, in fact... | |||
or some such | |||
TreyHarris | right... multis of subtypes of types you do specify... | ||
err... wait, is a subclass of Foo also a subtype of Foo? subtype has special meaning | 06:21 | ||
06:21
justatheory joined
|
|||
TreyHarris | which lets you warp your type constraints in various dimensions... but inheritance is one of the dimensions already provided for i hope? | 06:21 | |
TimToady | one would hope to get a bit of polymorphism out of our MMD mechanism... | 06:22 | |
TreyHarris | sure... i was just asking if it's valid to use the word "subtype" to include a class that does or isa something else | 06:23 | |
TimToady | I have no idea what "subtype" would mean in the context of P6. | 06:26 | |
TreyHarris | well, S12 uses the word 'subtype' a dozenish times | 06:27 | |
TimToady | probably means a dozen different things there. :) | ||
TreyHarris | and says "A subtype is not a subclass." which is why i was searching for a different word to encompass "any type that is natuarally encompassed by another type", so for example Int is encompassed by Num, and 4 is encompassed by Int... | 06:28 | |
liskov-like | |||
06:44
iblechbot joined
06:46
mdiep joined
07:14
marmic joined
07:26
zakharyas joined
07:38
kane-xs joined
07:46
mdiep joined
08:03
pdcawley joined
08:07
ludan joined
|
|||
ludan | howdy | 08:07 | |
08:16
jferrero joined
08:17
justatheory joined
|
|||
mugwump | a subtype might not be a subclass, but isn't a subclass a subtype? | 08:19 | |
08:24
integral_ joined
08:26
scw joined
|
|||
TreyHarris | mugwump: that's what I was thinking, yes | 08:27 | |
TreyHarris heads off to bed & | 08:28 | ||
08:30
integral_ is now known as integral
08:41
vytautas joined
08:55
azr|el joined
09:10
avarab joined
09:15
elmex joined
|
|||
lumi | How much slower is pugs today than perl? | 09:16 | |
Juerd | Depends on what you're doing :) | 09:17 | |
lumi | A lot of string processing | ||
09:39
avarab is now known as avar
10:00
zeriod joined
10:02
Odin-LAP joined
|
|||
obra | 10:15 | ||
nothingmuch | |||
buu | |||
nothingmuch | ack, /nick timmy didn't work | ||
10:37
rodi joined
10:47
ruoso joined,
buubot joined
10:52
norageek2 joined
11:03
buetow joined
11:09
chris2 joined
11:25
mdiep joined
11:26
ofer__ joined,
ofer__ is now known as ofer1
11:31
pdcawley joined
11:40
Limbic_Region joined
11:52
norageek2 joined
11:56
weinig joined
|
|||
Limbic_Region | ?seen audreyt | 12:01 | |
lambdabot | audreyt is in #perl6, #ghc and #haskell. I last heard audreyt speak 10h 35m 7s ago. | ||
Limbic_Region | audreyt ping | ||
12:09
pdcawley joined
12:10
ayrnieu joined
12:21
masak joined
12:31
iblechbot joined
12:36
kane-xs_ joined
12:46
zeriod joined
12:59
KingDiamond joined
|
|||
svnbot6 | r13531 | malon++ | eval.t - test fatal C<use> statements wrapped in C<eval> | 13:20 | |
r13531 | malon++ | * Test.pm itself is broken by the Pugs bug that this test documents, | |||
r13531 | malon++ | so you won't even see "Looks like you planned 6 tests but only ran 5." | |||
13:21
mdiep joined
13:26
crem joined,
cjeris joined
13:27
dakkar joined
13:28
dakkar joined
13:31
dakkar joined
13:37
vel joined
|
|||
svnbot6 | r13532 | malon++ | [ext/re] | 13:43 | |
r13532 | malon++ | * C<use re 'PGE'> will globally (not lexically) switch the regex engine | |||
r13532 | malon++ | in the middle of a program. It simply resets the environment variable. | |||
r13532 | malon++ | * Requested by audreyt++ as a supplement to r13513. | |||
13:46
fglock joined
13:50
pdcawley joined
13:51
vel joined
13:52
vel joined
13:54
frederico joined
14:10
mdiep joined
14:25
pdcawley joined
|
|||
ajs_ | TreyHarris: Lazy is a type that Larry put into S29, and I ran with. Lazy of Pair is something that I'm not sure abut, but seemed to be the only way to get what I needed. | 14:33 | |
The 'our Lazy of Pair multi method classify ( @values: Matcher $test )' is meant to indicate that classify must return a Lazy list comprised of Pairs. If we take as written that Larry's Lazy type is, in fact, a container akin to Array, then it works fine. | 14:35 | ||
14:40
pdcawley joined
14:55
lollan joined
|
|||
TreyHarris | ajs_: ok... I guess I'm just confused about "Lazy of Pair" versus "Lazy Array". the first makes Lazy sound as if it's a container, the second not so much | 15:30 | |
and what is the answer to what Larry said last night? what's the difference between Lazy and List? | 15:31 | ||
15:36
justatheory joined
15:54
tcliou left
16:00
mauke_ joined
16:03
rlb3 joined
16:10
Psyche^ joined
16:15
weinig is now known as weinig|away
16:18
mauke_ is now known as mauke
16:23
Psyche^ is now known as Patterner
16:31
Daveman joined
|
|||
TimToady | according to src/Pugs/Types.hs, it would appear that the distinction between Lazy and List is that a List can be either Lazy or Eager. | 16:34 | |
ajs_ | TreyHarris: I'm not aware of Larry saying something last night about Lazy and/or List | 16:35 | |
TimToady | no, I just said it this morning. :) | 16:36 | |
Juerd | Heh | 16:38 | |
TimToady | however, it's not clear to me whether we really need an Eager type, or whether we can define eager lists operationally. | ||
ajs_ | sigh... I've been cattering here for how long without realizing that you were Larry?! | ||
chattering even | |||
TimToady | np | 16:39 | |
rodi | damn, and I could have been Larry to ajs_. | ||
TimToady | I guess if we need an Eager type it's for signatures. | ||
so many missed opportunities in life... | |||
rodi | err... if I didn't ask dumb questions on p6l, anyway. | 16:40 | |
ajs_ | So... given that, is my ad hoc "Lazy of Pair" reasonable, or should that be something else? | ||
TimToady | I'm not sure we need a DumbQuestion type either. :) | ||
ajs_ | rodi: you will always be my $larry... | ||
TimToady | it's probably okay, unless some kind of weird contra/covariance thing makes it not general enough. | 16:41 | |
ajs_ | Ok, I'll leave it alone for now, then. | ||
TimToady | but I think naming a lazy list as Lazy probably buys us documentation at least. | ||
that's my feelers too | |||
ajs_ | Your lack of whitespace DWIMery made me feel much better about |, BTW | 16:42 | |
TimToady | good. | ||
I'm only partly done with my recent whackage on S29. | |||
ajs_ | Ok, I'll keep my eyes on the logs. Do you have a feeling one way or the other about the audreyt-requested ongoing API/S29 split? | 16:43 | |
TimToady | there are still a bunch of Foo:: things in there that should probably be implicitly in the role/class that provides/exports them. | ||
no, that's been mostly off my radar. | 16:44 | ||
which means I'm probably stomping all over someone's carefull crafted S29 extraction code. :) | |||
ajs_ | It's not that big a deal. Just removing things that aren't really language features to the API docs. Methods, constants, etc. | 16:45 | |
Juerd | TimToady: Defining a type that is both an array and a string goes like class Foo { does Array; does Str; ... }, right? | ||
TimToady | but this should really be defined in Perl files, not Pod files. | ||
Juerd, yes, in theory, and assuming we properly role-ify the basic types. | 16:46 | ||
ajs_ | Absolutely. As soon as pugs can handle the full spectrum of what's in these API docs, I think they should become the POD associated with the appropriate code, not stand-alone. | ||
justatheory coughs | |||
TimToady | development-driven specification, just like test-driven development. :) | 16:47 | |
ajs_ | heh | 16:48 | |
TimToady | just run the whole waterfall uphill. | ||
someday we might even have some requirements. | |||
justatheory | www.waterfall2006.com/ | ||
lambdabot | Title: Waterfall 2006 - International Conference on Sequential Development | ||
ajs_ | "You've always known a good waterfall-based process is the right way to develop software projects." -- I have?! | 16:50 | |
TimToady | speaking of waterfalls, I'm off to the shower... | 16:51 | |
biab & | |||
ajs_ | laters | 16:52 | |
Juerd | TimToady: Given this syntax, how would you promise that the members of said Array are of MyType? | 16:56 | |
17:01
lanny joined
17:03
araujo joined
|
|||
svnbot6 | r13533 | fglock++ | t/xx-uncategorized/rule_recursive.t - s/rule/regex/ to enable backtracking | 17:06 | |
kolibrie | to find every match for a regex called 'talk', should this work? while (my $match = $content ~~ m:c /<talk>/) { say $match } | 17:07 | |
is there a better way? | |||
(is there a way which currently works?) | 17:08 | ||
kolibrie is working on his 'Practical Extraction with Perl 6' talk for Saturday | 17:09 | ||
fglock | kolibrie: until Saturday we can find a way that works | 17:10 | |
kolibrie | fglock: awesome | ||
fglock: should I put that snippet in my slide for now? | |||
for reference, I am building my talk here: feather.perl6.nl/~kolibrie/extraction.xul | 17:11 | ||
lambdabot | tinyurl.com/rxtmp | ||
fglock | kolibrie: with :global / :overlap / :exhaustive you can capture to an array directly | 17:12 | |
but :c is easier to implement | |||
17:13
penk joined
|
|||
kolibrie | fglock: so this should work? my @match = $content ~~ m:g /<talk>/; | 17:13 | |
but really, I would prefer one match object at a time for this | 17:14 | ||
[particle] | kolibrie: change your while to for | ||
17:15
streakceur joined
|
|||
[particle] | ...then you can use m:g | 17:15 | |
fglock | bbiab & | ||
kolibrie | [particle]: for $content ~~ m:g /<talk>/ -> $match { say $match }; | 17:16 | |
17:16
penk joined
|
|||
[particle] | whoa, that's scary when you write it :) | 17:16 | |
17:17
penk joined
|
|||
kolibrie | and I think/hope that is lazily generated | 17:17 | |
[particle] | same thoughts/hopes here | ||
lanny | ?eval srand(3); | ||
17:18
evalbot_r13529 is now known as evalbot_r13533
|
|||
evalbot_r13533 | Error: No compatible subroutine found: "&srand" | 17:18 | |
lanny | Oh good. Broken here too. | ||
Juerd | srand shouldn't work :) | 17:20 | |
lanny | Really? Something to do with Haskell core? | 17:21 | |
Juerd | Nah, it reeks of perl4ness :P | ||
IMO randomness with user defined seeds should be OO. | 17:22 | ||
So that you can have several sequences at the same time. | |||
Maybe $*RAND can be the standard object, and $*RAND = Rand.new; could re-init or something | |||
lanny | I agree. But specs are specs. That's actually how I've implemented. Figured there would be a $*RandomGenerator having a default for rand() | ||
I guess I'll add to prelude then and see what happens. | 17:23 | ||
ajs_ | rand/srand are a nod to POSIX. It is assumed that a real random library will be provided which can track multiple seeds, plug in PRNGs, provide the best local source of true randomness, etc. | 17:41 | |
Once it is, rand/srand will almost certainly be font-ends to same. | 17:42 | ||
lanny | I know. On the other hand having a basic rand() to just select among different things without having to OO it all is nice. | ||
my @random = sort { int(rand 3) -1 }, @sorted; | |||
kolibrie | first example up, comments welcome: feather.perl6.nl/~kolibrie/extraction.xul | 17:43 | |
lambdabot | tinyurl.com/rxtmp | ||
ajs_ | lanny: You know that that isn't guaranteed to finish, right? | ||
lanny | If you know @sorted is finite then I hope it finishes. | ||
ajs_ | no, it depends on what kind of sort you are doing. | 17:44 | |
And if you are memoizing | |||
lanny | It is memoizing because that's a KeyExtractor. hmm. | ||
my @random = sort { $^a; $^b; int(rand 3) - 1 }, @sorted; | 17:45 | ||
Ugly but now it's a Comparator and would work. | |||
[particle] | kolibrie: looks good so far | 17:46 | |
lanny | Although first code works in Pugs now since need subsets working to put sort() into place. | ||
ajs_ | $test.(1,2) still has a random result. I think bubble sort chokes on that, but of course, Perl 6 is not likely to resort to a bubble sort ;) | 17:47 | |
Still, it's safer to just use a true shuffle (and guaranteed to be optimal) | 17:48 | ||
lanny | I've got a spec implementatin of sort() using mergesort. | ||
kolibrie | [particle]: thanks | ||
lanny | I know. N*logN just to shuffle is overkill. | ||
[particle] | there's nothnig wrong with bubble sort if you apply it correctly :P | ||
17:48
BooK_ joined
|
|||
ajs_ | [particle], the problem with that is that applying it correctly means knowning things about your data up-front (e.g. is it already nearly sorted). | 17:49 | |
lanny | Even nearly sorted you get N^2 comparisons. Although if you've got lots of time it does sort. | 17:50 | |
[particle] | that's true for any algorithm. you need to know your data in order to optimize | ||
svnbot6 | r13534 | fglock++ | v6 - implemented m:c/rule/ - still needs work | ||
ajs_ | Point is that by definition, a sort assumes that any two elements have a static relationship. If you break that assumption, all bets are off, and you should not be shocked to find that a local implementation hoses you. | ||
fglock | re 13534: there is a problem related to cacheing - it only works the first time you run it | 17:51 | |
ajs_ | [particle]: Correct. bubble just has a narrower domain than most. I assume we both know this, and we're just demonstrating that we do ;) | ||
fglock | kolibrie: I'm testing with: perl -Ilib -e 'use v6-alpha' - ' my $content = "xyz"; while $content ~~ m:c/<alpha>/ { say $/ } ' | ||
lanny | On the flip side of knowing your data you can also know your implementation and do things you probably shouldn't. | ||
But yes. I'm in total agreement, ajs_. | |||
ajs_ | fglock: did you hear my comment about v6 and "my A $x" turning into "my A; $x;"? | 17:52 | |
fglock | ajs_: yes - v6.pm is currently too forgiving with syntax errors | 17:53 | |
kolibrie | fglock: that looks like a good test | ||
ajs_ | ?... errors? | ||
lambdabot | Not enough arguments to @. | ||
fglock | ajs_: oh, you mean A is a Type | ||
ajs_ | Right | ||
fglock | ajs_: it's a grammar error then | 17:54 | |
ajs_ | ok. just wanted to make sure you knew. I tried to hunt it down, but got a bit lost | ||
v6 is a tiny bit of code ;-) | |||
17:55
eden_c joined
|
|||
fglock | ajs_: the place to start is Grammar::Term.pm, line 299 - 'my' => ... | 17:56 | |
ajs_: tiny as in compact? | |||
17:56
rodi joined
|
|||
ajs_ | That was sarcasm. I found it difficult to find the error would be the more useful way to state it | 17:57 | |
TreyHarris | < Juerd> TimToady: Given this syntax, how would you promise that the members of said Array are of MyType? | 18:01 | |
Juerd: I'm not TimToady, but isn't "Array of MyType" what you want? | |||
Juerd | TreyHarris: Can that be used with "does"? | 18:04 | |
TimToady | I presume he's referring back to the "does Array; does Str". In which case Array of Mytype ought to turn into "does Array[:of(MyType)]". | ||
Juerd | class Foo { does Array of MyType; } | ||
Ahh | |||
TimToady | just generic instantiation. | ||
fglock | kolibrie: that example works with v6.pm r13535 | ||
Juerd | Thanks | ||
This clears that up | 18:05 | ||
svnbot6 | r13535 | fglock++ | v6 - $/ is initialized to undef at runtime | ||
TreyHarris | TimToady: yes, we probably don't need an Eager type. But I think some way (even a no-op eager role so you can say C<is eager>) would be useful for documentation. "Note: foo will expand the list, so do not pass it an infinite (or very long) list" is easy to get lost, it'd be nice if eagerness could be documented in the signature | ||
TimToady | and if you just say "does Array" it presumably autoinstantiates with Any or something. | ||
TreyHarris | How does Array[:of(MyType)] differ from 'Array of MyType' or 'Array[MyType]'? | 18:06 | |
TimToady | TreyHarris: that's the main reason for keeping it there, though I suppose we could just have "is eager" as a trait. | ||
Juerd | TimToady: I found while I was writing some pseudocode that types provide great documentation. I just found myself looking for a way to express this :) | ||
TimToady: In that respect, I think I'm fully convinced about types now :) | |||
kolibrie | fglock: awesome, thank you | ||
TimToady | the last assume :$of is the first positional parameter. | ||
*assumes | 18:07 | ||
kolibrie | with .xul slideshows, how to I specify a specific slide in the URL? | 18:08 | |
TimToady | and since that depends on how the role write writes the role, I thought I'd be more specific and use a named arg. | ||
TreyHarris | TimToady: right. | ||
TimToady | arguably it should be :of(:(MyType)) or :of(:(-->MyType)) though. | ||
TreyHarris | I don't care about Bertrand Meyer's invective, I like taxomania. I think an empty 'eager' role would be fine | ||
TimToady | unless we make types morph into sigs, which is likely. | 18:09 | |
lanny | :(-->MyType) isn't allowed at the moment. Can't have --> in :() literals. | ||
And I think as a signature :of(:(MyType)) is better. | 18:10 | ||
TreyHarris | Array of Employee is so nice though... I hope it will DWIM regardless of what it desugars into | ||
Hash of Potatoes... mmmm | |||
TimToady | Array of Choices | ||
rodi | Array of Sun... ahhhh | ||
Juerd | I was thinking of Hash of Web::Argument | ||
Or HTTP::Argument. Haven't made up my mind yet. | |||
[particle] | String of Puns | 18:11 | |
rodi | LOL | ||
Juerd | In any case, I want to get rid of the hideous param(), except for compatibility with modules. | ||
Not even for compatibility with people wanting param(). | |||
(Unfortunately, there's no way to enforce *that*) | |||
TimToady | make param a keyword. :) | 18:12 | |
Juerd | TimToady: How would that help? :) | ||
svnbot6 | r13536 | fglock++ | v6 - updated TODO, ChangeLog | ||
Juerd | The Perl 5 modules wouldn't realise it's a keyword? | ||
TimToady | get Nick to sneak it into 5.8.9 | 18:13 | |
kolibrie isn't sure if slide 16 is correct, particularly if <( )> is used, does $/ have just that captured section in the { return } block | |||
Juerd | Hehe | ||
TreyHarris | back to the earlier exchange between TimToady and ajs_... shouldn't global multis be documented together, wherever they originate from? (I realize in the general case that means you have to generate the documentation dynamically, but at least for the core API...) | ||
TimToady | $$/ has just that section. $/ still has the whole thing. | 18:15 | |
kolibrie | TimToady: ah, thank you | ||
fglock: you may have also noticed that I'm using .+? in rules (which currently isn't implemented in v6.pm) | 18:16 | ||
TimToady | TreyHarris: yes, but I wish we could find a way to do that without using bogus declaration syntax like Array::push. | 18:17 | |
fglock | kolibrie: yes, I was just going to tell you that | ||
nor <(...)> | |||
kolibrie | the troubles of writing a talk about bleeding edge technology | 18:18 | |
TimToady | there are a lot of obsolete talks down in docs/talks :) | 18:19 | |
ajs_ | TreyHarris: global multis should be documented together, that is a fair statement. | ||
TreyHarris | TimToady: does the =item *have* to be parseable as a valid signature and/or generated from the source file? if not, just add (defined in Array) | ||
fglock | kolibrie: otoh, things can be implemented on demand :) | ||
TimToady | that's what I've been doing at the top of each section. | ||
"the following are declared in the Num role/class." | 18:20 | ||
kolibrie | fglock: I don't want to be demanding, but it sure would be nice to have these implemented :) | ||
Juerd | TimToady: Can a class export subs? | ||
TimToady | but for the global listing, that's inside out | ||
TreyHarris | TimToady: right, but for multis whose implementations are shared between several role/classes, put them together but say which role/class it comes from after each sig | ||
ajs_ | Yeah, and the API documents are just placeholders that will be wrapped up into those roles/classes when they are written | ||
Juerd | TimToady: Or does that require a module and a class of the same name? | ||
ajs_ | TreyHarris: That is exactly what we do | 18:21 | |
in S29 | |||
TimToady | A class is a module so can export subs. | ||
Juerd | Great | ||
TimToady | Nowadays you can even export methods | ||
TreyHarris | Juerd: 'is export' is attached to methods in S29 | ||
TimToady | which turn into multis. | ||
Juerd | Export... methods :) | ||
18:21
mako132 joined
|
|||
Juerd | That takes away my explanation of roles! :) | 18:21 | |
TimToady | push(@array: @list) vs push(@array, @list) | ||
Juerd has so far explained roles in terms of exportation | |||
TreyHarris | ajs_: it is exactly what you do? what's an example, I'm looking at S29 now | 18:22 | |
TimToady | our Int multi method push ( @array: *@values ) is export | 18:23 | |
ajs_ | We do that for everything. Everything that is global is listed there. There are still some methods and other junk that need to be moved out into API docs, but basically, what's in S29 are "Functions", as the title suggests. The global ones that are exported | ||
Juerd | TimToady: Can "is export" be in the block, like in class Foo { is Bar; }? | ||
ajs_ | We don't add in "is export" typically, as that is assumed to be a part of anything in S29. | 18:24 | |
fglock | kolibrie: 'token metasyntax {}' in Pugs::Grammar::Rule2 works with nested xml-like markup, maybe it helps | ||
TreyHarris | ajs_: sorry, i mean what's an example of multis defined in different places being listed together but with each sig's origin mentioned? | ||
ajs_ | Which we should state explicitly | ||
Juerd | Part of "anything"? | ||
TreyHarris | ajs_: part of any sub, surely, but not part of any method? | ||
ajs_ | TreyHarris: Every function mentions its package explicitly in the signature | ||
TimToady | Hash vs Array reverse | ||
ajs_ | TreyHarris: Methods in S29 are an anachronism, and are being removed. They are not "Functions", which is what the document is about. | 18:25 | |
TreyHarris | oh, wild. so our 'Int multi method push ( @array: *@values ) is export' is defined in Int? I would have thought they'd be defined in Array | ||
TimToady | I'm going exactly the opposite direction and installing methods into S29 | ||
no, that's the return type | |||
not the method's class | |||
TreyHarris | ajs_: ==TimToady. I'm very confused. | ||
ajs_ | TimToady: we should talk... | 18:26 | |
;) | |||
TreyHarris | ok. I'll let you two talk :-) my point was just that all multi subs/methods called <push> should be listed together, but they should say where the package they come from, as separate from type and not resorting to the incorrect multi Package::push syntax. | 18:27 | |
TimToady | audreyt and I cooked up the method is export thing some time ago to get rid of the mutual fallback model. | 18:28 | |
ajs_ | audreyt's request, which spawned all of this, and which I mentioned way back when on the list was this: (paraphrase) remove the methods and constants from S29 because they aren't actually part of the Functions list that S29 is setting out to update the reader on. Put them in API documents that define the classes and roles used. | ||
Juerd repeatedly reads "TreyHarris" as "TimToady" and vice versa. | |||
Apparently my brain only sees "T[a-z]+[A-Z][a-z]+" | |||
TreyHarris | Juerd: good for me, perhaps, not so good for TimToady ;-) | ||
ajs_ | TimToady: Ok, so what's a method that is export? | ||
TimToady | push | ||
Juerd | Which in Perl 6 regex would be... OMG... T<[a-z]>+<[A-Z]><[a-z]>+ | 18:29 | |
ajs_ | Sorry, was asking what it means | ||
Juerd | Do we have <lower> and <upper>? :) | ||
TreyHarris commutes & | |||
ajs_ | does it mean "this method also defines a function of the same name" or does it mean something more clever? | ||
Juerd | TreyHarris: Smart, to commute in the background! Then you can still be active here! :) | ||
TimToady | It's a multi that happens to wrap a method, for things that want to muddy the waters, such as abs($x) vs $x.abs | 18:30 | |
Juerd | If a method can be exported as a multi - can a class import from itself, to get the multis? | ||
[particle] | juerd: yes, we have <upper> and <lower>, as well as <alpha> <alnum> <ident> <digit> <xdigit> ... | 18:31 | |
Juerd | And why do I keep using " - "... | ||
Juerd uses it as a larger comma. | |||
TimToady | presumably it can just get the multis as globals like anyone else. | ||
Juerd | [particle]: Good | ||
[particle] suggests => | |||
Juerd | T<lower>+<upper><lower>+ | ||
Much better. | 18:32 | ||
[particle] | i'm going to have trouble converting my fat comma usage to p6 | ||
ajs_ | Ok, that sounds reasonable, and justifies methods being in S29, IMHO. However, there is perhaps a level of detail at which it makes sense to talk about classess and roles, not "functions". It is at that level of fuzzy detail that I propose to remove things from S29 into API docs. One such example being constants. Is that fair? | ||
Juerd | Can we write the + inside the <> without breaking it? | ||
[particle] | juerd: not as currently specced | ||
Juerd | [particle]: I'm already having trouble reading Perl 5 code with fat arrow in non-pair context. | ||
Juerd has not really used Perl 5 for a while. | |||
ajs_ | Juerd => what do you mean by that? | 18:33 | |
Juerd | My brain is almost constantly in Perl 6 mode. | ||
TimToady | do you mean + as in **{1..*}? | ||
Juerd | ajs_: That I interpret that as :Juerd<"what do you mean by that?") | ||
[particle] | <lower>+ =?= <lower+> # i say no | ||
Juerd | TimToady: Yes, though in practice I'm going to munge Perl so that it uses something other than **{} | ||
TimToady | the + in <lower+upper> would be a different + | ||
Juerd | Ah, good point. | 18:34 | |
ajs_ | TimToady: The other option, if you feel that EVERYTHING should be in S29 is to just re-merge the API docs and go back to working on just S29, but you should stake out some territory in there so that I can work around you. | ||
TimToady | well, one big problem is that there really is almost no such thing as a function anymore | 18:35 | |
lanny | Dang. Thought so. I do not understand how the prelude works. | ||
TimToady | it's all multis and methods | ||
ajs_ | So, we say that S29 is "all core-module-default-exported multis and methods" | 18:36 | |
? | |||
TimToady | something like that | ||
in fact, I put a remark remarkably like that near the top of S29 | 18:37 | ||
Juerd | TimToady: Why have singles anyway? | ||
ajs_ | Ok, so any method not exported as a multi or any multi which is not exported (especially :UNI aliases) will go into the API docs? | ||
TimToady | singles are mostly for hiding all multies of the same short name. | ||
and to give the user a way of future proofing their program against future multi additions. | 18:38 | ||
Juerd | Hm | ||
TimToady | proto fills the same role if the user wants to write their own future-proof set of multis. | 18:40 | |
ajs_ | hmm | 18:41 | |
TimToady | you leave out the proto if you just want to intermingle with any future multis | ||
ajs_ | multi sounds increasingly like the useful default. If it wasn't required in many cases to clarify the function definition, I would say that we should toss it and make it the default. | 18:42 | |
TimToady | multi depends crucially on types, and types are optional | ||
ajs_ | right | 18:43 | |
TimToady where are you updating S29? | 18:44 | ||
In the pugs repo? | |||
TimToady | docs/Perl6/Spec/Functions.pod | ||
Also, singles can easily be inlined. | 18:46 | ||
ajs_ | Good, thanks. | ||
TimToady | I just wish I didn't keep typing mutli | 18:47 | |
too much music going through my corpus collasum to send typing signals through, i guess. | 18:48 | ||
svnbot6 | r13537 | fglock++ | Pugs-Compiler-Rule - added <(...)> to the grammar - "capture_as_result" | ||
TimToady | or however you spell that... | 18:49 | |
fglock | callosum :) | ||
ajs_ | OK, so another topic: macros. I keep arm-waving around them because it's not clear to me exactly how they'll manipulate ASTs, and at what level of granularity. Are we far enough down the road that examples could be added that demonstrate this, or do we need a more complete implementation? | ||
18:49
bernhard joined
|
|||
fglock | ajs_: we don't have a standard/portable AST yest | 18:50 | |
yet | |||
TimToady | he, according to google there's really no agreement on how to spell it. | 18:51 | |
it finds lots of results for various spellings | |||
kolibrie | fglock: you are suggesting using token metasyntax in place of .+? | ||
ajs_ | fglock: Well, that's kind of what I'm getting at. If macros are only going to touch ASTs at a very high level, then we can just work with very general subrule names as AST fields. However, if macros will be able to / expected to portably manipulate everything, then there's a lot more work there. | 18:52 | |
[particle] | callosum is latin for tough | 18:53 | |
fglock | kolibrie: that's in the case you want to parse xml; '.+?' is easier to write | ||
TimToady | basically, all the implementors of Perl 6 have to converge on an AST definition. I am not one of them. :) | ||
kolibrie | fglock: I'll go for easier to write for this talk, I think | ||
[particle] | fglock: pmichaud's working on ast as we speak | ||
TimToady | so one side of my brain thinks it's tough, while the other side of my brain thinks it's huge | 18:54 | |
fglock | [particle]: yes - gaal has been working on it too | ||
[particle] | fglock: ah, i thought you were. i'll get them in touch with each other. | 18:55 | |
TimToady: one side of your brain is pretty small, then | |||
fglock | [particle]: I am, but I'm writing just enough to have v6.pm working - it can be changed | 18:56 | |
TimToady | it == corpus c[ao]l+os+e?um | ||
ajs_ | Would it be out of line for me to write up an API doc for macro to define what it is that macros will expect of the various ASTs at a high level? | ||
TimToady | it wouldn't be out of line to take a first whack at it, I wouldn't think. | 18:58 | |
ajs_ | TimToady: As long as your corpora cavernosa aren't doing the thinking, you're fine. | ||
fglock | ajs_, [particle]: see docs/notes/p6ast_draft - this was written very early in the v6.pm development, and it was not updated - but some ideas may still work | 18:59 | |
ajs_ | fglock: I'll have a look | ||
TimToady | ads_: I'm not sure it makes a vas deferens | 19:00 | |
[particle] | fglock: thanks | ||
ajs_ | ouch | ||
19:10
vel joined
19:15
eden_c left
|
|||
svnbot6 | r13538 | fglock++ | Pugs-Compiler-Rule - implemented <(...)> in Token/Rule | 19:19 | |
19:23
rlb3 joined
19:26
buubot joined
|
|||
svnbot6 | r13539 | fglock++ | Pugs-Compiler-Rule - implemented <(...)> in Regex | 19:34 | |
19:36
fglock joined
|
|||
svnbot6 | r13540 | fglock++ | Pugs-Compiler-Rule - ChangeLog update | 19:36 | |
kolibrie | fglock: do you have any tips/code samples for converting my match object into a YAML structure with: rulename: captured_value | 19:57 | |
19:59
Limbic_Region joined
|
|||
kolibrie | fglock: I think I want some kind of emitter, like Pugs::Emitter::Rule::Perl5, but in Perl 6, and shorter | 20:02 | |
fglock | kolibrie: the .perl method makes a dump, but this is not what you want | 20:03 | |
kolibrie | correct, I just want a very small part of the match object | ||
fglock | $$/.perl should work, but it is currently a parser error in v6.pm | 20:07 | |
svnbot6 | r13541 | fglock++ | Pugs-Compiler-Rule - version 0.18 in cpan | ||
fglock | this works, but I'm not sure it is correct: perl -Ilib -e 'use v6-alpha' - ' my $content = "xyz"; $content ~~ /<alpha> { return [42] } /; say $/().perl ' | ||
kolibrie | I'd like to coerce that to pretty yaml (rather than .perl) | 20:09 | |
pugs builtin .yaml is also too verbose | |||
fglock | would you hack .yaml into the v6 runtime? | ||
look for 'sub perl' into Pugs::Runtime::Perl6 - it's plain perl5 | 20:11 | ||
glasser | can somebody remind me what the status quo for ghc on intel mac is? | ||
(preferably darwinports based?) | |||
Limbic_Region | ?seen audreyt | ||
lambdabot | audreyt is in #perl6, #ghc and #haskell. I last heard audreyt speak 18h 44m 59s ago. | ||
kolibrie | well, perhaps, but I don't understand the pugs output structure for .yaml, and don't really want that structure | ||
fglock | kolibrie: rev 13542: perl -e 'use v6-alpha' - ' my $content = "xyz"; $content ~~ / { return [42] } /; say $$/.perl ' | 20:15 | |
svnbot6 | r13542 | fglock++ | v6.pm - implemented $$/ | ||
kolibrie | fglock: ah, very nice | 20:16 | |
kolibrie svk pulls | |||
20:16
cognominal joined
|
|||
svnbot6 | r13543 | fglock++ | v6.pm - ChangeLog update | 20:20 | |
fglock | kolibrie: btw, if you update PCR, this will work now too: my $content = "xyz"; $content ~~ / x <(y)> z /; say $$/.perl | 20:21 | |
20:21
_bernhard joined
|
|||
kolibrie | fglock: oh, thank you! | 20:22 | |
fglock | kolibrie: np | ||
kolibrie | fglock: is v6.pm the one in perl5/Pugs-Compiler-Perl6/lib? | 20:25 | |
fglock | kolibrie: yes | ||
kolibrie | ok | ||
fglock | which yaml module should v6.pm use for .yaml() and eval( :lang<yaml> ) ? | 20:27 | |
Limbic_Region | FYI all - smoke server is currently giving a 500 error | ||
20:27
[mago] joined
|
|||
Limbic_Region | and now it is back - nevermind | 20:27 | |
kolibrie | fglock: audrey usually uses her YAML::Syck module | ||
I think | |||
fglock | k | 20:28 | |
bbiab & | |||
20:29
Odin-LAP joined
20:30
elmex joined
|
|||
rodi | Is it true that anything that could be expressed by a rule could also be expressed by a token? | 20:36 | |
pasteling | "kolibrie" at 66.239.158.2 pasted "fglock: /me is having technical difficulties (v6.pm)" (17 lines, 673B) at sial.org/pbot/19855 | 20:38 | |
kolibrie | fglock: but I'm more worried about my talk than my v6.pm installation | ||
TimToady | rodi: yes, you'd just have to be explicit about whitespace | ||
rodi | TimToady: thanks, I think it all just came clear. Both, in turn, could theoretically be expressed as regexen (w/out using backtracking)? | 20:39 | |
[particle] | rodi: token == regex :ratchet ; rule = regex :ratchet :sigspace ; so token = rule :sigspace | 20:40 | |
err. rule = token :sigspace | 20:41 | ||
fglock | kolibrie: perl Makefile.PL should fix this (old date in the cache) | ||
rodi | Man, S05 is dense. I see it now that I /'ed for ratchet. | ||
kolibrie | fglock: then make and install? | 20:42 | |
fglock: it skipped all files, claiming they were unchanged | 20:45 | ||
fglock | kolibrie: just running Makefile.PL might be enough, it calls $cache->Clear | ||
maybe 'make clean' too | 20:46 | ||
that will delete old '.pmc' files | |||
kolibrie | fglock: hmm, didn't seem to do anything | 20:49 | |
fglock | kolibrie: please make install both Pugs-Compiler-Rule and Pugs-Compiler-Perl6 - it seems to be using incompatible versions of runtime/emitter | 20:51 | |
kolibrie | fglock: /me re-installs Pugs-Compiler-Perl6 | 20:53 | |
rodi | my make smoke (r13538) is hanging indefinitely on t/xx-uncategorized/rule_recursive.t | 20:54 | |
mmm, looks like it is recursing forever on test 9: ok "x" ~~ /<r>$/, '"x" ~~ /<r>$/ matched'; | 20:59 | ||
fglock | rodi: yes, I've seen it | ||
rodi | fglock: good stuff. I think recursing on a recursion test is a step forward from just failing :-D | 21:02 | |
fglock | rodi: :) - it's an error in the internal calling parameters, needs some more debugging | 21:04 | |
kolibrie | fglock: ha! my v6.pm is working again. Thank you! | ||
fglock | kolibrie: :) | 21:05 | |
kolibrie | I added some handwaving to my talk (slide 21). If anyone can help me show how to convert my $match object into the YAML on the following slide, that would be great | 21:06 | |
fglock | kolibrie: I'm working on it | 21:07 | |
kolibrie | fglock: you're awesome! | ||
kolibrie thought that maybe some other people would like credits in my talk, too | 21:08 | ||
21:13
frederico joined
|
|||
svnbot6 | r13544 | fglock++ | v6 - added .yaml() method | 21:21 | |
r13544 | fglock++ | perl -Ilib -e 'use v6-alpha' - ' my $content = 123; say $content.yaml ' | |||
r13544 | fglock++ | --- 123 | |||
21:31
[mago] joined,
frederico joined,
elmex joined,
Odin-LAP joined,
fglock joined,
buubot joined,
rlb3 joined,
mako132 joined,
BooK_ joined,
penk joined,
streakceur joined,
araujo joined,
Patterner joined,
mauke joined,
justatheory joined,
mdiep joined,
dakkar joined,
cjeris joined,
crem joined,
KingDiamond joined,
zeriod joined,
kane-xs_ joined,
iblechbot joined,
masak joined,
ayrnieu joined,
weinig|away joined,
avar joined,
azr|el joined,
scw joined,
ludan joined,
kane-xs joined,
marmic joined,
f0rth joined,
Qiang_ joined,
plural joined,
xerox joined,
ajs_ joined,
idiotmax joined,
ruz joined,
lisppaste3 joined,
stevan joined,
webmind joined,
gugod joined,
baest joined,
mtve joined,
ofer0 joined,
Eidolos joined,
nothingmuch joined,
wilx joined,
jdv79 joined,
theorbtwo joined,
glasser joined,
lampus joined,
miyagawa_ joined,
thepler joined,
lumi joined,
TimToady joined,
cookys joined,
szabgab joined,
amv joined,
norageek joined,
[particle] joined,
Khisanth joined,
c6rbon joined,
gaal joined,
revdiablo joined,
PerlJam joined,
pjcj joined,
xinming_ joined,
evalbot_r13533 joined,
buu joined,
autark joined,
xern joined,
frankg joined,
mollmerx joined,
LCamel joined,
dvorak joined,
spoop joined,
Yappo joined,
rafl joined,
Teratogen joined,
silug joined,
perlbot joined,
prism joined,
drbean joined,
rafl_ joined,
spinclad joined,
nine joined,
hcchien joined,
cj joined,
kolibrie joined,
orafu joined,
statico joined,
jabbot joined,
Southen joined,
meppl joined,
gantrixx joined,
kalven joined,
svnbot6 joined,
Grrrr joined,
ajs_home joined,
nnunley joined,
takanori_ joined,
nperez joined,
ingy joined,
qmole joined,
TreyHarris joined,
Maddingue joined,
notsri joined,
kcwu joined,
pmurias joined,
broquaint joined,
clkao joined,
obra joined,
wolverian joined,
audreyt joined,
jiing joined,
cmarcelo joined,
rgs joined,
leo joined,
chip joined,
pmichaud joined,
Juerd joined,
Shabble joined
21:34
Limbic_Region joined
|
|||
svnbot6 | r13546 | fglock++ | Pugs-Compiler-Rule - added support for $/.yaml | 21:34 | |
fglock | $$/.yaml is not going to work for a while - it needs more work at the v6.pm runtime side | 21:35 | |
svnbot6 | r13547 | fglock++ | v6.pm - ChangeLog update; Makefile.PL recommends 'YAML::Syck' | 21:40 | |
TreyHarris | glasser: re your earlier query on ghc for darwin/intel: what was your understanding of the prior status? i know something of status, but it's a few weeks old | 21:47 | |
glasser | TreyHarris: Oh, I'm quite out of date | 21:48 | |
mostly just knew that "port install ghc" doesn't work :) | 21:49 | ||
TreyHarris | glasser: see cvs.haskell.org/trac/ghc/wiki/X86OSXGhc | ||
lambdabot | Title: X86OSXGhc - GHC - Trac, tinyurl.com/za42p | ||
TreyHarris | if you search for "audreytang" on that page, that one should work for you, it does for others | ||
(I will find out tonight, just got an intel mac) | 21:50 | ||
glasser | right, i knew she had done something | ||
TreyHarris | er... maybe tomorrow, knowing how long ghc can take to build from source | ||
glasser | Oh cool, there's a build from last week too | ||
TreyHarris | no readline...\ | 21:51 | |
which is a must for pugs, IMHO... but i'm a pushover for arrow keys ;-) | |||
glasser | well, won't readline install with dports? | ||
TreyHarris | glasser: hm. maybe. getting readline support into ghc is a black art AFAICT | 21:52 | |
the distribs usually figure themselves out, but the nightly builds never do | |||
glasser | but 6.6 is almost out right? | 21:53 | |
svnbot6 | r13548 | fglock++ | v6.pm - fixed '$$/.yaml' | ||
TreyHarris | glasser: i don't know. i'm sure they'd be able to tell you something better on #haskell | 21:56 | |
21:57
ruoso joined
|
|||
fglock | kolibrie: the "magic hand waving" part needs coercing Match into Str | 22:04 | |
kolibrie: otherwise, something like this should work: | |||
perl -Ilib -e 'use v6-alpha' - ' my $content = "xyz abc"; $content ~~ / <ident> \s <ident> { return $<ident> } /; say $$/.yaml ' | |||
kolibrie: it currently outputs 2 Match objects, instead of 2 plain strings | 22:05 | ||
22:11
Aankhen`` joined
22:24
mako132_ joined,
beppu_ joined
22:31
beppu_ joined
22:53
Aankh|Clone joined
|
|||
TreyHarris | Juerd: I was thinking about what TimToady wrote to you, and it seems to me that "@items X~X ','" or [email@hidden.address] *would* be the most obvious way to write such a thing... i guess you'd have to write '"{@items.join(',')}," to get it to work even for zero items... | 22:57 | |
22:59
buetow joined
23:02
cjeris left
23:03
Aankh|Clone joined
23:10
SubStack joined
|
|||
TimToady | maybe we need @items.unchop(",") or something. :) | 23:12 | |
23:12
Aankhen`` joined
|
|||
TimToady | j | 23:13 | |
oops | |||
Juerd | TreyHarris: I don't remember discussing joining... | 23:14 | |
Ah, hadn't read that reply yet | 23:15 | ||
TimToady: Normally, code generators do join. That is, mine do. Because in regexes (?:foo|bar|) hurts, and I'm afraid of similar hurting elsewhere :) | 23:16 | ||
If [()] is an empty slice, that's perfect. It just means putting parens around the list, and that's easier than special casing. | |||
I generally join on ",", because you need to join anyway. | 23:17 | ||
TreyHarris | or ", " if you want to print more prettily... | ||
Juerd | s/I/I expect I will/ | ||
TreyHarris: I don't need generated code to be pretty. I don't look at it except for debugging. | |||
Juerd has this weird habit of generating code and eval'ing it, because it's very often the easiest and fastest way to do something. This includes runtime :) | 23:18 | ||
TreyHarris | ah... i always pipe my generated code through Perl::Tidy, but I'm a little anal retentive in such things :-) | ||
Juerd | I'm not spending CPU cycles on tidy'ing if the code is thrown away. | ||
The point of translating something to Perl code is efficiency in the first place. | |||
TimToady | I'm just saying maybe we're missing something in the method syntax. with join(',', @x, '') it's easy in P5, but .join(',') doesn't make it so easy | 23:19 | |
TreyHarris | ohhhh. yes, i rarely do that. if i'm generating code, it's getting written to, and some sysadmin somewhere is going to look at it when things are in flames, so i want it to be at least somewhat legible | ||
TimToady | (@x,'').join(',') | ||
TreyHarris | TimToady: that's not bad. | ||
Juerd | We have ~ now, that joins things too | ||
TreyHarris | ?eval my @x = 1..3; (@x,'').join(", ") | ||
23:20
evalbot_r13533 is now known as evalbot_r13548
|
|||
evalbot_r13548 | "1 2 3, " | 23:20 | |
Juerd | ~map { "$_," }, @x | ||
?eval my @x = 1..3; [@x,''].join(', ') | |||
evalbot_r13548 | "1, 2, 3, " | ||
Juerd | ?eval my @x = 1..3; ~map { "$_," }, @x | 23:21 | |
evalbot_r13548 | "1, 2, 3," | ||
TreyHarris | ?eval my @x = 1..3; ~@x.map:{ "$_," }, @x | ||
d'oh! | |||
evalbot_r13548 | ("1, 2, 3,", [1, 2, 3]) | ||
Juerd | Heh. | ||
Hm, @x isn't passed to map? | |||
Alternatively, Hm, @x isn't flattened? | 23:22 | ||
TreyHarris | i've done that fairly frequently. i start typing a methodized form that was a builtin in perl 5, and before i get to the end i've forgotten that i'm using a method | ||
TimToady | should be. though perhaps .map is ignoring additional args? | ||
Juerd | TimToady: Then I'd still expect some flattening | ||
TreyHarris | ?eval my @x = 1..3; ~(@x,@x).map:{ "$_," } | ||
evalbot_r13548 | "1 2 3, 1 2 3," | 23:23 | |
TimToady | looks more like :{...} is still be analyzed as an adverb rather than as : {...} | ||
TreyHarris | ?eval my @x = 1..3; ~{ "$_," }.map(@x, @x) | ||
evalbot_r13548 | "1, 2, 3, 1, 2, 3," | ||
TreyHarris | ahh. | ||
TimToady | ?eval my @x = 1..3; ~@x.map: { "$_," }, @x | ||
evalbot_r13548 | Error: Cannot cast from VList [VCode (MkCode {isMulti = False, subName = "<anon>", subType = SubBlock, subEnv = Just (MkEnv {envContext = CxtSlurpy (mkType "Any"), envLValue = False, envLexical = MkPad (padToList [("@x",[(<ref:0xb79781ac>,<ref:0xb797819c>)]),("$_",[(<ref:0xb78e3c18>,<ref:0xb78e3c08>)]),("$?1",[(<ref:0xb7996e0c>,<ref:0xb7996dfc>)]),("$__evalbot_print",[(<ref:0xb6d30c44>,<ref:0xb6d30c34>)])]), envImplicit = {"$_":=()}, envGlobal = < | ||
TreyHarris | whoops :-) | ||
Juerd | BTW, While writing up my Web toolkit pseudocode, I really loved Perl 6 much again | 23:24 | |
A few lines of code. So consise, so well suited to express thoughts in. | |||
23:24
polettix joined
|
|||
TimToady | looks like the compiler catches the fact that .map only wants one arg if you do : {...} | 23:24 | |
TreyHarris | ?eval my @x = 1..3; ~@x.map: { "$_," } | ||
TimToady | it seems to have a nice texture | ||
evalbot_r13548 | "1, 2, 3," | 23:25 | |
TimToady | the words and the non-words seem to play off each other pretty well | ||
Juerd | TimToady: Indeed. I can really appreciate the syntax | ||
Though lines tend to get longer. I need to revisit my line wrapping style. | 23:26 | ||
TreyHarris | TimToady: you do have to slide into the gestalt, though. i've noticed that some folks on here seem to be fighting every new thing, instead of seeing the normalization that makes it all so beautiful. braces are closures. no, really, they are. yes, even there. :-) | ||
Juerd | And my 80 character limitation. | ||
TreyHarris shudders. | |||
Juerd | TreyHarris: Curlies encloding code scares some people even in Perl 5 :) | 23:27 | |
TreyHarris | Juerd: I've been wrapping every test I'm modifying anyway to 76 columns ;-) | ||
TimToady | I try to stay within 80 columns too. | ||
Juerd | See recent p5p re ${code; code;} | ||
TimToady: I find it harder with Perl 6. | |||
TimToady | 'cuz the methods cascade? | ||
Juerd | Mostly for declarations. | ||
TimToady | ah | 23:28 | |
Juerd | I find it very beautiful when the has'es line up without vertical whitespace. | ||
But that's hard if you want to "handles" too. | |||
TimToady | I expect we'll see a lot of linebreaks right before the declared word, as in C. | ||
TreyHarris | Oh, dear. Declarations have to all be on one line? | ||
TimToady | nah. | ||
Juerd | TreyHarris: No | ||
TimToady | our Lazy multi method | 23:29 | |
foo (...) | |||
Juerd | has Some::Type $.foobarbaz handles <foo bar baz quux xyzzy but_most method_names are_actually much_longer>; | ||
That really needs the handles thing on a different line, but that breaks a structure that I like so much. | |||
TimToady | I'm sure we'll see a lot of vertical <...> things. | ||
Juerd | Splitting it to another statement is bad too, because then I'd have to repeat the attribute name | 23:30 | |
polettix | I know it's a bit unpolite to jump in the middle of a conversation, but I was wondering if the "~" in "~@x.map: { ... }" is really that necessary (from a linguistic point of view) | ||
pasteling | "TreyHarris" at 207.171.180.101 pasted "line-broken sigs" (16 lines, 530B) at sial.org/pbot/19858 | ||
Juerd | If I put the <> list, or part of it, on another line, the horizontal lineup for $.foobarbaz and handles no longer makes sense. | ||
And things start to look like a mess. | |||
TimToady | handles q:w:to/END/ | ||
Juerd | TimToady: I don't mind the <>, multiline. | 23:31 | |
TreyHarris | I wrote the above a bit ago, though as of yesterday's discussion I realize my parameterized types are now no good | ||
and I guess * needs to be written Whatever in a type declaration.... | |||
Juerd will just treat <> like () and {} | |||
has Some::Type $.foobarbaz handles < | |||
TimToady | there are times we probably want to distinguish * from Whatever. | ||
Juerd | foo bar baz | ||
quux xyzzy but_most | |||
... | |||
>; | |||
TimToady | q:w:to/END/ | 23:32 | |
foo | |||
bar | |||
baz | |||
END | |||
Juerd prefers <...> then, TimToady | |||
TimToady | I like to see the ; on the first line. | ||
Juerd | I'm apathetic about ; placement, as long as it terminates things rather than prefix them :) | 23:33 | |
TimToady | speaking of .join(';')... | ||
Juerd used to care, until he started to indent () like: | 23:34 | ||
TreyHarris | polettix: they would be different. without the initial ~, you'd get: | ||
Juerd | foo.bar.baz( | ||
$arg1, | |||
$arg2, | |||
); | |||
TreyHarris | ?eval my @x = 1..3; @x.map: { "$_," } | ||
evalbot_r13548 | ("1,", "2,", "3,") | ||
polettix aaaaah-s | |||
TreyHarris | the ~ concats them together into a single string. | ||
TimToady | ?eval my @x = 1..3; @x.map: { "$_," }.join | 23:35 | |
evalbot_r13548 | "1,2,3," | ||
TreyHarris | Juerd: yes, that's what I was going to say about my paste, I've started to do that too. line up vertically rather than cascading like we usually see in perl 5 | ||
polettix | but how are those ":" make our golf better than ruby? | ||
23:35
Aankh|Clone joined
|
|||
TreyHarris | hmm... when would ~listy be different from listy.join? i can't think of a case right off, but they are rather different operations, so maybe one could construct one... | 23:36 | |
Juerd | TimToady: I still want symmetry between split and join, i.e. that join defaults to whitespace. | 23:37 | |
TimToady | the : means you don't have to use () on your args if there are any. | ||
TreyHarris | polettix: hyperops are way easier than .reduce { |x| .... } ;-) | ||
Juerd | And ~list joining on null string makes more sense to me anyway | ||
TimToady | Juerd: check Functions and you'll see it currently defaults to ' ' | 23:38 | |
Juerd | TimToady: Ah, cool. | ||
TimToady | pugs is behind the times. | ||
TreyHarris | s/hyper/meta/ | ||
Juerd | ++ :) | ||
polettix | eheh, good then | ||
Juerd | TimToady: Then perhaps it's useful to make ~ join on empty string? | ||
TimToady | [~] does that. | 23:39 | |
Juerd needs serious tuits, and to reread docs. | |||
TimToady: Good point. | |||
But why would ~ join on space? | |||
TreyHarris | ?eval my @a = 1..3; "{~@a}::{[~] @a}" | ||
evalbot_r13548 | "1 2 3::123" | ||
TimToady | for consistency with all the other stringified arrays. | ||
Juerd | Oh, right, interpolation does this too. I tend to forget about stringification of arrays. | 23:40 | |
Juerd uses it in golf only :) | |||
TreyHarris | Juerd: yes, of course, i could have written | 23:41 | |
?eval my @a = 1..3; "@a::{[~] @a}" | |||
evalbot_r13548 | "\@a::123" | ||
Juerd | TreyHarris: Compare: ~list.blah list.join.blah | ||
TreyHarris | ?eval my @a = 1..3; "@a[]::{[~] @a}" | ||
evalbot_r13548 | "1 2 3::123" | ||
TreyHarris | but i was trying to make the ~ thing explicit | ||
Juerd | TreyHarris: The former says "stringify whatever comes", the latter says "stringification is just a step in the process" | ||
TreyHarris: I wasn't referring to your code examples re interpolation, but to Larry's point about stringification. | 23:42 | ||
TreyHarris | Juerd: yep... i got that. but i was thinking about a single token like C<listy> | ||
Juerd | TreyHarris: For single tokens it's mostly a matter of expression. | ||
TreyHarris | i guess listy could override stringification but not join(). | ||
er, whatever listy returns rather. | 23:43 | ||
Juerd | I'll use ~ and + much to mean "scalar". | ||
That is, "item". | |||
TreyHarris | *nod* yes. self-documentation is good. | ||
Juerd | Whereas join is explicit concatenation. | ||
Something could return something different from a joined string in scalar context! | 23:44 | ||
TimToady | @foo.cat for @foo.join('') and @foo.cat(',') for @foo.join(',') ~ ',' maybe | ||
lambdabot | Unknown command, try @list | ||
Juerd | TimToady: I think map suffices | ||
TimToady | by that argument we get scheme. | ||
Juerd | [~] @foo Ā»~ "," | 23:45 | |
And by this argument? I wonder what language has all this ;) | |||
TreyHarris | Juerd: oh, speaking of self documentation, were you the one who said you didn't understand my point about self-documentation in captures? I was basically just saying that if I have ($lots, $of, :$args, :$in, :$my, *@signature) and i wanted to use a .call later, i'd have to repeat .call(\($lots, $of, :$args...)), and it would be tempting to just change my sig to (\$args) so I can just .call($args) | ||
Juerd | TreyHarris: Not that I can recall. | 23:46 | |
23:46
awwaiid joined
|
|||
TreyHarris | can't remember whom... | 23:47 | |
ah, ok. somebody was saying they didn't understand why i said that having to repeat all your args to get a capture of your args could lead to a loss of self-documentation. | |||
ok, time to go home and set up the new mac. hopefully i'll be doing a smoke-compile-smoke cycle in less than an hour by this time tomorrow... | 23:48 | ||
TimToady | that's why we have |args that now just takes a snapshot en passant. | ||
Juerd | TimToady: Ah, so $ and @ can be infix now? | ||
Yay, larger alphabet :) | |||
TreyHarris | TimToady: yep, it's a good compromise, like ($myself:). | ||
Juerd | OTOH, 3|4 was nicely tight. | 23:49 | |
TimToady | still is. | ||
TreyHarris is not stating that he is a good compromise.... | |||
TimToady | that | is where an operator is expected. | ||
Juerd | Ah | ||
foo|4 then :P | |||
TimToady | no ambiguity | ||
Juerd | But that's bad style anyway. | ||
TimToady | see my reply to ajs in p6l on that. | 23:50 | |
23:50
weinig|away is now known as weinig
|
|||
Juerd | Will do soon. I'm lagging behind on p6l. | 23:50 | |
Have been spending some time on p6u. | |||
TimToady | noticed that. :) | ||
TreyHarris | would |4 be legal for \4? | ||
TimToady | no. | ||
that'd be like confusing C's * with & | 23:51 | ||
Juerd | Web programming is how I originally started using Perl. I'm very passionate about it, partly because Perl 6 enables some things that I have wanted for a long time. | ||
TimToady | |4 is no different from 4 | ||
TreyHarris | TimToady: I haven't finished reading your most recent synopsis changes introducing |, sorry | ||
Juerd | It took a while for me to realise that roles are exactly what I was looking for. Even when I asked people about why you'd use roles, I didn't get it yet. | 23:52 | |
TimToady | it's something we're all feeling our way into. | ||
Juerd | And roles combined with types just being classes... Splendid. | ||
TimToady | well, the proof will be in the pudding, as they say. | 23:53 | |
Juerd | Re that - is .[] a method or an op? | ||
TimToady | We'll just have to see how it all works out. | ||
TreyHarris | i thought the whole point of autoboxing is that you *could* ignore the difference between boxing and unboxing. but @(thing) "derefs" and then immediately array-ifies thing, so why wouldn't |(4) "de-sig" and then immediately capture-fy 4? | ||
TimToady | but | autointerpolates into its surroundings immediately like @, only more so. So you just end up with a 4 | 23:54 | |
TreyHarris | i mean, @(4) gives you (4,), not... | ||
ahhh | |||
yes. | 23:55 | ||
TreyHarris smacks his head | |||
Juerd goes to bed | |||
TimToady | post hoc... | ||
Juerd | 1:55am, alarm clock is set for 7:30 :( | ||
TreyHarris | TimToady: thanks. I'll go read the syn changes and write some tests and then it'll all make sense to me | ||
ergo propter hoc | |||
TimToady | seems like Juerd goes to bed when you smack your head. | 23:56 | |
TreyHarris | *because* i smack my head. post hoc ergo propter hoc. | ||
Juerd | So that must be why I'm going to bed. Right :) | ||
TimToady | *smack* | ||
23:56
jferrero joined
|
|||
Juerd | Funny is that I only yesterday first saw "post hoc ergo propter hoc". I looked it up on Wikipedia. I knew the fallacy, not its name. | 23:56 | |
Good night! | 23:57 | ||
TimToady | Good hoc! | ||
TreyHarris | videor habe potentum supra Juerdu... | 23:59 |