svn switch --relocate svn.openfoundry.org/pugs svn.pugscode.org/pugs/ | run.pugscode.org | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com | dev.pugscode.org/
Set by putter on 11 February 2007.
specbot6 r14315 | larry++ | made "my Any $x; $x := [1,2,3]" a little dwammy (do what audreyt++ means :) 00:22
lichtkind haha dwammy :) 00:25
specbot6 r14316 | larry++ | Clarifications requested by TheDamian++ 01:26
r14316 | larry++ | Defined ++ and -- in terms of .succ and .pred so I could write s[] = $0.succ
svnbot6 r15513 | daxim++ | more install requirements 03:55
specbot6 r14317 | larry++ | Module longnames now specified in terms of ident plus adverbials. 04:42
obra TimToady: ping. re your S02 update, it would seem to complicate how CPAN marks beta versions
usually, a "developer only version" gets marked as 1.2.1_01. You'd now need the extended syntax to do that, no?
TimToady well, it's true that we don't have a good story for prerelease numbering yet, but I think the _01 remnant of the old floating point versions is even boguser 04:46
specbot6 r14318 | larry++ | typo spotted by TimToady++ :/
TimToady placeholder digits are a code stench in version numbers 04:48
logically, what we'd really want is negative versions: v1.2.-1.1, but that's not terribly practical culturally either 04:49
one could make a rule about inserted alphas always driving the preceding number "negative" with respect to nonalpha numbers, and I suppose 1_01 can even be justified on that basis if you ignore the placeholder 04:50
obra *nod* I'm totally happy to kill _01. It's led to all sorts of insanity. 04:51
TimToady more generally, the alphas tend to be surreal discontinuities of some sort or other
obra . o { 1.2.6*i could show that it was an imaginary or "developer" release } 04:52
obra ducks
TimToady but we could say that 1.2.1.foo.1 always sorts before 1.2.1.0, give or take a dot
but perhaps some of what alphas are used for these days should go out of band into :foo form anyway 04:53
:nickname<Brickbat> 04:54
obra isn't sure how that feels 04:55
the nice thing about the _01 convention is that it makes it very easy to mark something as an alpha and very easy to undo it.
TimToady gets dicey as to whether it's part of the official longname
obra And it's very important to be able to see it when understanding what bogus versions of things a user has deployed
With RT, we have an in-app view of all loaded module versions with Module::Versions::Report. having that information not available in the longname would likely be painful 04:57
TimToady 1.2.1alpha3 is a common format, but I could see adding more dots by convention
1.2.1a3, 1.2.1.a3 you also see
1.2.1a.3 is often mistaken for a followup to 1.2.1 rather than preversion 04:58
obra *nod* thought the explicit "alpha" is deprecated by the cpan machinery.
Most developers have switched to using an _<int> 04:59
since CPAN.pm is hardcoded to ignore those versions when doing autoinstalls
TimToady 1.2.1_3 has an alpha in the middle, and if we assume alphas insert . on either side as needed
it doesn't matter if they write 1.2.1_03, it still means 1.2.1._.3
obra Ah. I wasn't parsing _ as pronounced "alpha". Got it
TimToady question is whether to sort _ before or after a, b, g 05:00
probably before is simpler 05:01
assuming asciibetical
so _ is prealpha
obra ..yeah. that makes sense to me.
TimToady alpha, beta, gamma works, but not delta
one problem is that _ might be read as a digit separator so 1_3 would be read as 13 05:02
esp when written 1_03
so we'd have to outlaw _ as digit separator there, I think 05:03
obra *nod*
TimToady I'll have to work on S02 a little more I guess... 05:05
obra Sorry about that ;)
TimToady But not very sorry. :) 05:06
obra Only a tiny little bit sorry.
are unicode values legitimate in versions? 05:07
TimToady 1.2.1α 3 05:08
obra Version(pi * 2)
obra wishes for a unicode-capable irc client
TimToady why not, they probably even sort nicely as long as you stick to small greek letters
irssi is unicode capable 05:09
obra There's something odd with my irssi+screen config
TimToady do you have LANG=en_US.UTF-8 05:10
TimToady recent screen and irssi should do the right thing as long as that's set and your terminal does the right thing with utf8 05:11
obra (let's see if irssi without screen behaves)
TimToady screen has a -U switch to force utf8 mode, though I don't need it here with LANG set right 05:13
obra Yep. Locally, utf8 in my terminal is 100% ok. sshing to my colo box causes things to not work quite right. 05:14
obra digs further
TimToady what kind of box is your colo? 05:15
obra The colo is a somewhat older debian box. setting LANG appears to make catting files in chinese remotely behave ok
now to try within screen
daxim we ♥ utf-8 05:20
jesse__ beats at irssi 05:23
􏿽xC2􏿽xA9 05:24
TimToady did you mean to include an A hat? 05:25
jesse__ I did not.
I should likely go test somewhere less annoying. It was a frowny
TimToady I think that's typical utf8 vs latin-1 confusion
jesse__ nods 05:25
TimToady try screen -U?
might be an older version that doesn't look at LANG 05:26
jesse__ I'm actually working sans-screen for the moment
Oh. hm. my irssi is a couple years old. 05:27
05:35
TimToady おめでとうございます! 05:36
jesse__ (I can't yet _see_ unicode data sent by others, but the right thing happens on input, looks like 05:37
TimToady hmm, if I had to choose one or the other, I think I'd rather see it 05:38
jesse__ I won't rest until I can see it. But writing was just one flag ;)
specbot6 r14319 | larry++ | Definition of version sorting order. 05:41
ayrnieu I can only reliably see unicode in Emacs. 05:42
jesse___ 份固體攪拌器! 05:43
(There are very few idiomatic phrases I have at my fingertips in traditional chinese. Thank god that 'concrete mixer' is one of them.)
miyagawa Hm, 攪拌器 05:44
jesse____ 攪拌器? 05:45
miyagawa sounds like a mixer.
TimToady kakuhanki 05:46
ayrnieu a nice one for perl6 might be 'yi ri qian li' (lit. one day thousand miles), which expresses rapid progress in the way you'd expect.
jesse___ Thank god. now I can see all the discussion of the ¥ operator 05:47
Zorkmid25 WoW sucks 05:47
obra ;)
ayrnieu zorkmid - it has a decent extension language. 05:48
gaal morning 05:55
obra 'morning gaal
gaal hey obra
is irc.pugscode.org down for you guys too? 06:13
TimToady it doesn't ping from here 06:23
I've never used that machine for IRC though. 06:24
svnbot6 r15514 | lwall++ | New unified module name notation. No longer need separate rule for wildcards.
gaal okay, I really don't understand the candidate sorting thing :( one strategy I tried is to assume the sort had already run, in which case I can assign each candidate in retrospect a rational number representing their position. or rather, because of ties and nonassociativity, say that the result isn't a sort of candidates, but a sort of sets of candidates; and that the algo succeeds when the greatest set is a singleton. right? 06:24
TimToady: it's only logs, really hosted on colabti.de or something
so in audreyt's 3-element example, the sort results in: [{b}, {a, c}], which successfully chooses b 06:26
gaal what I don't see is how to give {a,c} an ordering against other candidates 06:27
gaal that is, I have Sig -> Sig -> Ordering, but how do I lift that to Set Sig -> Set Sig -> Ordering? 06:28
TimToady I think if two sets overlap they are probably involved in a cycle 06:29
gaal TimToady: one use for it is that browers tend to have better unicode font support than my terminal; sad but true :/
overlap in the simple sense of share a member? 06:30
TimToady a shame colabti defaults to latin-1...
gaal yes it's really stupid. I considered writing a greasemonkey script for it :) 06:31
TimToady either all of the one set's members are better that all of the other sets, or they are all in the same set, perhaps. 06:31
gaal TimToady: but consider audreyt's example (do you have it in scrollback)? 06:34
we know b>a, but we don't know b>c
however presumably we are still to choose b, right?
TimToady I don't see why we'd choose any of them. 06:40
but maybe that's because my eyes are going crossed...
gaal We need someone who has an intuition for this to give some examples... 06:42
gaal hee, oleg and ccshan are releasing a typesystem arithmetic library 07:11
audreyt gaal: uh sorry 07:13
gaal hey audreyt
audreyt the idea is that a is preferable to c 07:14
but a and b are tied
with only 3 candidates
we know the whole thing is doomed
since regardless of c/b's result, all of them are already marked non-winner
gaal okay, a slightly more elaborate example would be very useful then...
how is something marked non-winner? the fact that it's tied with somebody else? 07:15
audreyt or it's lost to something else
gaal okay. any comments on the proposed introduction of rationals? does it help in any way?
audreyt backlogging... 07:16
after a night's sleep I believe the easiest algorithm is to maintain a queue of "still hopefuls" which is initially all of it
gaal in a *successful* sort, the ordering has to be coherent, right
audreyt at each step we pick two items from the queue 07:17
compare them; if they tie, both are removed. if one loses, that one is removed
repeat this until the queue is either empty or left with one
if it's empty, we fail
if there's only one, compare it with everything that it has not been compared to
if it still wins, it wins
otherwise we still fail
I think it's a good, if a bit imperative, algorithm 07:18
and at the "compare the only candidate with everything it has not been compared to", we fail as soon as there is a tie, or if the candidate fails
think you grok that?
gaal yes :) though implementing this in haskell may be surprisingly more difficult than most other algos 07:19
audreyt runST may be useful if absolutely needed :) 07:20
gaal *nod*
audreyt but it can be made functional too...
gaal I'd love a test case
audreyt I'll get you one
gaal audreyt++
audreyt in fact, I'll get you a quickcheck 07:21
gaal :))
audreyt sleep++ # nothing cures insomnia as effectively as sleeping 07:22
gaal hehe. I'm feeling muchly better too
though still wobbliness > 0 07:23
audreyt discovers a clever way to write quickcheck instances 07:26
gaal ooh?
audreyt quickcheck generates random Int 07:27
we only use the bottom 16 bits
so actually they generate Int16
to generate Ordering 07:28
we take two Int16
put the smaller one at front
concat the bits into a 32-bit Int
use that as seed to System.Random.StdGen
get the random number
and use (`mod` 3)
to determine Ordering
gaal lol
audreyt that should get you a large number of very weird graphs :) 07:29
gaal audreyt++
gaal wonderful technique, I look forward to plag^H^H^H^Hfurther researching it in the future 07:30
audreyt :D 07:32
gaal I'm assuming it's okay to add an Eq constraint to a... 07:36
though that's probably implied by Set already, isn't it? 07:39
audreyt quickcheck done 07:43
yes. also if it's easier just do [a]
audreyt instead of Set a that's fine too 07:43
gaal doesn't matter much... 07:44
audreyt Set then 07:45
audreyt committed 07:54
surprisingly compact :)
# svn.pugscode.org/pugs/misc/pX/audre...ispatch.hs 07:55
svnbot6 r15515 | audreyt++ | * qc-dispatch.hs: quickcheck for dispatch
audreyt so fill in "dispatch" :)
gaal thanks, working on it :) 07:58
svnbot6 r15516 | audreyt++ | * er, typo.
mj41 hi, I forgot my svn passwd (username rootmj) :-(. 08:04
audreyt mj41: hi, what's the email you used for svn? 08:21
(I didn't get your /msg; forgot to identify?) 08:22
mj41 audreyt: rootmj_konf <nspm> seznam.cz 08:23
gaal grrrr, I thought I had it but it's still wrong... 08:24
audreyt mj41: password re-sent 08:28
mj41 audreyt: thanks 08:29
svnbot6 r15517 | rootmj++ | [util/PaP6-testing] 08:43
r15517 | rootmj++ | * fix sleeping between "svn up"s if other confs are skipped
gaal audreyt: mind taking a look? I don't see what's wrong here
pasteling "gaal" at 192.115.25.249 pasted "dispatch try" (49 lines, 1.6K) at sial.org/pbot/23352 08:44
mj41 audrey: new passwd didn't work, but I found computer, where I saved old one :-) 08:46
audreyt mj41: so old one worked? 08:48
evidently :)
mj41 audrey: yes
audreyt cheers then :) 08:50
gaal: LT == 08:51
audreyt not GT /= 08:52
in the List.partition line
oh wait hm
why not use the (x:y:zs) way?
not sure partition is a win
because when x is tied, you don't want to dispatch better 08:53
instead I'll compare x against y
gaal oh, right
audreyt if one wins, then dispatch it along with zs
if neither, then zs
gaal audreyt++
audreyt :) 08:54
of course that means we duplicate comparison at the verify stage
but we can worry about that later
just got it qc first :)
gaal yy
audreyt food, bbiab
gaal qc++ 09:07
svnbot6 r15518 | gaal++ | * dispatcher passes QuickCheck
gaal (shower >>= first_nondoc_excursion_in_a_week) & 09:10
as for pruning the double-verify thing, I think simply changing "filter" to "takeWhile" should help 09:26
&
gaal how do I use quickCheck to give me n simple random inputs? 10:40
audreyt heya
gaal hi :)
s/filter/takeWhile/ seems corrcect
I just want to get an impression of length . catMaybes . map dispatch some_sample 10:41
not that it's meaningful
audreyt replicateM 10 arbitrary 10:42
gaal @index replicateM
lambdabot Control.Monad, Control.Monad.Reader, Control.Monad.Writer, Control.Monad.State, Control.Monad.RWS, Control.Monad.Identity, Control.Monad.Cont, Control.Monad.Error, Control.Monad.List
audreyt you can run the gen monad with 10:43
generate 0 (mkStdGen 0)
so
list_of_ten = generate 0 (mkStdGen 0) (replicateM 10 arbitrary)
gaal hehe: 10:44
generate 0 (mkStdGen 0) (replicateM 10 (arbitrary :: Gen Sig))
[MkSig 0,MkSig 0,MkSig 0,MkSig 0,MkSig 0,MkSig 0,MkSig 0,MkSig 0,MkSig 0,MkSig 0]
audreyt lol
ok, maybe not
takeWhile is correct. 10:45
gaal when the numbers are not 0 it looks better
audreyt though that is still extra comparison
gaal is it? I though it's still about n 10:46
audreyt maybe dispatch' can accum
gaal consider the case where the head is the evenutal winner
audreyt hm no, not gonna help
gaal it's sure n then
audreyt yeah. you're right
let's go with that
gaal++
gaal @index catMaybes 10:48
lambdabot Data.Maybe
audreyt I get 10 Nothing out of 100
obtained by
verify Nothing = trace "nothing" Nothing
and count the number of nothing on screen
another 10 from 10:49
dispatch' [] = trace "all-tied" Nothing
oh wait 10:50
they are the same, aren't they.
12 succeeded
10 all-tied
gaal if they are, then we have another shortcut to moose
(I think)
audreyt 78 ruled-out-at-verify-stage
gaal no actually, the nothing just propagates
speaking of which, my verify is really ugly isn't it? 10:51
audreyt already done
simpler at code level if not actually faster
svnbot6 r15519 | audreyt++ | * another shortcut to moose
gaal :-)
how are the stats with 10,000 samples? 10:52
just wonderin'
(bettter remove the trace)
oh wait you count via trace
hehe, change to Either and you can report the error. <3 monads 10:53
.oO( s/candlist/candy/ )
10:54
audreyt tidied up. 10:57
now works with arbitrary monads
gaal you beat me to it, as usual :) 10:58
audreyt and "verify" is gone, hence no longer ugly -- we get the result ex nihilo
svnbot6 r15520 | audreyt++ | * more code tidying
audreyt :D
but this looks good enough
gaal++
gaal buildfail
audreyt no way...
gaal oh, no 10:59
stale ghci moose
audreyt just warning
gaal well, the prop_dispatch still assumes Maybe 11:00
audreyt sure 11:01
gaal brb
audreyt bbiab too 11:04
gaal oh, when you said extra comparisons and accum you meant the == check in takeWhile.. yes, an accum can fix that. fixing
fixed 11:08
Patterner gaal++ 11:09
gaal audreyt++ really :)
Patterner audreyt++ # sure :) 11:10
svnbot6 r15521 | gaal++ | * avoid the takeWhile tests entirely by accumulating spoilers during scan 11:11
gaal is x:xs cheaper than xs ++ [x]? because the order of spoilers doesn't matter so there's a possible small optimization here :) 11:12
(istr that yes, (:) is generally better) 11:13
svnbot6 r15522 | gaal++ | * accumulate spoilers list in reverse, since it order doesn't matter 11:17
r15522 | gaal++ | anyway and this is possibly more efficient.
gaal on large sets there are almost only failures 12:03
not that that means anything etc.
what's more noteworthy is that it takes a while to run on 1000 samples. but: this is in ghci, and I didn't break down the set sizes yet. 12:05
gaal oh, heh, it's on enormous Sigs. 12:06
fglock mm - perl 5.9.4 doesn't seem to have the new regex syntax - trying bleadperl 12:07
gaal okay, with saner sigset sizes the match hit rate is expectedly much, much higher 12:09
gaal let samp = generate 10 (mkStdGen 3432) (replicateM 1000 (arbitrary :: Gen [Sig])) 12:09
gaal the "10" controls the sigset size 12:09
I think it's a cap 12:10
fglock oops - pugs uses PCRE instead of p5 - m:P5/(?<x>foo)/ fails 12:25
audreyt: I'm adding %+ to Match in Pugs::Compiler::RegexPerl5 12:29
fglock ugh - p5 named captures are also positional - this will need some extra work 12:34
gaal oh, my accumulator's bogus, since it just gathers everything. 12:38
fglock what I really needed was: /(a)(?<named>b)/ generated an array of names like [ undef, 'named' ], matching the positions in @- and @+ 12:39
svnbot6 r15523 | gaal++ | * revert bogus optimizations 12:41
audreyt fglock: I can get pugs to use p5rx too... would that help you in some way? 12:42
fglock audreyt: that's just for completeness, so people can use the new p5 syntax 12:44
I'm still studying the new p5regex, in order to box the result into Match 12:45
fglock audreyt: you can use Pugs::Compiler::RegexPerl5, which does p5regex->Match 12:46
same API as normal PCR
p5regex->Match will likely need some p5-internals work 12:50
I wonder if p6 could allow :PCRE as well as :Perl5 12:54
audreyt well it could, but perl5 can use PCRE already too in 5.10 :) 12:55
re-engine-PCRE :)
fglock oh, right :) 12:56
wolverian hrm, an ADHD support concert was cancelled here because the main performer had too many things to do. life, stranger than fiction. 13:00
DrSlump hello 14:43
audreyt DrSlump: greetings
DrSlump hello Audrey
gaal hey audreyt, how's the color? 14:55
(only 1k new red was pretty impressive!) 14:56
audreyt down too 900ish 15:02
but working on @slides now
you want to look at the patch-so-far and maybe chase down some of the errors? 15:03
it's in perlcabal.org/~audreyt/tmp/patch-so-far 15:04
svnbot6 r15524 | audreyt++ | * More gold-plating of qc-dispatch.
audreyt I need to go back working on slides...
gaal are they relaed to missing newvals mostly?
audreyt be back to hacking in ~12 hours
gaal sure, have fun
audreyt :) &
svnbot6 r15525 | gaal++ | * tidy up rules related to DrIFT 15:17
riffraff hello 16:26
fglock @tell dmq: any ideas on how to get from/to information (like in $-[$n]/$+[$n]), given a perl5.10 named capture? 16:36
lambdabot Consider it noted.
integral there's not %+ %-?
args yes, that's it 16:37
see the module Tie::Hash::NamedCapture for the full docs
but be sure your checkout of bleadperl is not older than one hour ago 16:38
fglock the module seems to return the captured text only - but not where in the string did it match 16:39
args no 16:40
fglock re.xs has this information internally, but I don't see how to access it
args you mean the matching index pos? 16:41
dmq: alive ?
fglock yes
args fglock: @+ and @- ?
fglock @+ does contain the information, but I need to know which index corresponds to each name 16:42
args yes, that's the problem. 16:43
integral sorry, I see, %-/%+ aren't at all like @- and @+, my mistake 16:45
TimToady the design of @+ and @- was a botch from the start. parallel arrays are almost never the right answer. 17:28
args I don't like them either. 17:29
they're great for obfuscation, though :)
TimToady and from a user perspective, *I* can never remember which one is the start and which one is the end. 17:33
one can set up the metaphor either way 17:34
masak mm, feather down? 17:41
TimToady no, been up 95 days 17:50
just logged into it 17:51
[particle] is :ver<*> or :auth(*) valid? 17:52
hrmm, maybe (*) has to be (Any) since it's a type
TimToady :ver(*) is valid
I suppose :ver<*> is valid if :ver<6.2.*> is valid 17:53
[particle] re ver: that's what i figured
TimToady but maybe it needs (v6.2.*)
[particle] (v*)
TimToady (Version) 17:54
TimToady but likely the string form can recognize * 17:54
[particle] i expect omitting :ver<something> implies :ver<*> 17:55
TimToady what we don't have currently is a good notation for 6.2.3+
[particle] use a range
allbery_b @remember TimToady We're trying very hard to make different mistakes this time, and I believe we're succeeding. :-)
lambdabot Done.
allbery_b (6.2.3-*)? 17:56
[particle] i've run into this multiple times with perl 5
supporting only specific package versions, since an api changed
svnbot6 r15526 | audreyt++ | * qc-dispatch: Improved dumpCmp to show all combinations, not only 18:18
r15526 | audreyt++ | comparison to the first element.
r15526 | audreyt++ | Also optimize the algorithm somewhat to avoid recomparison on the
r15526 | audreyt++ | two-sigs case.
specbot6 r14320 | larry++ | Further clarification of version syntax as requested by geoff++ and others. 18:36
obra TimToady: +alphabetic, and that alphabetic is defined according to Unicode, +not ASCII. 18:38
isn't unicode sorting a strict superset of ASCII?
TimToady sure, just because it's not defined according to ASCII doesn't mean it isn't consistent 18:40
obra Ok. It felt a tiny bit confusing, as I tried to figure out how it wasn't ASCIIbetical. But that works 18:41
TimToady well, my basic rule of thumb is that if something gets misread, it's the writer's fault. :) 18:46
specbot6 r14321 | larry++ | Clarification suggested by obra++.
r14321 | larry++ | v-style now allows * and + wildcards for convenience.
obra it's a fair rule of thumb. But dangerous around these pedantic Perl-people 18:47
but yes, the "just" makes it better.
Can I stick a wildcard in the middle of a version?
[particle] still wonders about v* and v+ 18:48
TimToady you can stick a *, but it seems a bit odd semantically 18:49
obra evil: especially useful if I can say: conflicts wiht v1.*.0
TimToady a + is only allowed at the end
(currently)
obra *nod* seems reasonable 18:50
TimToady I suppose at some point you break down and just write a regex for a selector...
though the dots are a problem in regex
obra Yep.
[particle] sure, but Version could metasticize dots 18:51
er... escape, anyway
TimToady would be a bit odd for a Version to reach into a regex selector and change its meaning. Regexes aren't strings anymore... 18:52
I think we can let huffman deal with that situation. :) 18:53
[particle] consider a Version grammar
that generates regexes
TimToady okay, I considered it
[particle] :)
svnbot6 r15527 | lwall++ | Tracking recent version syntax changes. 18:54
TimToady gotta get ready for $job 18:55
bbl &
obra Yep./win 8 18:57
mischan. sorry
rindolf Where does TimToady work? What does he do there? 18:59
offby1 Secret Perl Labs 19:00
[particle] he works for a hardware company, and designs perl 6 19:07
moritz
.oO(perl 6 in hardware? cool ;-)Oo.
19:11
[particle] well, regex in hardware, anyway 19:12
moritz are regexes turing complete? *g* 19:13
[particle] perl 5 and 6 are
*regexes are
not sure abouc pcre 19:14
riffraff awk's are not,a DFA suffices for them 19:23
xerox riffraff (: 19:26
riffraff hei xerox :) 19:31
svnbot6 r15528 | lwall++ | nameroots are now just data 19:39
GeJ morning lambdam􏿽xF8􏿽xF8ses 20:32
moritz feels like a gammaelk ;) 20:33
masak ?eval say [1].perl 21:22
evalbot_r15525 OUTPUT[[1,]␤] Bool::True
masak is the comma meant to be there?
it's not there in longer lists
?eval say [1,2,].perl
evalbot_r15525 OUTPUT[[1, 2]␤] Bool::True
moritz masak: I guess it's there to calrify that it's a list 21:40
s/cal/clar/ 21:43
masak moritz: ah yes, that actually makes sense, thx
moritz np 21:44
masak moritz: what might it otherwise be confused with? 21:48
moritz I don't know... scalars? 21:49
masak hm
maybe through some rule along the lines of $scalar === [$scalar], in that case 21:50
moritz ?eval 1.perl
evalbot_r15525 "1"
moritz ?eval [1].perl 21:51
evalbot_r15525 "[1,]"
TimToady the comma is superfluous inside [] but not inside ()
the only other possible source of confusion is reduce operators
and infix:<1> is discouraged. :)
masak TimToady: :) 21:53
I still have trouble handling lists in perl6 21:54
masak how does one do @array = @$arrayref in perl6? 21:54
masak ?eval $a = [1,2,3]; my @b = @$a; @b.perl 21:56
evalbot_r15525 "[1, 2, 3]"
masak :/
allbery_b hm? 21:57
PerlJam masak: @b = $a; should work fine.
masak ?eval $a = [1,2,3]; my @b = $a; @b.perl 21:58
evalbot_r15525 "[[1, 2, 3],]"
masak nope
that is what confuses me
I want @b to end up being "(1, 2, 3)"
allbery_b ?eval my @a = (1, 2, 3); @a.perl 21:59
evalbot_r15525 "[1, 2, 3]"
masak heh
allbery_b looks right to me
masak it does
PerlJam yeah, [1,2,3] and (1,2,3) are essentially the same.
allbery_b p6 makes the whole references vs. values thing a bit more consistent
masak ok, so far it only serves to confuse me 22:00
allbery_b thus resolving quite a bit of confusion common in perl5
masak I think the p5 model is consistent :)
PerlJam But that @b=$a behavior is weird.
masak: perl6 doesn't have references :-)
masak PerlJam: that actually explains a lot
so how are lists able to contain arrays? 22:01
allbery_b perljam: I believe that's specced. you gave it a scalar, it was promoted to a single-element list
PerlJam allbery_b: That may be the case, but it's still weird :)
gaal ?eval $a = [1,2,3]; my @b = @($a); @b.perl
allbery_b (in rder to match the list context)
evalbot_r15525 "[1, 2, 3]"
gaal PerlJam: is it weird? @b = 42 puts 42 in slot 0; @b = $a puts $a in slot 0. 22:03
allbery_b ==gaal
the only way it doesn't "make sense" is if you expect perl5 behavior. but this isn't perl5 :) 22:04
PerlJam gaal: Sure, in that context it makes sense, but in the context of references disappearing in p6 it seems weird. i.e., $a = @b and @a = $b seems like they should be symmetric
pasteling "masak" at 130.238.83.176 pasted "I'm trying to implement a powerset coroutine in perl6, but running up against to many or to few list containers all the time. Help appreciated" (21 lines, 492B) at sial.org/pbot/23367 22:05
PerlJam er, $a = @b; @b = $a;
you know what I meant :)
masak: as a tangent, it looks like you should be using coro powerset([$head, *@tail]) { ... } # assuming I remember the syntax there. 22:06
masak er, s/to many/too many/ and s/to few/too few/...
gaal > let powerset = filterM (const [True, False]) in powerset [1,2,3] 22:07
lambdabot [[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]]
allbery_b they are symmetric int he sense that imposing scalar context on an array gives you the array itself (what p5 would call a reference), while imposinbg an array context on a scalar gives you a single-element list
masak PerlJam: good idea. what about the case when the incoming list is empty?
PerlJam masak: that's what multi is for :)
masak PerlJam: multi coro? sexy
masak tries 22:08
btw, I still don't quite know what the splat is doing there in *@tail
anyone have a simple explanation? 22:09
allbery_b making sure the list is unwrapped in place instead of becoming a 2nd element which is itself a list? 22:10
gaal masak: f(@a, @b) passes two args to f
allbery_b doesn't actually recall
damn drugs making me fuzzy :/
gaal f(@a, *@b) passes 1+@b.elems 22:11
masak gaal: aha, thx
gaal everybody's ill :(
masak so the splat says something like "all the rest"
PerlJam masak: right.
Although, I think the syntax has actually changed.
masak PerlJam: can I write multi coro powerset( [] ) for the base case? 22:12
PerlJam masak: That's what I would hope (I don't know if that works in pugs)
masak PerlJam: seems like it doesn't
gaal masak: you mean, a guard?
PerlJam (The moral equivalent works in haskell ;-) 22:13
masak at least, multi coro powerset( [$head, *@tail] ) surprises pugs
gaal: I don't know, maybe I do.
gaal those are better served by "when" clauses inside the body
masak :)
gaal sub { when [] {...} }
coro powerset { when [] {...} }, in this case 22:14
<- should yield to sleep
good night :)
masak 'night
PerlJam g'night gaal 22:15
masak: I believe that audrey is hacking pugs again ... maybe you can get her to make pugs recognize those signatures. 22:17
:-)
masak PerlJam: I too believe she is -- yes, that would be a nice addition 22:19
maybe I should just write some tests for it like a good citizen
PerlJam that would be excellent
masak but for some reason I cannot reach svn.pugscode.org today... 22:20
PerlJam though I keep having the nagging feeling that the syntax has changed for array slurping (the splat)
masak PerlJam: yes, that sounds vaguely familiar
PerlJam Hmm. from S03: prefix:<|>, flatten object into arglist 22:23
I think that's the same thing
maybe not though
masak but maybe that is supported
masak tries that
PerlJam in any case, S03 does not mention prefix<*>
er, prefix:<*>
anyway ... back to work 22:25
masak hm, no, actually pugs gets stuck earlier, saying 'Unexpected "[$"'
PerlJam well, almost back to work ... 22:25
no, definitely back to work :-) 22:27
talk to you later
masak PerlJam: :) yes 22:29
allbery_b gaal: not ll. psycho. :/ antianxiety meds... 22:47
svnbot6 r15529 | lwall++ | style upgrade to problem36 23:32
svnbot6 r15530 | lwall++ | Added gather and list comprehension forms of problem 16 23:56