Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2006-09-21

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:11 weinig is now known as weinig|bbl
00:14 Qiang_ joined perl6
00:19 svnbot6 r13516 | lwall++ | Answer to sqrt question.
00:21 nekokak joined perl6
00:23 hikozaemon joined perl6
00:30 rodi joined perl6
00:31 vel joined perl6
00:40 plural_ joined perl6
00:50 Qiang joined perl6
00:52 mjk joined perl6
00:53 justatheory joined perl6
00:53 pen1 is now known as penk
01:01 svnbot6 r13517 | markstos++ | S29_spec.t: Add smart link and improve comment.
01:04 svnbot6 r13518 | markstos++ | mv t/xx-uncategorized/S29_spec.t t/builtins/type_declarations.t
01:04 svnbot6 r13518 | markstos++ | (Part of my secret plan to make the test structure layout more closely match
01:04 svnbot6 r13518 | markstos++ |  the spec layout)
01:04 svnbot6 r13519 | lwall++ | Tweaks to character types.  Ling and Graf are dead.
01:08 svnbot6 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 ;)
01:09 TimToady er, no, it's just the Char types.
01:20 mdiep joined perl6
01:23 svnbot6 r13521 | markstos++ | [t/operators] - two smart links and a comment.
01:31 Qiang_ joined perl6
01:33 mdiep joined perl6
01:36 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 tcliou joined perl6
01:37 TimToady yes
01:38 TreyHarris odd.
01:42 TimToady yes
01:54 mako132_ joined perl6
02:02 svnbot6 r13522 | markstos++ | Test.pm: The docs stated that "is_deeply" was a future future.
02:02 svnbot6 r13522 | markstos++ |  Clarify that some version of it works now.
02:12 mako132_ joined perl6
02:12 mako132_ joined perl6
02:13 svnbot6 r13523 | markstos++ | Test.pm - POD is further enhanced with "=head3" for each available function,
02:13 svnbot6 r13523 | markstos++ | so they are easily browsable after pod2html conversion. See:
02:13 svnbot6 r13523 | markstos++ | http://feather.perl6.nl/~markstos/Test.pm.html
02:13 lambdabot Title: Test - Test support module for perl6, http://tinyurl.com/p2dor
02:14 Qiang joined perl6
02:31 svnbot6 r13524 | markstos++ | Test.pm: clarify what I believe to be true:
02:31 svnbot6 r13524 | markstos++ |     - eval_ok should be used if code might be parse, but has some overhead.
02:31 svnbot6 r13524 | markstos++ |     - die_ok is a better choice if the code parses, but might die.
02:31 svnbot6 r13524 | markstos++ | Without this clarification, it was confusing what the difference was.
02:47 svnbot6 r13525 | markstos++ | Test.pm: Improve docs for :todo and :depends.
02:55 svnbot6 r13526 | markstos++ | classify.t: new tests for newly spec'ed "classify".
03:10 Qiang_ joined perl6
03:12 frederico joined perl6
03:46 svnbot6 r13527 | lwall++ | 1st whack at exporting methods.
03:46 svnbot6 r13527 | lwall++ | Some bogus package names are turning into export tags.
03:46 svnbot6 r13527 | lwall++ | Added generalized pick method.
03:46 svnbot6 r13527 | lwall++ | Added signatures as sort criteria
03:49 TimToady I'm not done with that file, so don't expect complete consistency...
03:58 TimToady 'course, it won't be completely consistent after I'm done with it either...
04:56 Eidolos Completeness or consistency. Choose one, maybe. :)
05:00 Teratogen thus spake Godel
05:04 svnbot6 r13528 | ajs++ | Per Larry answer, moved radical glyph to API doc with :UNI export tagging and cleaned up API doc a bit
05:19 svnbot6 r13529 | trey++ | Deleting test pm files used by old use_import_not_found.t, which was
05:19 svnbot6 r13529 | trey++ | deleted in r13468.
05:19 BooK_ joined perl6
05:21 kyrbe joined perl6
05:30 TreyHarris ?eval my $a = (1,2,3); my ($b) = [,] @$a; $b
05:30 evalbot_r13492 is now known as evalbot_r13529
05:30 evalbot_r13529 [1, 2, 3]
05:30 TreyHarris is that right?
05:34 TimToady no, should just end up with 1
05:35 TimToady in fact [,] should generally be a noop on @ in list context.
05:36 TimToady the Capture generated by [,] is supposed to reinterpolate.
05:36 TimToady now if there weren't parens around $b, that'd be different, I think.
05:37 TimToady since [,] in scalar context would just return the Capture.
05:37 TreyHarris right
05:37 TreyHarris ?eval my $a = (1,2,3); my ($b) = @$a; $b
05:37 evalbot_r13529 \1
05:37 TreyHarris that works fine
05:38 svnbot6 r13530 | trey++ | [t/operators/splat.t]
05:38 svnbot6 r13530 | trey++ | Added failing test for flattened dereffed arrayref in list context.
05:39 TreyHarris though i guess 'splat' is no longer a good name for that test file...
05:46 f0rth joined perl6
05:58 TreyHarris "Lazy of Pair"?  Lazy is a type?
05:59 TreyHarris just noticed that in docs/Perl6/Spec/Functions.pod
06:08 TimToady probably just means a List
06:09 TimToady since List is already presumably lazy
06:11 TimToady but maybe we'll end up calling them all Feeds anyway...
06:12 TreyHarris "multi Lazy Array::reverse (@values:)" should be written "multi Array::reverse (@values:) is lazy", no?
06:13 TimToady that's bogus syntax several ways.
06:13 TreyHarris which one?
06:14 TreyHarris oh... yes.
06:14 TreyHarris i just cut and pasted, and edited and pasted
06:14 TimToady our Lazy multi method reverse (@values:)
06:14 TimToady plus an "is export" so we can say reverse(@foo).
06:15 TimToady I've been trying to get rid of all the bogus Array:: thingies too.
06:16 TimToady it's just in the List package, so anthing that does the List role and can bind to @values can be reversed.
06:17 TreyHarris couldn't reverse of an actual array be optimized over reverse of a list potentially?
06:17 TimToady maybe, maybe not.
06:18 TimToady It's probably a lot faster to reverse 1..100000 than 1,2,3,4,....100000
06:19 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)
06:20 TreyHarris right...
06:20 TimToady these are interfaces, which is why I started putting in mumbojumbo about roles/classes.
06:20 TimToady reverse probably comes from the Ordered role, in fact...
06:20 TimToady or some such
06:20 TreyHarris right... multis of subtypes of types you do specify...
06:21 TreyHarris err... wait, is a subclass of Foo also a subtype of Foo?  subtype has special meaning
06:21 justatheory joined perl6
06:21 TreyHarris which lets you warp your type constraints in various dimensions... but inheritance is one of the dimensions already provided for i hope?
06:22 TimToady one would hope to get a bit of polymorphism out of our MMD mechanism...
06:23 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:26 TimToady I have no idea what "subtype" would mean in the context of P6.
06:27 TreyHarris well, S12 uses the word 'subtype' a dozenish times
06:27 TimToady probably means a dozen different things there. :)
06:28 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 TreyHarris liskov-like
06:44 iblechbot joined perl6
06:46 mdiep joined perl6
07:14 marmic joined perl6
07:26 zakharyas joined perl6
07:38 kane-xs joined perl6
07:46 mdiep joined perl6
08:03 pdcawley joined perl6
08:07 ludan joined perl6
08:07 ludan howdy
08:16 jferrero joined perl6
08:17 justatheory joined perl6
08:19 mugwump a subtype might not be a subclass, but isn't a subclass a subtype?
08:24 integral_ joined perl6
08:26 scw joined perl6
08:27 TreyHarris mugwump: that's what I was thinking, yes
08:28 * TreyHarris heads off to bed &
08:30 integral_ is now known as integral
08:41 vytautas joined perl6
08:55 azr|el joined perl6
09:10 avarab joined perl6
09:15 elmex joined perl6
09:16 lumi How much slower is pugs today than perl?
09:17 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 perl6
10:02 Odin-LAP joined perl6
10:15 obra        
10:15 nothingmuch
10:15 nothingmuch
10:15 buu
10:15 nothingmuch ack, /nick timmy didn't work
10:37 rodi joined perl6
10:47 ruoso joined perl6
10:47 buubot joined perl6
10:52 norageek2 joined perl6
11:03 buetow joined perl6
11:09 chris2 joined perl6
11:25 mdiep joined perl6
11:26 ofer__ joined perl6
11:26 ofer__ is now known as ofer1
11:31 pdcawley joined perl6
11:40 Limbic_Region joined perl6
11:52 norageek2 joined perl6
11:56 weinig joined perl6
12:01 Limbic_Region ?seen audreyt
12:01 lambdabot audreyt is in #perl6, #ghc and #haskell. I last heard audreyt speak 10h 35m 7s ago.
12:01 Limbic_Region audreyt ping
12:09 pdcawley joined perl6
12:10 ayrnieu joined perl6
12:21 masak joined perl6
12:31 iblechbot joined perl6
12:36 kane-xs_ joined perl6
12:46 zeriod joined perl6
12:59 KingDiamond joined perl6
13:20 svnbot6 r13531 | malon++ | eval.t - test fatal C<use> statements wrapped in C<eval>
13:20 svnbot6 r13531 | malon++ | * Test.pm itself is broken by the Pugs bug that this test documents,
13:20 svnbot6 r13531 | malon++ | so you won't even see "Looks like you planned 6 tests but only ran 5."
13:21 mdiep joined perl6
13:21 mdiep joined perl6
13:26 crem joined perl6
13:26 cjeris joined perl6
13:27 dakkar joined perl6
13:28 dakkar joined perl6
13:31 dakkar joined perl6
13:37 vel joined perl6
13:43 svnbot6 r13532 | malon++ | [ext/re]
13:43 svnbot6 r13532 | malon++ | * C<use re 'PGE'> will globally (not lexically) switch the regex engine
13:43 svnbot6 r13532 | malon++ | in the middle of a program.  It simply resets the environment variable.
13:43 svnbot6 r13532 | malon++ | * Requested by audreyt++ as a supplement to r13513.
13:46 fglock joined perl6
13:50 pdcawley joined perl6
13:51 vel joined perl6
13:52 vel joined perl6
13:54 frederico joined perl6
14:10 mdiep joined perl6
14:25 pdcawley joined perl6
14:33 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:35 ajs_ 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:40 pdcawley joined perl6
14:55 lollan joined perl6
15:30 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:31 TreyHarris and what is the answer to what Larry said last night?  what's the difference between Lazy and List?
15:36 justatheory joined perl6
15:54 tcliou left perl6
16:00 mauke_ joined perl6
16:03 rlb3 joined perl6
16:10 Psyche^ joined perl6
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 perl6
16:34 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:35 ajs_ TreyHarris: I'm not aware of Larry saying something last night about Lazy and/or List
16:36 TimToady no, I just said it this morning.  :)
16:38 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.
16:38 ajs_ sigh... I've been cattering here for how long without realizing that you were Larry?!
16:38 ajs_ chattering even
16:39 TimToady np
16:39 rodi damn, and I could have been Larry to ajs_.
16:39 TimToady I guess if we need an Eager type it's for signatures.
16:39 TimToady so many missed opportunities in life...
16:40 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?
16:40 TimToady I'm not sure we need a DumbQuestion type either.  :)
16:40 ajs_ rodi: you will always be my $larry...
16:41 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.
16:41 TimToady but I think naming a lazy list as Lazy probably buys us documentation at least.
16:41 TimToady that's my feelers too
16:42 ajs_ Your lack of whitespace DWIMery made me feel much better about |, BTW
16:42 TimToady good.
16:42 TimToady I'm only partly done with my recent whackage on S29.
16:43 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.
16:44 TimToady no, that's been mostly off my radar.
16:44 TimToady which means I'm probably stomping all over someone's carefull crafted S29 extraction code.  :)
16:45 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?
16:45 TimToady but this should really be defined in Perl files, not Pod files.
16:46 TimToady 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.
16:46 * justatheory coughs
16:47 TimToady development-driven specification, just like test-driven development.  :)
16:48 ajs_ heh
16:48 TimToady just run the whole waterfall uphill.
16:48 TimToady someday we might even have some requirements.
16:48 justatheory http://www.waterfall2006.com/
16:48 lambdabot Title: Waterfall 2006 - International Conference on Sequential Development
16:50 ajs_ "You've always known a good waterfall-based process is the right way to develop software projects." -- I have?!
16:51 TimToady speaking of waterfalls, I'm off to the shower...
16:51 TimToady biab &
16:52 ajs_ laters
16:56 Juerd TimToady: Given this syntax, how would you promise that the members of said Array are of MyType?
17:01 lanny joined perl6
17:03 araujo joined perl6
17:06 svnbot6 r13533 | fglock++ | t/xx-uncategorized/rule_recursive.t - s/rule/regex/ to enable backtracking
17:07 kolibrie to find every match for a regex called 'talk', should this work?  while (my $match = $content ~~ m:c /<talk>/) { say $match }
17:07 kolibrie is there a better way?
17:08 kolibrie (is there a way which currently works?)
17:09 * kolibrie is working on his 'Practical Extraction with Perl 6' talk for Saturday
17:10 fglock kolibrie: until Saturday we can find a way that works
17:10 kolibrie fglock: awesome
17:10 kolibrie fglock: should I put that snippet in my slide for now?
17:11 kolibrie for reference, I am building my talk here: http://feather.perl6.nl/~kolibrie/extraction.xul
17:11 lambdabot http://tinyurl.com/rxtmp
17:12 fglock kolibrie: with :global / :overlap / :exhaustive you can capture to an array directly
17:12 fglock but :c is easier to implement
17:13 penk joined perl6
17:13 kolibrie fglock: so this should work?  my @match = $content ~~ m:g /<talk>/;
17:14 kolibrie 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 perl6
17:15 [particle] ...then you can use m:g
17:15 fglock bbiab &
17:16 kolibrie [particle]: for $content ~~ m:g /<talk>/ -> $match { say $match };
17:16 penk joined perl6
17:16 [particle] whoa, that's scary when you write it :)
17:17 penk joined perl6
17:17 kolibrie and I think/hope that is lazily generated
17:17 [particle] same thoughts/hopes here
17:17 lanny ?eval srand(3);
17:18 evalbot_r13529 is now known as evalbot_r13533
17:18 evalbot_r13533 Error: No compatible subroutine found: "&srand"
17:18 lanny Oh good.  Broken here too.
17:20 Juerd srand shouldn't work :)
17:21 lanny Really?  Something to do with Haskell core?
17:21 Juerd Nah, it reeks of perl4ness :P
17:22 Juerd IMO randomness with user defined seeds should be OO.
17:22 Juerd So that you can have several sequences at the same time.
17:22 Juerd Maybe $*RAND can be the standard object, and $*RAND = Rand.new; could re-init or something
17:22 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()
17:23 lanny I guess I'll add to prelude then and see what happens.
17:41 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:42 ajs_ 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.
17:42 lanny my @random = sort { int(rand 3) -1 }, @sorted;
17:43 kolibrie first example up, comments welcome: http://feather.perl6.nl/~kolibrie/extraction.xul
17:43 lambdabot http://tinyurl.com/rxtmp
17:43 ajs_ lanny: You know that that isn't guaranteed to finish, right?
17:43 lanny If you know @sorted is finite then I hope it finishes.
17:44 ajs_ no, it depends on what kind of sort you are doing.
17:44 ajs_ And if you are memoizing
17:44 lanny It is memoizing because that's a KeyExtractor.  hmm.
17:45 lanny my @random = sort { $^a; $^b; int(rand 3) - 1 }, @sorted;
17:45 lanny Ugly but now it's a Comparator and would work.
17:46 [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.
17:47 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:48 ajs_ 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.
17:48 kolibrie [particle]: thanks
17:48 lanny I know.  N*logN just to shuffle is overkill.
17:48 [particle] there's nothnig wrong with bubble sort if you apply it correctly :P
17:48 BooK_ joined perl6
17:49 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:50 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
17:50 svnbot6 r13534 | fglock++ | v6 - implemented m:c/rule/ - still needs work
17:50 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.
17:51 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 ;)
17:51 fglock kolibrie: I'm testing with: perl  -Ilib -e 'use v6-alpha' - ' my $content = "xyz"; while $content ~~ m:c/<alpha>/ { say $/ } '
17:51 lanny On the flip side of knowing your data you can also know your implementation and do things you probably shouldn't.
17:51 lanny But yes.  I'm in total agreement, ajs_.
17:52 ajs_ fglock: did you hear my comment about v6 and "my A $x" turning into "my A; $x;"?
17:53 fglock ajs_: yes - v6.pm is currently too forgiving with syntax errors
17:53 kolibrie fglock: that looks like a good test
17:53 ajs_ ?... errors?
17:53 lambdabot Not enough arguments to @.
17:53 fglock ajs_: oh, you mean A is a Type
17:53 ajs_ Right
17:54 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
17:54 ajs_ v6 is a tiny bit of code ;-)
17:55 eden_c joined perl6
17:56 fglock ajs_: the place to start is Grammar::Term.pm, line 299 - 'my' => ...
17:56 fglock ajs_: tiny as in compact?
17:56 rodi joined perl6
17:57 ajs_ That was sarcasm. I found it difficult to find the error would be the more useful way to state it
18:01 TreyHarris < Juerd> TimToady: Given this syntax, how would you promise that the members of said Array are of MyType?
18:01 TreyHarris Juerd: I'm not TimToady, but isn't "Array of MyType" what you want?
18:04 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)]".
18:04 Juerd class Foo { does Array of MyType; }
18:04 Juerd Ahh
18:04 TimToady just generic instantiation.
18:04 fglock kolibrie: that example works with v6.pm r13535
18:04 Juerd Thanks
18:05 Juerd This clears that up
18:05 svnbot6 r13535 | fglock++ | v6 - $/ is initialized to undef at runtime
18:05 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
18:05 TimToady and if you just say "does Array" it presumably autoinstantiates with Any or something.
18:06 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.
18:06 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 :)
18:06 Juerd TimToady: In that respect, I think I'm fully convinced about types now :)
18:06 kolibrie fglock: awesome, thank you
18:06 TimToady the last assume :$of is the first positional parameter.
18:07 TimToady *assumes
18:08 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.
18:08 TreyHarris TimToady: right.
18:08 TimToady arguably it should be :of(:(MyType)) or :of(:(-->MyType)) though.
18:08 TreyHarris I don't care about Bertrand Meyer's invective, I like taxomania.  I think an empty 'eager' role would be fine
18:09 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.
18:10 lanny 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
18:10 TreyHarris Hash of Potatoes... mmmm
18:10 TimToady Array of Choices
18:10 rodi Array of Sun... ahhhh
18:10 Juerd I was thinking of Hash of Web::Argument
18:10 Juerd Or HTTP::Argument. Haven't made up my mind yet.
18:11 [particle] String of Puns
18:11 rodi LOL
18:11 Juerd In any case, I want to get rid of the hideous param(), except for compatibility with modules.
18:11 Juerd Not even for compatibility with people wanting param().
18:11 Juerd (Unfortunately, there's no way to enforce *that*)
18:12 TimToady make param a keyword. :)
18:12 Juerd TimToady: How would that help? :)
18:12 svnbot6 r13536 | fglock++ | v6 - updated TODO, ChangeLog
18:12 Juerd The Perl 5 modules wouldn't realise it's a keyword?
18:13 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
18:13 Juerd Hehe
18:13 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...)
18:15 TimToady $$/ has just that section. $/ still has the whole thing.
18:15 kolibrie TimToady: ah, thank you
18:16 kolibrie fglock: you may have also noticed that I'm using .+? in rules (which currently isn't implemented in v6.pm)
18:17 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
18:17 fglock nor <(...)>
18:18 kolibrie the troubles of writing a talk about bleeding edge technology
18:19 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.
18:19 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)
18:19 fglock kolibrie: otoh, things can be implemented on demand :)
18:19 TimToady that's what I've been doing at the top of each section.
18:20 TimToady "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 :)
18:20 Juerd TimToady: Can a class export subs?
18:20 TimToady but for the global listing, that's inside out
18:20 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
18:20 ajs_ Yeah, and the API documents are just placeholders that will be wrapped up into those roles/classes when they are written
18:20 Juerd TimToady: Or does that require a module and a class of the same name?
18:21 ajs_ TreyHarris: That is exactly what we do
18:21 ajs_ in S29
18:21 TimToady A class is a module so can export subs.
18:21 Juerd Great
18:21 TimToady Nowadays you can even export methods
18:21 TreyHarris Juerd: 'is export' is attached to methods in S29
18:21 TimToady which turn into multis.
18:21 Juerd Export... methods :)
18:21 mako132 joined perl6
18:21 Juerd That takes away my explanation of roles! :)
18:21 TimToady push(@array: @list) vs push(@array, @list)
18:21 * Juerd has so far explained roles in terms of exportation
18:22 TreyHarris ajs_: it is exactly what you do?  what's an example, I'm looking at S29 now
18:23 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
18:23 Juerd TimToady: Can "is export" be in the block, like in class Foo { is Bar; }?
18:24 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
18:24 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?
18:24 ajs_ Which we should state explicitly
18:24 Juerd Part of "anything"?
18:24 TreyHarris ajs_: part of any sub, surely, but not part of any method?
18:24 ajs_ TreyHarris: Every function mentions its package explicitly in the signature
18:24 TimToady Hash vs Array reverse
18:25 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
18:25 TimToady I'm going exactly the opposite direction and installing methods into S29
18:25 TimToady no, that's the return type
18:25 TimToady not the method's class
18:25 TreyHarris ajs_: ==TimToady.  I'm very confused.
18:26 ajs_ TimToady: we should talk...
18:26 ajs_ ;)
18:27 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:28 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.
18:28 * Juerd repeatedly reads "TreyHarris" as "TimToady" and vice versa.
18:28 Juerd Apparently my brain only sees "T[a-z]+[A-Z][a-z]+"
18:28 TreyHarris Juerd: good for me, perhaps, not so good for TimToady ;-)
18:28 ajs_ TimToady: Ok, so what's a method that is export?
18:28 TimToady push
18:29 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
18:29 Juerd Do we have <lower> and <upper>? :)
18:29 * TreyHarris commutes &
18:29 ajs_ does it mean "this method also defines a function of the same name" or does it mean something more clever?
18:29 Juerd TreyHarris: Smart, to commute in the background! Then you can still be active here! :)
18:30 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?
18:31 [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 " - "...
18:31 * Juerd uses it as a larger comma.
18:31 TimToady presumably it can just get the multis as globals like anyone else.
18:31 Juerd [particle]: Good
18:31 * [particle] suggests =>
18:31 Juerd T<lower>+<upper><lower>+
18:32 Juerd Much better.
18:32 [particle] i'm going to have trouble converting my fat comma usage to p6
18:32 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?
18:32 Juerd Can we write the + inside the <> without breaking it?
18:32 [particle] juerd: not as currently specced
18:32 Juerd [particle]: I'm already having trouble reading Perl 5 code with fat arrow in non-pair context.
18:32 * Juerd has not really used Perl 5 for a while.
18:33 ajs_ Juerd => what do you mean by that?
18:33 Juerd My brain is almost constantly in Perl 6 mode.
18:33 TimToady do you mean + as in **{1..*}?
18:33 Juerd ajs_: That I interpret that as :Juerd<"what do you mean by that?")
18:33 [particle] <lower>+ =?= <lower+> # i say no
18:33 Juerd TimToady: Yes, though in practice I'm going to munge Perl so that it uses something other than **{}
18:33 TimToady the + in <lower+upper> would be a different +
18:34 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.
18:35 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.
18:35 TimToady it's all multis and methods
18:36 ajs_ So, we say that S29 is "all core-module-default-exported multis and methods"
18:36 ajs_ ?
18:36 TimToady something like that
18:37 TimToady in fact, I put a remark remarkably like that near the top of S29
18:37 Juerd TimToady: Why have singles anyway?
18:37 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?
18:37 TimToady singles are mostly for hiding all multies of the same short name.
18:38 TimToady and to give the user a way of future proofing their program against future multi additions.
18:38 Juerd Hm
18:40 TimToady proto fills the same role if the user wants to write their own future-proof set of multis.
18:41 ajs_ hmm
18:41 TimToady you leave out the proto if you just want to intermingle with any future multis
18:42 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
18:43 ajs_ right
18:44 ajs_ TimToady where are you updating S29?
18:44 ajs_ In the pugs repo?
18:44 TimToady docs/Perl6/Spec/Functions.pod
18:46 TimToady Also, singles can easily be inlined.
18:46 ajs_ Good, thanks.
18:47 TimToady I just wish I didn't keep typing mutli
18:48 TimToady 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"
18:49 TimToady or however you spell that...
18:49 fglock callosum :)
18:49 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 perl6
18:50 fglock ajs_: we don't have a standard/portable AST yest
18:50 fglock yet
18:51 TimToady he, according to google there's really no agreement on how to spell it.
18:51 TimToady it finds lots of results for various spellings
18:51 kolibrie fglock: you are suggesting using token metasyntax in place of .+?
18:52 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:53 [particle] callosum is latin for tough
18:53 fglock kolibrie: that's in the case you want to parse xml; '.+?' is easier to write
18:53 TimToady basically, all the implementors of Perl 6 have to converge on an AST definition.  I am not one of them. :)
18:53 kolibrie fglock: I'll go for easier to write for this talk, I think
18:53 [particle] fglock: pmichaud's working on ast as we speak
18:54 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
18:55 [particle] fglock: ah, i thought you were. i'll get them in touch with each other.
18:55 [particle] TimToady: one side of your brain is pretty small, then
18:56 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
18:56 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?
18:58 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.
18:59 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
19:00 TimToady ads_: I'm not sure it makes a vas deferens
19:00 [particle] fglock: thanks
19:00 ajs_ ouch
19:10 vel joined perl6
19:15 eden_c left perl6
19:19 svnbot6 r13538 | fglock++ | Pugs-Compiler-Rule - implemented <(...)> in Token/Rule
19:23 rlb3 joined perl6
19:26 buubot joined perl6
19:34 svnbot6 r13539 | fglock++ | Pugs-Compiler-Rule - implemented <(...)> in Regex
19:36 fglock joined perl6
19:36 svnbot6 r13540 | fglock++ | Pugs-Compiler-Rule - ChangeLog update
19:57 kolibrie fglock: do you have any tips/code samples for converting my match object into a YAML structure with: rulename: captured_value
19:59 Limbic_Region joined perl6
20:02 kolibrie fglock: I think I want some kind of emitter, like Pugs::Emitter::Rule::Perl5, but in Perl 6, and shorter
20:03 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
20:07 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
20:07 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 '
20:09 kolibrie I'd like to coerce that to pretty yaml (rather than .perl)
20:09 kolibrie pugs builtin .yaml is also too verbose
20:09 fglock would you hack .yaml into the v6 runtime?
20:11 fglock 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?
20:11 glasser (preferably darwinports based?)
20:11 Limbic_Region ?seen audreyt
20:11 lambdabot audreyt is in #perl6, #ghc and #haskell. I last heard audreyt speak 18h 44m 59s ago.
20:11 kolibrie well, perhaps, but I don't understand the pugs output structure for .yaml, and don't really want that structure
20:15 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 $$/
20:16 kolibrie fglock: ah, very nice
20:16 * kolibrie svk pulls
20:16 cognominal joined perl6
20:20 svnbot6 r13543 | fglock++ | v6.pm - ChangeLog update
20:21 fglock kolibrie: btw, if you update PCR, this will work now too: my $content = "xyz"; $content ~~ / x <(y)> z /; say $$/.perl
20:21 _bernhard joined perl6
20:22 kolibrie fglock: oh, thank you!
20:22 fglock kolibrie: np
20:25 kolibrie fglock: is v6.pm the one in perl5/Pugs-Compiler-Perl6/lib?
20:25 fglock kolibrie: yes
20:25 kolibrie ok
20:27 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 perl6
20:27 Limbic_Region and now it is back - nevermind
20:27 kolibrie fglock: audrey usually uses her YAML::Syck module
20:27 kolibrie I think
20:28 fglock k
20:28 fglock bbiab &
20:29 Odin-LAP joined perl6
20:30 elmex joined perl6
20:36 rodi Is it true that anything that could be expressed by a rule could also be expressed by a token?
20:38 pasteling "kolibrie" at 66.239.158.2 pasted "fglock: /me is having technical difficulties (v6.pm)" (17 lines, 673B) at http://sial.org/pbot/19855
20:38 kolibrie fglock: but I'm more worried about my talk than my v6.pm installation
20:38 TimToady rodi: yes, you'd just have to be explicit about whitespace
20:39 rodi TimToady: thanks, I think it all just came clear.  Both, in turn, could theoretically be expressed as regexen (w/out using backtracking)?
20:40 [particle] rodi: token == regex :ratchet ; rule = regex :ratchet :sigspace ; so token = rule :sigspace
20:41 [particle] err. rule = token :sigspace
20:41 fglock kolibrie: perl Makefile.PL should fix this (old date in the cache)
20:41 rodi Man, S05 is dense.  I see it now that I /'ed for ratchet.
20:42 kolibrie fglock: then make and install?
20:45 kolibrie fglock: it skipped all files, claiming they were unchanged
20:45 fglock kolibrie: just running Makefile.PL might be enough, it calls $cache->Clear
20:46 fglock maybe 'make clean' too
20:46 fglock that will delete old '.pmc' files
20:49 kolibrie fglock: hmm, didn't seem to do anything
20:51 fglock kolibrie: please make install both Pugs-Compiler-Rule and Pugs-Compiler-Perl6 - it seems to be using incompatible versions of runtime/emitter
20:53 kolibrie fglock: /me re-installs Pugs-Compiler-Perl6
20:54 rodi my make smoke (r13538) is hanging indefinitely on t/xx-uncategorized/rule_recursive.t
20:59 rodi 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
21:02 rodi fglock: good stuff.  I think recursing on a recursion test is a step forward from just failing :-D
21:04 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!
21:05 fglock kolibrie: :)
21:06 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:07 fglock kolibrie: I'm working on it
21:07 kolibrie fglock: you're awesome!
21:08 * kolibrie thought that maybe some other people would like credits in my talk, too
21:13 frederico joined perl6
21:21 svnbot6 r13544 | fglock++ | v6 - added .yaml() method
21:21 svnbot6 r13544 | fglock++ |   perl -Ilib -e 'use v6-alpha' - ' my $content = 123; say $content.yaml '
21:21 svnbot6 r13544 | fglock++ |   --- 123
21:31 [mago] joined perl6
21:31 frederico joined perl6
21:31 elmex joined perl6
21:31 Odin-LAP joined perl6
21:31 fglock joined perl6
21:31 buubot joined perl6
21:31 rlb3 joined perl6
21:31 mako132 joined perl6
21:31 BooK_ joined perl6
21:31 penk joined perl6
21:31 streakceur joined perl6
21:31 araujo joined perl6
21:31 Patterner joined perl6
21:31 mauke joined perl6
21:31 justatheory joined perl6
21:31 mdiep joined perl6
21:31 dakkar joined perl6
21:31 cjeris joined perl6
21:31 crem joined perl6
21:31 KingDiamond joined perl6
21:31 zeriod joined perl6
21:31 kane-xs_ joined perl6
21:31 iblechbot joined perl6
21:31 masak joined perl6
21:31 ayrnieu joined perl6
21:31 weinig|away joined perl6
21:31 avar joined perl6
21:31 azr|el joined perl6
21:31 scw joined perl6
21:31 ludan joined perl6
21:31 kane-xs joined perl6
21:31 marmic joined perl6
21:31 f0rth joined perl6
21:31 Qiang_ joined perl6
21:31 plural joined perl6
21:31 xerox joined perl6
21:31 ajs_ joined perl6
21:31 idiotmax joined perl6
21:31 ruz joined perl6
21:31 lisppaste3 joined perl6
21:31 stevan joined perl6
21:31 webmind joined perl6
21:31 gugod joined perl6
21:31 baest joined perl6
21:31 mtve joined perl6
21:31 ofer0 joined perl6
21:31 Eidolos joined perl6
21:31 nothingmuch joined perl6
21:31 wilx joined perl6
21:31 jdv79 joined perl6
21:31 theorbtwo joined perl6
21:31 glasser joined perl6
21:31 lampus joined perl6
21:31 miyagawa_ joined perl6
21:31 thepler joined perl6
21:31 lumi joined perl6
21:31 TimToady joined perl6
21:31 cookys joined perl6
21:31 szabgab joined perl6
21:31 amv joined perl6
21:31 norageek joined perl6
21:31 [particle] joined perl6
21:31 Khisanth joined perl6
21:31 c6rbon joined perl6
21:31 gaal joined perl6
21:31 revdiablo joined perl6
21:31 PerlJam joined perl6
21:31 pjcj joined perl6
21:31 xinming_ joined perl6
21:31 evalbot_r13533 joined perl6
21:31 buu joined perl6
21:31 autark joined perl6
21:31 xern joined perl6
21:31 frankg joined perl6
21:31 mollmerx joined perl6
21:31 LCamel joined perl6
21:31 dvorak joined perl6
21:31 spoop joined perl6
21:31 Yappo joined perl6
21:31 rafl joined perl6
21:31 Teratogen joined perl6
21:31 silug joined perl6
21:31 perlbot joined perl6
21:31 prism joined perl6
21:31 drbean joined perl6
21:31 rafl_ joined perl6
21:31 spinclad joined perl6
21:31 nine joined perl6
21:31 hcchien joined perl6
21:31 cj joined perl6
21:31 kolibrie joined perl6
21:31 orafu joined perl6
21:31 statico joined perl6
21:31 jabbot joined perl6
21:31 Southen joined perl6
21:31 meppl joined perl6
21:31 gantrixx joined perl6
21:31 kalven joined perl6
21:31 svnbot6 joined perl6
21:31 Grrrr joined perl6
21:31 ajs_home joined perl6
21:31 nnunley joined perl6
21:31 takanori_ joined perl6
21:31 nperez joined perl6
21:31 ingy joined perl6
21:31 qmole joined perl6
21:31 TreyHarris joined perl6
21:31 Maddingue joined perl6
21:31 notsri joined perl6
21:31 kcwu joined perl6
21:31 pmurias joined perl6
21:31 broquaint joined perl6
21:31 clkao joined perl6
21:31 obra joined perl6
21:31 wolverian joined perl6
21:31 audreyt joined perl6
21:31 jiing joined perl6
21:31 cmarcelo joined perl6
21:31 rgs joined perl6
21:31 leo joined perl6
21:31 chip joined perl6
21:31 pmichaud joined perl6
21:31 Juerd joined perl6
21:31 Shabble joined perl6
21:34 Limbic_Region joined perl6
21:34 svnbot6 r13546 | fglock++ | Pugs-Compiler-Rule - added support for $/.yaml
21:35 fglock $$/.yaml is not going to work for a while - it needs more work at the v6.pm runtime side
21:40 svnbot6 r13547 | fglock++ | v6.pm - ChangeLog update; Makefile.PL recommends 'YAML::Syck'
21:47 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:48 glasser TreyHarris: Oh, I'm quite out of date
21:49 glasser mostly just knew that "port install ghc" doesn't work :)
21:49 TreyHarris glasser: see http://cvs.haskell.org/trac/ghc/wiki/X86OSXGhc
21:49 lambdabot Title: X86OSXGhc - GHC - Trac, http://tinyurl.com/za42p
21:49 TreyHarris if you search for "audreytang" on that page, that one should work for you, it does for others
21:50 TreyHarris (I will find out tonight, just got an intel mac)
21:50 glasser right, i knew she had done something
21:50 TreyHarris er... maybe tomorrow, knowing how long ghc can take to build from source
21:50 glasser Oh cool, there's a build from last week too
21:51 TreyHarris no readline...\
21:51 TreyHarris which is a must for pugs, IMHO... but i'm a pushover for arrow keys ;-)
21:51 glasser well, won't readline install with dports?
21:52 TreyHarris glasser: hm.  maybe.  getting readline support into ghc is a black art AFAICT
21:52 TreyHarris the distribs usually figure themselves out, but the nightly builds never do
21:53 glasser but 6.6 is almost out right?
21:53 svnbot6 r13548 | fglock++ | v6.pm - fixed '$$/.yaml'
21:56 TreyHarris glasser: i don't know.  i'm sure they'd be able to tell you something better on #haskell
21:57 ruoso joined perl6
22:04 fglock kolibrie: the "magic hand waving" part needs coercing Match into Str
22:04 fglock kolibrie: otherwise, something like this should work:
22:04 fglock  perl -Ilib -e 'use v6-alpha' - ' my $content = "xyz abc"; $content ~~ / <ident> \s <ident> { return $<ident> } /; say $$/.yaml '
22:05 fglock kolibrie: it currently outputs 2 Match objects, instead of 2 plain strings
22:11 Aankhen`` joined perl6
22:24 mako132_ joined perl6
22:24 beppu_ joined perl6
22:31 beppu_ joined perl6
22:53 Aankh|Clone joined perl6
22:57 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:59 buetow joined perl6
23:02 cjeris left perl6
23:03 Aankh|Clone joined perl6
23:10 SubStack joined perl6
23:12 TimToady maybe we need @items.unchop(",") or something. :)
23:12 Aankhen`` joined perl6
23:13 TimToady j
23:13 TimToady oops
23:14 Juerd TreyHarris: I don't remember discussing joining...
23:15 Juerd Ah, hadn't read that reply yet
23:16 Juerd 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 Juerd If [()] is an empty slice, that's perfect. It just means putting parens around the list, and that's easier than special casing.
23:17 Juerd I generally join on ",", because you need to join anyway.
23:17 TreyHarris or ", " if you want to print more prettily...
23:17 Juerd s/I/I expect I will/
23:17 Juerd TreyHarris: I don't need generated code to be pretty. I don't look at it except for debugging.
23:18 * 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 :-)
23:18 Juerd I'm not spending CPU cycles on tidy'ing if the code is thrown away.
23:18 Juerd The point of translating something to Perl code is efficiency in the first place.
23:19 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
23:19 TimToady (@x,'').join(',')
23:19 TreyHarris TimToady: that's not bad.
23:19 Juerd We have ~ now, that joins things too
23:19 TreyHarris ?eval my @x = 1..3; (@x,'').join(", ")
23:20 evalbot_r13533 is now known as evalbot_r13548
23:20 evalbot_r13548 "1 2 3, "
23:20 Juerd ~map { "$_," }, @x
23:20 Juerd ?eval my @x = 1..3; [@x,''].join(', ')
23:20 evalbot_r13548 "1, 2, 3, "
23:21 Juerd ?eval my @x = 1..3; ~map { "$_," }, @x
23:21 evalbot_r13548 "1, 2, 3,"
23:21 TreyHarris ?eval my @x = 1..3; ~@x.map:{ "$_," }, @x
23:21 TreyHarris d'oh!
23:21 evalbot_r13548 ("1, 2, 3,", [1, 2, 3])
23:21 Juerd Heh.
23:21 Juerd Hm, @x isn't passed to map?
23:22 Juerd 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
23:22 TimToady should be. though perhaps .map is ignoring additional args?
23:22 Juerd TimToady: Then I'd still expect some flattening
23:22 TreyHarris ?eval my @x = 1..3; ~(@x,@x).map:{ "$_," }
23:23 evalbot_r13548 "1 2 3, 1 2 3,"
23:23 TimToady looks more like :{...} is still be analyzed as an adverb rather than as : {...}
23:23 TreyHarris ?eval my @x = 1..3; ~{ "$_," }.map(@x, @x)
23:23 evalbot_r13548 "1, 2, 3, 1, 2, 3,"
23:23 TreyHarris ahh.
23:23 TimToady ?eval my @x = 1..3; ~@x.map: { "$_," }, @x
23:23 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 = <
23:23 TreyHarris whoops :-)
23:24 Juerd BTW, While writing up my Web toolkit pseudocode, I really loved Perl 6 much again
23:24 Juerd A few lines of code. So consise, so well suited to express thoughts in.
23:24 polettix joined perl6
23:24 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: { "$_," }
23:24 TimToady it seems to have a nice texture
23:25 evalbot_r13548 "1, 2, 3,"
23:25 TimToady the words and the non-words seem to play off each other pretty well
23:25 Juerd TimToady: Indeed. I can really appreciate the syntax
23:26 Juerd 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. :-)
23:26 Juerd And my 80 character limitation.
23:26 * TreyHarris shudders.
23:27 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 ;-)
23:27 TimToady I try to stay within 80 columns too.
23:27 Juerd See recent p5p re ${code; code;}
23:27 Juerd TimToady: I find it harder with Perl 6.
23:27 TimToady 'cuz the methods cascade?
23:27 Juerd Mostly for declarations.
23:28 TimToady ah
23:28 Juerd I find it very beautiful when the has'es line up without vertical whitespace.
23:28 Juerd But that's hard if you want to "handles" too.
23:28 TimToady I expect we'll see a lot of linebreaks right before the declared word, as in C.
23:28 TreyHarris Oh, dear.  Declarations have to all be on one line?
23:28 TimToady nah.
23:28 Juerd TreyHarris: No
23:29 TimToady our Lazy multi method
23:29 TimToady foo (...)
23:29 Juerd has Some::Type      $.foobarbaz    handles <foo bar baz quux xyzzy but_most method_names are_actually much_longer>;
23:29 Juerd That really needs the handles thing on a different line, but that breaks a structure that I like so much.
23:29 TimToady I'm sure we'll see a lot of vertical <...> things.
23:30 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)
23:30 pasteling "TreyHarris" at 207.171.180.101 pasted "line-broken sigs" (16 lines, 530B) at http://sial.org/pbot/19858
23:30 Juerd If I put the <> list, or part of it, on another line, the horizontal lineup for $.foobarbaz and handles no longer makes sense.
23:30 Juerd And things start to look like a mess.
23:30 TimToady handles q:w:to/END/
23:31 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
23:31 TreyHarris and I guess * needs to be written Whatever in a type declaration....
23:31 * Juerd will just treat <> like () and {}
23:31 Juerd has Some::Type $.foobarbaz handles <
23:31 TimToady there are times we probably want to distinguish * from Whatever.
23:31 Juerd    foo bar baz
23:31 Juerd     quux xyzzy but_most
23:31 Juerd    ...
23:31 Juerd >;
23:32 TimToady q:w:to/END/
23:32 TimToady foo
23:32 TimToady bar
23:32 TimToady baz
23:32 TimToady END
23:32 * Juerd prefers <...> then, TimToady
23:32 TimToady I like to see the ; on the first line.
23:33 Juerd I'm apathetic about ; placement, as long as it terminates things rather than prefix them :)
23:33 TimToady speaking of .join(';')...
23:34 * Juerd used to care, until he started to indent () like:
23:34 TreyHarris polettix: they would be different.  without the initial ~, you'd get:
23:34 Juerd foo.bar.baz(
23:34 Juerd    $arg1,
23:34 Juerd    $arg2,
23:34 Juerd );
23:34 TreyHarris ?eval my @x = 1..3; @x.map: { "$_," }
23:34 evalbot_r13548 ("1,", "2,", "3,")
23:34 * polettix aaaaah-s
23:34 TreyHarris the ~ concats them together into a single string.
23:35 TimToady ?eval my @x = 1..3; @x.map: { "$_," }.join
23:35 evalbot_r13548 "1,2,3,"
23:35 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
23:35 polettix but how are those ":" make our golf better than ruby?
23:35 Aankh|Clone joined perl6
23:36 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:37 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.
23:37 TreyHarris polettix: hyperops are way easier than .reduce { |x| .... } ;-)
23:37 Juerd And ~list joining on null string makes more sense to me anyway
23:38 TimToady Juerd: check Functions and you'll see it currently defaults to ' '
23:38 Juerd TimToady: Ah, cool.
23:38 TimToady pugs is behind the times.
23:38 TreyHarris s/hyper/meta/
23:38 Juerd ++ :)
23:38 polettix eheh, good then
23:38 Juerd TimToady: Then perhaps it's useful to make ~ join on empty string?
23:39 TimToady [~] does that.
23:39 * Juerd needs serious tuits, and to reread docs.
23:39 Juerd TimToady: Good point.
23:39 Juerd But why would ~ join on space?
23:39 TreyHarris ?eval my @a = 1..3; "{~@a}::{[~] @a}"
23:39 evalbot_r13548 "1 2 3::123"
23:39 TimToady for consistency with all the other stringified arrays.
23:40 Juerd Oh, right, interpolation does this too. I tend to forget about stringification of arrays.
23:40 * Juerd uses it in golf only :)
23:41 TreyHarris Juerd: yes, of course, i could have written
23:41 TreyHarris ?eval my @a = 1..3; "@a::{[~] @a}"
23:41 evalbot_r13548 "\@a::123"
23:41 Juerd TreyHarris: Compare:   ~list.blah     list.join.blah
23:41 TreyHarris ?eval my @a = 1..3; "@a[]::{[~] @a}"
23:41 evalbot_r13548 "1 2 3::123"
23:41 TreyHarris but i was trying to make the ~ thing explicit
23:41 Juerd TreyHarris: The former says "stringify whatever comes", the latter says "stringification is just a step in the process"
23:42 Juerd 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>
23:42 Juerd TreyHarris: For single tokens it's mostly a matter of expression.
23:42 TreyHarris i guess listy could override stringification but not join().
23:43 TreyHarris er, whatever listy returns rather.
23:43 Juerd I'll use ~ and + much to mean "scalar".
23:43 Juerd That is, "item".
23:43 TreyHarris *nod* yes.  self-documentation is good.
23:43 Juerd Whereas join is explicit concatenation.
23:44 Juerd 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
23:44 lambdabot Unknown command, try @list
23:44 Juerd TimToady: I think map suffices
23:44 TimToady by that argument we get scheme.
23:45 Juerd [~] @foo »~ ","
23:45 Juerd And by this argument? I wonder what language has all this ;)
23:45 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)
23:46 Juerd TreyHarris: Not that I can recall.
23:46 awwaiid joined perl6
23:47 TreyHarris can't remember whom...
23:47 TreyHarris 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.
23:48 TreyHarris 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.
23:48 Juerd TimToady: Ah, so $ and @ can be infix now?
23:48 Juerd Yay, larger alphabet :)
23:48 TreyHarris TimToady: yep, it's a good compromise, like ($myself:).
23:49 Juerd OTOH, 3|4 was nicely tight.
23:49 TimToady still is.
23:49 * TreyHarris is not stating that he is a good compromise....
23:49 TimToady that | is where an operator is expected.
23:49 Juerd Ah
23:49 Juerd foo|4 then :P
23:49 TimToady no ambiguity
23:49 Juerd But that's bad style anyway.
23:50 TimToady see my reply to ajs in p6l on that.
23:50 weinig|away is now known as weinig
23:50 Juerd Will do soon. I'm lagging behind on p6l.
23:50 Juerd Have been spending some time on p6u.
23:50 TimToady noticed that. :)
23:50 TreyHarris would |4 be legal for \4?
23:50 TimToady no.
23:51 TimToady 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.
23:51 TimToady |4 is no different from 4
23:51 TreyHarris TimToady: I haven't finished reading your most recent synopsis changes introducing |, sorry
23:52 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.
23:52 Juerd And roles combined with types just being classes... Splendid.
23:53 TimToady well, the proof will be in the pudding, as they say.
23:53 Juerd Re that - is .[] a method or an op?
23:53 TimToady We'll just have to see how it all works out.
23:53 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?
23:54 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...
23:54 TreyHarris ahhh
23:55 TreyHarris yes.
23:55 * TreyHarris smacks his head
23:55 * Juerd goes to bed
23:55 TimToady post hoc...
23:55 Juerd 1:55am, alarm clock is set for 7:30 :(
23:55 TreyHarris TimToady: thanks.  I'll go read the syn changes and write some tests and then it'll all make sense to me
23:55 TreyHarris ergo propter hoc
23:56 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.
23:56 Juerd So that must be why I'm going to bed. Right :)
23:56 TimToady *smack*
23:56 jferrero joined perl6
23:56 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:57 Juerd Good night!
23:57 TimToady Good hoc!
23:59 TreyHarris videor habe potentum supra Juerdu...

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo