»ö« | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by moritz_ on 25 June 2010.
00:02 astrojp joined
masak TimToady: attempting to implement your $input.comb( / \N*\n | \N+$ /, $limit ) in Rakudo revealed a bug -- non-final lines get their newline combed along with the line content, in contrast to the old IO.lines (and most anything in Perl 6). plz fix. :) 00:07
masak goes to sleep 00:08
'night, #perl6! 00:09
00:10 masak left 00:11 ewilhelm joined
jnthn sleeps too 00:11
o/
00:14 ruoso joined
ewilhelm is there a more current "cheatsheet" than Damian's 2003 draft? (www.perlmonks.org/?node_id=238031) 00:16
I'm going to throw a whole pile of perl mongers into the deep end and thought it would be neat to get them some of those little floaty things :-D 00:17
TimToady something that old is likely to behave more like sinkers 00:20
00:20 kensanata left
TimToady lemme see if I can update it 00:22
lue Is there a Perl6 syntax highlighting file for emacs?
00:24 ashleydev left
ewilhelm lue, the vim one has been in the pugs repo iirc 00:24
00:24 lest_away is now known as lestrrat
ewilhelm lue, this is next to that: svn.pugscode.org/pugs/util/cperl-mode.el 00:26
svn log implies that this is what you want
lue ah, I missed it. thank you. 00:27
ewilhelm TimToady, it would be awesome to be able to have a handout for this kind of thing: pdx.pm.org/kwiki/?July2010Meeting 00:28
00:29 kensanata joined 00:39 kid51 joined 00:44 ashleydev joined 00:47 patspam left 00:48 ashleydev left 00:50 kensanata left
lue is shocked that he can't find out how to update an emacs major mode... 00:53
00:59 ashleydev joined
sorear the vim syntax highlighting file is quite slow 01:02
I haven't decided yet if it's worth using
lue (apparently, the one piece of information they left out was how to update your major modes.) 01:03
01:07 kensanata joined, ashleydev left
tylercurtis lue: just add a (load "/path/to/the/cperl-mode.el") to your .emacs 01:09
01:09 sftp_ joined
lue I don't want to conflict with my exisitng cperl-mode, which is why I want to update. 01:10
01:10 sftp left
ingy greetings 01:15
lue hello 01:16
PerlJam greets
01:24 kensanata left 01:25 astrojp left
pmichaud ewilhelm: you might also tell people about the book: github.com/perl6/book/ 01:25
we'd love to get feedback 01:26
lue
.oO(hrm, how to set up cperl-mode to highlight Perl *6*....)
pmichaud (click "downloads" to get to the already-converted pdf versions)
01:28 ruoso left
kid51 pmichaud: Looks like I will give that talk on Rakudo* at NYLUG in two weeks. 01:33
pmichaud kid51: excellent
I'm hoping to write up some of those notes tonight, will send you a link to the draft 01:34
kid51 Would reading that book be useful prep for that.
?
pmichaud it might -- at least the first couple of chapters (more)
you might also just skim each section and see what (if anything) jumps out at you as being "whoa, that's cool" :-)
01:34 sftp_ left
pmichaud and if nothing jumps out, we need to know that too :) 01:34
kid51 k
I think I'm going to present this talk as "an announcement, and also as an invitation," but NOT as "an explanation" 01:35
01:35 plobsing joined 01:36 TiMBuS joined
pugssvn r31573 | lwall++ | [Str] limits should default to Inf rather than * since that is (supposedly) compatible with Int 01:37
tylercurtis Why do I get a segfault on eager-ing a large enough list in rakudo? Is that a Parrot bug? 01:41
pmichaud tylercurtis: might be running out of memory
sorear probably not
just stack overflow
parrot doesn't like big linked lists in the GC 01:42
01:42 ruoso joined 01:52 silug joined 01:54 proller joined 01:56 eternaleye joined 02:02 meppl left 02:08 silug left
lue afk 02:09
ewilhelm pmichaud, no html version posted somewhere?
02:11 jimk joined
pmichaud ewilhelm: alas, not yet 02:11
pdf tends to work for our needs 02:12
02:13 kid51 left, eternaleye left
ewilhelm suppose I could print a couple of those to have on-hand at the meeting 02:15
pmichaud I tend to just view them via pdf reader 02:17
works about the same as html :-)
02:17 eternaleye joined
ewilhelm you have one of those tallscreen monitors? ;-) 02:17
pmichaud no, but I know how to minimize the menus and sidebars in acrobat reader :) 02:19
anyway, yes, we need more cheat sheets and intro materials
afk for a bit 02:20
02:30 aindilis left 02:46 perigrin joined 02:49 jimk left
perigrin I had a curiosity question about callsame as illustrated in masak's "mixin" post ... is it implicitly a method call there? 02:51
(use.perl.org/~masak/journal/40434 context) 02:52
02:53 redicaps joined 03:02 redicaps left 03:03 redicaps joined, agentzh joined 03:05 masonkramer left 03:13 xinming left
TiMBuS perigrin, you mean callsame? 03:22
perigrin TiMBuS: er ... yes did I spell it wrong?
TiMBuS no i meant, are you asking if callsame is implicitly a method call or is something else in the code misleading you 03:23
(and yes, it is a method call)
perigrin hmm 'k that's what I figured ... but it didn't use the '.' sigil for implicit invocants so I wasn't sure. 03:24
TiMBuS callsame/callwith/nextsame/nextwith are all a bit special 03:25
perigrin that means to directly replicate masak's code in Perl5 I'd have to resort to XS witchery. I'm fine with an explicit invocant instead :)
or hmm possibly Devel::Declare whcih is XS witchery but XS witchery I'd already brought in when I used MX::Declare. 03:27
TiMBuS are you planning on making a mixin library for perl5? 03:28
perigrin other than does and callsame, Moose basically gets there 03:30
gist.github.com/raw/56f4618d33c3bb...tfile2.txt is very very close to what masak had and I can't see why it wouldn't work. 03:31
TiMBuS that's about right. 03:33
the bigger difference is callsame will work in subroutines as well 03:35
and in wrapped methods/subs
perigrin right 03:37
03:38 ash_ joined
perigrin which is partly why I was confused by it's nature here ... did it supply an invocant ... and if so why didn't it use .callsame 03:38
perigrin shrugs
TiMBuS i guess its not really needed because you cant callsame on something that isnt the same? ¯\(°_o)/¯ 03:42
perigrin yeah and perl6 doesn't have perl5's issues with context being the only differentiator between function calls and method calls. 03:43
TimToady callsame doesn't know what its object is until it has a conversation with the surrounding dispatcher 03:47
03:47 [Coke] joined
TimToady the routine it is going to call is certainly *not* in $_ 03:47
TiMBuS yay someone who can explain it more concretely! i didnt want to make assumptions because, well you know.. 'yada yada, u and me' 03:48
03:49 Guest5559 left
TimToady to the first approximation, nextsame is equivalent to "next CANDIDATE", assuming that some dynamically surrounding dispatcher has a loop over the candidates that is labelled CANDIDATE: 03:49
TiMBuS i think he meant $.callsame though 03:50
TimToady the other variants are not as much like "next LABLE"
LABEL even
since next doesn't allow you return ("call"), nor pass arguments ("with") 03:51
one way it might work is if the surrouding candidates are in @*CANDIDATES 03:52
then callsame is equivalent to @*CANDIDATES.shift.callsame
but the specs don't currently specify how a dispatcher communicates with its control verbs 03:53
03:53 redicaps left
TiMBuS i like lable better. adds a bit of french romance to the language :) 03:56
diakopter it's mushy enough as it is ;) 04:03
04:04 silug joined 04:07 tedv left
perigrin TiMBuS: I did mean $.callsame, confusing that with .callsame is my bad. 04:13
04:14 ashleydev joined 04:15 tylercurtis left 04:20 hercynium left 04:26 ashleydev left 04:32 ashleydev joined 04:34 jaldhar joined 04:45 skids left 04:56 thebird joined
TimToady $.callsame implies that there's a callsame method on self, which is doubtful 05:12
unless self happens to be a routine
sorear How does lastcall work then? 05:19
05:24 pmichaud left, pmichaud joined 05:53 jaldhar left, jaldhar joined 06:08 eternaleye left 06:10 _mpu joined 06:25 tadzik joined
TimToady ewilhelm: here's a more up-to-date cheat sheet: www.wall.org/~larry/cheatsheet 06:27
06:27 _mpu left
TimToady anyone else who cares to may also proofread it 06:28
ewilhelm TimToady, awesome. Thank you. 06:32
06:34 uniejo joined
lue I love the descriptions for augment and supersede. 06:35
TimToady just revised it a bit
list ops was a fossil
more tweaks 06:38
06:38 rgrau_ left
sorear TimToady: I don't see m// anywhere 06:40
lue rakudo: #`(parasite!) supersede class Int { method Str { "hi" } }; say Int.Str
p6eval rakudo 894e79: OUTPUT«===SORRY!===␤"supersede" not yet implemented at line 11, near " class Int"␤» 06:41
lue .oO[ Figures I'd find a 6502 compiler in Perl :) ] 06:43
TimToady revised again, but dunno where I'd put m// 06:46
moritz_ hehe, my browser shortens the title of the cheatsheet to ...eatsheet 06:47
#rakudo is new to mee
s/ee/e/
lue I went there, and I became a chanop of 1 people. 06:48
TimToady oh, was thinking #parrot 06:49
changed 06:50
lue
.oO(It's the kind of cheat sheet to have printed upside-down on a tshirt)
06:51
moritz_ \w == <+space+digit+[_]> 06:52
s/space/alpha/
TimToady right 06:54
sorear wait, !after !before !eq !eqv and !=== are real operators? 06:55
TimToady rakudo: say 1 !after 2 06:56
p6eval rakudo 894e79: OUTPUT«1␤»
lue wants an updated periodic table of operators!
sorear they look like metaop instantiations to me
TimToady well, sure, it doesn't say they're
moritz_ does them make a less "real" operator?
TimToady "real"
06:56 tadzik left
TimToady the main omission is there are no roles 06:57
sorear apparently, in C#, you have to say foreach (foo in bar) 06:58
saying for (foo in bar) fails with a ten-page error cascade
even Perl5 did this better :(
lue thanks to roles separating the two common functions of classes, I'm having to think about how to structure my code. Curse you, good language design! 06:59
sorear lue: rule of thumb, never use 'is'
superclasses are so 1960's
also, I've yet to find a reason to use inheritance other than "this @*$#* language won't let me declare a role" 07:00
lue I had to do that in Python. I think, once I figure how to structure my code, roles will help big time. 07:02
07:03 Ross joined
TimToady I guess I'll post it to perlmonks now 07:04
07:06 lestrrat is now known as lest_away 07:07 ash_ left 07:11 shade_ left 07:12 kfo joined 07:15 kfo_ left
lue afk 07:17
TimToady zzz 07:18
07:20 f00li5h joined, f00li5h left, f00li5h joined 07:23 shade_ joined
sorear awesome. my &die just crashed. 07:24
07:27 envi^home joined 07:28 bbkr left 07:30 indra joined 07:31 indra left
dalek ecza: 91d480a | sorear++ | (3 files):
Implement C3 MRO. Allow classes to have superclasses.
07:34
ecza: bd25cc5 | sorear++ | (2 files):
Add add-super to the MOP. NEW CLASSES: Any, Cool
07:51 xinming joined 07:56 shade_ left 07:59 Mowah left 08:01 Mowah joined, timbunce joined 08:04 lest_away is now known as lestrrat 08:06 Mowah left 08:23 plobsing left 08:26 dakkar joined 08:31 Mowah joined 08:36 shade_ joined 08:37 dakkar left 08:38 LionMadeOfLions left, kensanata joined 08:39 dakkar joined 08:40 LionMadeOfLions joined 08:43 shade_ left 08:46 Trashlord left 08:47 Trashlord joined 08:55 clintongormley joined
dalek ecza: a3a064e | sorear++ | (5 files):
Tie the knot and grandfather Scalar and Sub under ClassHOW
08:58
sorear niecza now has something you could call a class hierarchy 09:04
Mu -> Cool
erm.
moritz_ Mu -> Any -> Cool I hope
sorear Mu -> Any -> Cool
-> Sub
-> Scalar
nothing else yet 09:05
09:05 meppl joined
sorear next up is the numbers 09:05
I need to learn how coercions work
moritz_ method calls :-) 09:07
mathw gotta start somewhere 09:08
so clearly you now need Junction and autothreading :)
sorear that can wait 09:09
after numbers, I'm doing regexes
moritz_ recommends strings too 09:10
sorear I already have str 09:11
arnsholt Heh. Those might be useful for testing the regexes one supposes =)
sorear Str shouldn't be too hard
arnsholt: I plan on giving the regexes the ultimate torture test 09:12
mathw Depends, do the underlying .NET strings do .graphs and .chars and all that?
sorear a regex so nasty that Rakudo chokes and dies
arnsholt Interesting. What is it?
sorear STD.pm6
arnsholt =D
Nice, nice
sorear .NET strings only do .chars 09:13
mathw haha
sorear but I think that's ok
for now
mathw it's a good start :)
sorear .bytes is quite easy, it's just 2 * .chars
phenny sorear: "is quite easy, it's just 2 * .chars"
mathw are they always in two-bytes-per-character format then? 09:14
sorear they're always in either UCS-2 or UTF-16
the docs are not quite clear on which it is
sorear will have to RTFS, but not now 09:15
mathw well that could be entertaining :)
sorear "Mono" 09:16
jnthn ddmorning 09:19
s/dd// :-) # oops 09:20
moritz_ jnthn: good morning. Are you shivering? :-)
jnthn I can only conclude I wrong-windowed this one for vi at some point... :-)
hejki hehe, i'm usually saying :wq to irc :P 09:22
moritz_ :wq
hugme hugs moritz_, good vi(m) user!
arnsholt I've just given up and started signing all my mails with :wq =)
hejki hugs hugme, good huggiving hugmachine 09:25
jnthn #18010 0x00007ffff7a5e708 in Parrot_gc_mark_PMC_alive_fun
ENOTFUN 09:26
pugssvn r31574 | moritz++ | [perl6.org/documentation] add cheat sheet, clean up a bit
sorear jnthn: nothing to see here, just a run of the mill "linked lists are not supported on Parrot" crash 09:28
OK
I need to understand more of the implicit coercion case
sub foo (Num $x) { } # Can I pass 2 to this? 09:29
moritz_ no
(rakudo gets this wrong, because it follows an older spec)
if you want to allow 2, you'd write sub foo (Real $x) { } 09:30
sorear Are there any implicit coercions?
jnthn sorear: No
sorear: Not so far as I can tell
sorear: It's more like, some operators put things into a certain context, and that is what leads to a coercion 09:31
sorear Hah... this simplifies things.
jnthn But the actual coercion is always explicitly requested somewhere
like the multi candidate :(Any, Any) for infix:<+> does a Numeric coercion on each argument.
And re-dispatches. 09:32
pugssvn r31575 | moritz++ | [perl6.org/documentation] remove a book with wrong link (there does not seem to be a correct link on the apress site for it) 09:35
sorear Not :(Cool, Cool)? 09:38
I thought Cool was the type for objects that could be expected to support .Numeric and .Stringy
moritz_ I don't think that notion has propagated to operators yet, only ordinary routiines 09:40
might be worth considering though
sorear Stringy doesn't seem to actually be specced 09:45
~ coerces /to/ Stringy, Str and Blob /do/ Stringy 09:46
but what Stringy /is/? No
moritz_ it's the common role of strings and buffers
sorear is trying to understand how Cat pretends to be Str, ish
moritz_ it is Cool, and supports substr(), split, match, subst, ... 09:47
sorear so Cat needs to duplicate all the methods of Str?
moritz_ unless it finds a clever way to delegate them 09:48
09:48 shade_ joined
sorear have we solved the &reducewith problem yet? 09:49
moritz_ which one?
sorear defining helper subs in the setting that the compiler can find, but without polluting 09:50
moritz_ that's easy - put it in a package
the question was more if we want reducewith to be seen 09:51
arnsholt One of the PDDs (can't remember which one off-hand) suggests storing private bits in a different HLL namespace
moritz_ and iirc the answer was "yes, but maybe with a different name"
sorear PDDs have no meaning here
neither do HLL namespaces
this is #perl6, not #parrot
moritz_ arnsholt: that's a parrot thing, and sorear is working on a non-parrot implementation :-)
sorear and I happen to be working on a .NET implementation 09:52
arnsholt Oh, right. My bad, my bad
moritz_ anyway, the specs talks about all-cap names being potentially resevered
so it doesn't feel so bad to have an INTERNAL namespace where all semi-private stuff is put
sorear and if you shadow my package INTERNAL { }, is the compiler allowed to blow up in your face? 09:53
moritz_ yes
dalek book: 19a45cb | (Dean Serenevy)++ | bin/book-to-latex:
book: Properly render side bars.
book: Makes use of new Pod::PseudoPod::LaTeX features.
09:53 dalek left
moritz_ because you mocked with a potentially reserved name 09:54
09:54 mberends joined, dalek joined
arnsholt sorear: I imagine that'd be a bit like shadowing stuff like defun() in CL. At your own peril, and you better be sure it works =) 09:54
sorear arnsholt: well, it gets more interesting because a lot of stuff desugars to use INTERNAL:: stuff 09:56
like 'my $x' uses INTERNAL::Scalar 09:57
and INTERNAL::Any
09:57 sorear sets mode: +v dalek
arnsholt Heh. Then explosions would be entirely warranted I think =) 09:58
sorear (OOC, why don't we use cia.vc?)
I guess I'll need to implement packages soon. :)
hmm.
rakudo: eval 'package Foo; my $x = 2'; say $::Foo::x; 09:59
moritz_ another possible... "solution" is to store lexicals with sigils taht aren't accessible from within normal Perl 6 code
p6eval rakudo 894e79: OUTPUT«Null PMC access in type()␤ in main program body at line 11:/tmp/Klhmjdqhp7␤»
moritz_ NPMCA is LTA, but better than giving away $x :-)
sorear moritz_: you mean, having a special sigil which only parses in the setting?
moritz_ rakudo: eval 'package Foo; our $x = 2'; say $Foo::x
p6eval rakudo 894e79: OUTPUT«Null PMC access in type()␤ in main program body at line 11:/tmp/XLMtU30RgN␤»
sorear rakudo: eval 'module Foo { our $x = 2 }'; say $::Foo::x; 10:00
p6eval rakudo 894e79: OUTPUT«2␤»
moritz_ sorear: for example. Or having a lookup-by-name that doesn't even need to parse the sigil
sorear moritz_: I have to define them somehow
question: should that code example I just gave run? There's some stuff hinting that 'our' names are only visible if they are defined in a compilation unit transitively depended on by the current 10:01
sorear out. 10:04
10:25 masonkramer joined 10:26 lestrrat is now known as lest_away 10:39 JimmyZ joined 10:47 kensanata left 11:04 ruoso left 11:07 Mowah left 11:13 redicaps joined
sorear on the subject of no coercions: 11:18
What is the type of pi? 11:19
11:19 Mowah joined
moritz_ STD.pm6 seems to assume it's Num 11:21
CORE.setting 11:22
100:import Num <pi e i>;
oh wait, that's only the package holding it
either Rat or Num, I think
constant pi is export = 3.14159_26535_89793_238 11:24
that's a Rat
sorear you're looking at the wrong definition 11:25
that's the Rakudo definition
moritz_ nope
that's in src/perl6/CORE.setting in the pugs repo 11:26
line 96
sorear hrm
maybe I should use that.
but my question stands: 11:27
constant pi is export = 3.14159_26535_89793_23846_26433_83279_50288;
what is the type of this?
S02 says that it's some magic thing that knows how to be a FatRat, but isn't unless you explicitly ask it to be one
moritz_ I guess making it a FatRat by default isn't too bad 11:30
pmichaud good morning, #perl6 11:31
arnsholt Moin 11:32
moritz_ good localtime()
11:32 moritz_ sets mode: +oo pmichaud arnsholt 11:33 sorear sets mode: +v hugme 11:36 redicaps left 11:40 rv2733 joined 11:42 kensanata joined 11:43 Mowah left
jnthn morning, pmichaud 11:49
pmichaud jnthn: o/
11:50 Mowah joined 11:52 masak joined
masak oh hari, #perl6! 11:52
(mata hari, that is)
jnthn ohlolitsmasak 11:54
frettled The Gang of Three are all active, wooohooooo. 11:55
11:59 bbkr joined 12:05 timbunce_ joined 12:06 timbunce left, timbunce_ is now known as timbunce 12:11 sftp joined 12:18 masonkramer left, JimmyZ left 12:21 szabgab left, szabgab joined 12:28 gfldex joined
masak forgets the parentheses around an if expression in Perl 5 12:35
TiMBuS hmm. so Sub.wrap isn't working.. it's looking for an attribute in Sub that doesn't exist, then trying to get a property from this nonexistent attribute 12:42
12:42 cinch joined
TiMBuS is this code copied from alpha that hasn't been fully hooked up again? 12:42
moritz_ rakudo: (sub f { }).wrap()
p6eval rakudo 894e79: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤ in main program body at line 1␤»
moritz_ rakudo: (sub f { }).wrap(-> { }) 12:43
p6eval rakudo 894e79: OUTPUT«No such attribute 'proxy' in class 'Sub'␤ in main program body at line 1␤»
TiMBuS yep thats the one
moritz_ looks like it, yes
TiMBuS cur_sub = getattribute self, ['Sub'], 'proxy'
masak submits rakudobug
TiMBuS no mention of proxy anywhere else in the code..
12:44 ghfhdf joined
TiMBuS if i knew what a 'property' was i could probably patch this up 12:44
moritz_ tries if adding a 'proxy' attribute fixes it... would be surprising :-)
TiMBuS: a "property" is simply a piece of data attached to any parrot PMC
which can be set with setprop 12:45
and be retrieved with getprop
jnthn wrap needs re-writing for R* 12:46
er
Since ng
Well both :-)
TiMBuS moritz_, ahh ok, i gathered that from google snippets but wasn't sure 12:47
ive always just used attributes. there's probably a difference 12:48
12:49 rgrau_ joined 12:50 ruoso joined 12:56 perlygatekeeper left 12:58 [Coke] left, [Coke] joined
moritz_ I've now started a guerilla (unofficial) #yapc-eu channel on irc.perl.org 13:01
13:01 perlygatekeeper joined
pmichaud there's not a #yapceu already? or you want a separate one? 13:01
moritz_ I wasn't aware of one
no, #yapceu is *so* empty 13:02
pmichaud interesting
I think traditionally it's been without the hyphen
szabgab there is one called #yapc 13:03
on irc.perl.org
moritz_ oh
so maybe it's counter-productive to start another one 13:04
szabgab and it is shared between the us and the eu people
pmichaud szabgab++
szabgab moritz_: I'd be happy f you sent me your slides for yapc so I can try to work around it in my class :) 13:05
moritz_ szabgab: I'd be happy to have slides that I could send you :-)
szabgab: I'll start coding them soon, and let you know about them
pmichaud szabgab: looks like I'll be in pisa most of the day on Saturday... okay if I sit in on your course? ;-)
(on Aug 7, that is) 13:06
szabgab pmichaud: if you don't talk too much with the classmates :)
wrong
only if you DO talk a lot with the classmates 13:07
pmichaud I will do my best to be helpful and not distractive, yes. :-)
jnthn afk for a bit, attempting not to fail some cert :-) 13:09
szabgab pmichaud: so as I am blogging about the class, I think I can alrady tell them that I have at least one student :)
moritz_ is davorg == Dave Cross? 13:10
szabgab moritz_: yes 13:11
moritz_ szabgab: thanks
13:12 skids joined 13:17 kensanata left
pmichaud TimToady++ # Perl 6 cheatsheet v2 13:18
TimToady: could we perhaps put the file for the cheatsheet into the pugs repo?
13:18 sftp left
pmichaud and, has anyone tweeted the cheatsheet yet? 13:19
13:19 sftp joined
moritz_ don't think so 13:19
Juerd Ooh, cheatsheet? Sweet. 13:21
pmichaud hugeme tweet rakudoperl New Perl 6 cheatsheet available! www.wall.org/~larry/cheatsheet
Juerd I was just about to ask for the url :)
pmichaud hugme: tweet rakudoperl New Perl 6 cheatsheet available! www.wall.org/~larry/cheatsheet
hugme hugs pmichaud; tweet delivered
pmichaud ta-daa!
Juerd only just in time hit ^U instead of enter 13:22
Wow. Nice work, TimToady++
I love how the types were crammed in :)
cosimo lazy question, what's the Perl 6 equiv for '$self->SUPER::new($something)' ? 13:23
self.SUPER.new($something) ?
moritz_ nextwith($something) # dispatches to the next candidate 13:24
arnsholt callsame/nextsame and friends I think 13:25
Right. What he said
13:25 thebird left
masak I'm partway through making a PDF version of the cheatsheet. masak.org/carl/cheatsheet.pdf 13:27
part-way feedback welcome.
arnsholt Looks pretty good so far
moritz_ looks part-way nice
Juerd I think non plaintext cheatsheets should be designed from scratch 13:28
masak yes, probably :)
Juerd Much of the layout is dictated by the plaintext format, and when you don't have those constraints, you can make much nicer designs
13:28 Kodi joined
masak Kodi: ping 13:29
Kodi masak: Hey.
Juerd I don't know how TimToady feels about this, but as the author of the p5 cheatsheet I usually dislike the PDFs that people make (several have tried), even though I really do appreciate the effort.
masak Kodi: one very sane definition of "quarter" is "three months".
Kodi masak: That makes sense. 13:30
Is it what people will expect, though?
masak I don't know.
pmichaud I would expect that whatever it is, it's not what I ultimately want. :-) 13:31
masak and I'm not going to defend re-instating quarters. they're pretty uncommon.
just slightly surprised that they went without any preceding discussion.
Kodi Well, it's weird. It's the kind of thing you would expect would be in ISO 8601, but it ain't. 13:32
[Coke] while I appreciate the #parrot shout out, does it fit?
Kodi I could implement this notion of quarter pretty easily, but the question is: does anybody care?
[Coke] masak: quarters are very common, depending on your business. =-)
Kodi: probably not worth it. 13:33
so, err on the side of smaller spec.
pmichaud omg, that reminds me!
masak :)
pmichaud files his quarterly sales tax report.
Kodi [Coke]: So be it.
Now, here's a funny issue:
rakudo: +(-'0') 13:34
p6eval rakudo 894e79: ( no output )
Kodi rakudo: say +(-'0')
p6eval rakudo 894e79: OUTPUT«-0␤»
moritz_ yeah, known
pmichaud o_O
moritz_ the problem is that numification of strings returns a Num
and not Int
and there's a negative zero with floating point arithmetics
Kodi What's the best way to make sure $x becomes 0 if it's -0 but is otherwise unchanged? 13:35
moritz_ $x.=Int if $x == 0
maybe
13:35 tylercurtis joined
Kodi rakudo: say (-'0').Int 13:35
p6eval rakudo 894e79: OUTPUT«0␤» 13:36
Kodi That should do, then. I need an Int here, anyway.
pmichaud I'm still surprised that the negative zero leaks into rakudo like that.
moritz_ I hope that colomon++ fixes this soonish
so that my Int $x = +"3"; also works 13:37
pmichaud I'm surprised that -'0' and +'0' returns a Num, too.
I kinda thought that had already been taken care of.
moritz_ it's one of those seemingly small but often annoying problems
rakudo: say (+'4').WHAT
p6eval rakudo 894e79: OUTPUT«Num()␤»
masak rt.perl.org/rt3/Ticket/Display.html?id=74070
pmichaud well, since I started a branch for Stringy, and since of of the blockers I'm having in that branch is the str2num functions, maybe I'll just redo those a bit 13:38
frettled masak: The orange and gray may be too close in luminance and saturation for people with red-green color blindness
masak frettled: 'gray'?
frettled masak: that was a slip, I meant green
masak frettled: anyway, the orange is going away in favour of the pink. 13:39
frettled: and the colors aren't vital, they're mostly for grouping.
[Coke] pmichaud is on fire this week. 13:40
frettled masak: yup, that was why I thought it merited mentioning :)
masak: because it may look as if things belong to the same group when they don't
[Coke]: pmichaud++ is smokin'
masak maybe the colour scheme will end up being completely different. it feels a bit too default right now.
frettled masak: but your PDF version inspired me into thinking about doing a CSS based version. 13:41
masak frettled: :)
hope you get around to it. would be nice to see. 13:42
frettled hopes so, too!
I'll start by pasting the text file into a HTML file and divide by <div> elements :) 13:43
13:43 uniejo left 13:47 timbunce_ joined
pmichaud TimToady: cheatsheet has "\w == <+alpha+digit+[_]>" should that be just <+alpha+digit>, or is it described that way to emphasize the _ a bit? 13:48
dalek kudo: e597953 | pmichaud++ | docs/spectest-progress.csv:
spectest-progress.csv update: 507 files, 33910 (84.4% of 40163) pass, 0 fail
13:49 lest_away is now known as lestrrat 13:51 timbunce left, timbunce_ is now known as timbunce
masak moritz_: ping 13:56
szabgab timbunce: nice story on the blog
pmichaud url? 13:57
timbunce szabgab: thanks. That's what I thought when Buzz emailed me, so I asked him if I could post it.
masak pmichaud: blog.timbunce.org/2010/07/08/reflec...ontributor
pmichaud agreed, nice story 13:59
14:08 gbacon joined
Kodi Should &time actually be named &now as per S02:1320, or is it intended to have both a function that returns seconds since January 1 1970 (&time) and a function that returns an Instant (&now)? 14:09
moritz_ szabgab: btw my talk will be rather light on Perl 6 content, the only thing I'll mention for sure is named placeholders
14:12 nadim joined
TimToady moritz_: the problem with a FatRat is it tends to turn everything else into FatRats, with performance implications 14:12
so it's probably better to stick to Rat precision 14:13
14:18 TiMBuS left 14:19 Mowah left
moritz_ TimToady: makes sense 14:21
masak rakudo: say -0.0 14:26
p6eval rakudo 894e79: OUTPUT«0␤»
masak I guess because we show integral floating-point numbers as Ints, there's no way to print the minus sign in -0.0. 14:27
pmichaud I think we should print -0.0 as "o_O" 14:30
rakudo: my $x = -0.0 but "o_O"; say $x 14:31
p6eval rakudo 894e79: OUTPUT«o_O␤»
14:31 cono left
[particle] make that a R* feature :) 14:34
pmichaud [particle]: we can also restore hcf as a dynop, if you wish. :)
masak rakudo: my $x = 5 buf False; if $x { say "OH HAI!" }; say "alive" 14:35
p6eval rakudo 894e79: OUTPUT«===SORRY!===␤Confused at line 11, near "my $x = 5 "␤»
masak rakudo: my $x = 5 but False; if $x { say "OH HAI!" }; say "alive"
moritz_ s/buf/but/
or bug :-)
p6eval rakudo 894e79: OUTPUT«OH HAI!␤alive␤»
masak too muhc buf work :)
s/hc/ch/ 14:36
I tried to fix the above during the Lund hackathon, but my patch met with interesting consequences.
moritz_ like? 14:38
rakudo: my $x = 5 but False; if ?$x { say "OH HAI!" }; say "alive"
p6eval rakudo 894e79: OUTPUT«alive␤»
masak my fix boolified the expression. yes, like that.
it added an implicit prefix:<?>
moritz_ I guess you must be careful to do the coercion only for the conditional, not for the formal parameter 14:39
masak exactly.
moritz_ rakudo: if 5 -> $x { say $x }
masak that's what happened.
p6eval rakudo 894e79: OUTPUT«5␤»
masak I love that feature.
I wonder if any other programming language has something like that.
14:40 Maddingue left
masak finished adding boxes to masak.org/carl/cheatsheet.pdf -- my main complaint now is that margins and padding aren't consistent. 14:41
14:43 kensanata joined
[particle] wow, that's um, ugly but useful 14:43
moritz_ I kinda see where you difficulties with patching 'if' came from
the AST is built in <xblock>
so if you change it there, you'd affect everything that uses xblock 14:44
which is... quite a lot, I think
pmichaud it needs to be handled at the vtable level
moritz_ get_bool calling .Bool if available?
pmichaud or we have to plan to write our own 'if' constract that doesn't use the one in PAST
TimToady masak: you lost the titles on the bottom boxes 14:45
pmichaud get_bool already does that, I think.
moritz_ so why doesn't it work with mixed-in Bool?
pmichaud 13:18 <pmichaud> TimToady: could we perhaps put the file for the cheatsheet into the pugs repo?
masak TimToady: oh, forgot to add them. thanks.
pmichaud (apologies if I missed response)
moritz_ right, it does
.sub '' :vtable('get_bool') :method $I0 = self.'Bool'() .return ($I0)
.end
+ newlines :-)
pmichaud I'm guessing the problem is that the get_bool from Parrot's Integer/Float classes is suppressing the one from Mu 14:46
moritz_ ah
right, otherwise it wouldn't work at all
14:47 ash_ joined
pmichaud so, one possibility is to write an explicit get_bool vtable for Int and Num 14:48
don't know if that will work, but might be worth trying 14:49
pugssvn r31576 | lwall++ | [docs/Perl6/cheatsheet.txt] initial checkin
pmichaud \o/
also, I had a note above about the definition for \w 14:50
pugssvn r31577 | lwall++ | [index] redirect to svn copy of cheatsheet 14:52
TimToady yes, well, I never can remember what my last decision about <alpha> was :)
it also gives a hint about the syntax of composite char classes 14:53
technically, there's one syntax error on the sheet
pmichaud agreed on the hint
TimToady there should be a ; between the when and the default 14:54
but it's really notional, so I think we can leave it out
masak new version uploaded, with titles on the bottom boxes. masak.org/carl/cheatsheet.pdf
pmichaud I'm curious as to how long it will be before someone says "underscore can't be in alpha, the cheatsheet shows it as being separate" :-P
pmichaud starts the timer.
14:55 clintongormley left
TimToady underscore can't be in alpha, the cheatsheet shows it as being separate 14:55
pmichaud Doesn't count. :-P
masak underscore can't be in alpha, the cheatsheet shows it as being separate
[particle] TimToady isn't someone?
TimToady no, I just Someone
*I'm
now my 'm key is starting to go...
14:56 buu left
[particle] ah, much less ugly with titles on the bottom boxes too 14:56
my 'e ' key often transposes itself to ' e'
TimToady masak: you have two blues touching. I recommend 4 colors. :) 14:57
masak :P 14:58
I'll just reverse the blue color with its red neighbour.
pmichaud okay, I've figured out that the "Types" bubble is Florida, but I'm not sure about some of the others. :-)
14:59 buu joined
TimToady Links is Iowa 14:59
masak updated -- no two same-coloured bubbles touching. 15:00
15:01 sftp_ joined, sftp left
masak er. expept for "Types" and "Operator domains" :/ 15:02
15:02 ghfhdf left
masak leaves it as it is for now 15:02
15:04 lue joined
slavik how can I type the funny << and >> quotes on a reg 105 key keyboard 15:05
15:05 kensanata left
TimToady do you have a compose key defined? 15:05
moritz_ it's altgr + y and altgr+x on my keyboard
might be z instead of y on a querty keyboard
TimToady if so, COMPOSE << and >> owrks
*wo 15:06
moritz_ or that, yes
slavik I don't think I do
moritz_ what OS are you using?
slavik Linux
keyboard layout "USA"
TimToady under vim ^K-<< or >>
moritz_ then configure a compose key
slavik according to gnome
moritz_ uses the Windows key as compose key 15:07
pmichaud I use the right-alt as a compose key
TimToady gnome you can also use CTRL-SHIFT-u ab to get «
moritz_ urks
TimToady I use the right menu key
moritz_ rakudo: say chr(:16<ab>)
pmichaud in my autostart, I have
slavik got it, thanks :)
p6eval rakudo e59795: OUTPUT«\xAB␤»
pmichaud xmodmap -e 'keysym Alt_R = Multi_key' 15:08
moritz_ rakudo: say :16<ab>
slavik I set the right winkey to compose
p6eval rakudo e59795: OUTPUT«171␤»
pmichaud right winkey works also
15:08 simcop2387 left
moritz_ rakudo: say chr :16<ab> 15:08
p6eval rakudo e59795: OUTPUT«\xAB␤»
moritz_ uhm, what's wront with that?
[particle] (; <-- right winkey?
moritz_ looks like it calls a .perl somwhere
TimToady and » is CTRL-SHIFT-u BB 15:09
pmichaud moritz_: it's a p6-eval something or other
works fine locally
moritz_ produces latin-1 on -e and REPL
pmichaud rakudo: say chr 171
p6eval rakudo e59795: OUTPUT«\xAB␤»
moritz_ diakopter: did you change p6eval recently? 15:10
pmichaud it's possible also that rakudo is forgetting (or no longer) setting utf8 mode on stdout
since we've done a few refactors on *IN and the like lately
15:11 rjbs joined
pmichaud afk, errands 15:11
TimToady course, then there's ≪ and ≫
slavik I realized a downside to being a linguist ... 15:12
15:12 sftp_ left, sftp joined
TimToady there's an upside? 15:12
slavik TimToady: there's never enough keys for you. :P 15:13
arnsholt There's a downside? =)
slavik TimToady: knowing diff languages and being actually qualified in creating new ones?
rjbs I just learned of the ~ twigil.
Is it basically for getting at variables related to the currently-in-effect syntax?
TimToady yes, it's for picking out one strand of the current language braid
rjbs Thanks! I was looking at www.wall.org/~larry/cheatsheet 15:14
It would be awesome to hypertextify that... but probably also a big pain.
15:14 Kodi left
TimToady so $~Regex is your current regex language, for instance 15:14
[particle] rjbs: now in color! masak++ masak.org/carl/cheatsheet.pdf 15:15
Juerd :|
15:16 ashleydev_ joined
TimToady shouldn't it have a butterfly somewhere? 15:17
Juerd The plaintext version doesn't have one either :P
TimToady also doesn't have colors. so?
Juerd Because it can't, but it could have a »ö« :)
15:18 clintongormley joined, ashleydev left, ashleydev_ is now known as ashleydev
rjbs I'm going to rebuild Rakudo so I can do more try-it-and-see again, but while I do that: my $x = 5 + *; yields a closure? 15:19
Juerd { 5 + $_ }, yes.
rjbs Thanks.
moritz_ rakudo: say (5 + *).WHAT
Juerd Or was that $^a
p6eval rakudo e59795: OUTPUT«WhateverCode()␤»
moritz_ rakudo: say (5 + *).signature.perl
rjbs Juerd: I'd expect $^a
p6eval rakudo e59795: OUTPUT«:(;; Mu $y)␤»
Juerd I don't remember if $_ works in closures
s/works/works like that/ 15:20
TimToady $_ and $^a are equivalent 15:21
but both require {}, while * requires the absence of {}
[particle] is $^a before $^A?
TimToady after 15:22
this is your brane on ASCII
masak $_ and $^a are equivalent, but using $_ makes the one parameter to the block optional.
rjbs [particle]: I think the correct answer is "don't do that"
[particle] so $_ is equivalent to the first l13lly-sorted param? 15:23
TimToady can't use $_ and $^x together
lue ohai o/
masak lue: \o
[particle]
.oO(or should that be l11cally...)
sigh, my spelling gene is recessive today 15:24
masak rakudo: $_ = 42; { say $_; say $^a }.(5)
p6eval rakudo e59795: OUTPUT«42␤5␤»
TimToady though I see that std doesn't catch it
masak submits rakudobug
neither does Rakudo.
diakopter moritz_: no
TimToady actually, the rakudo behavior makes some sense
masak I was just going to say that.
I think it's too harsh to forbit $_ in a block with $^a 15:25
s/forbit/forbid/
rjbs rakudo: $_ = 42; { say $_ }.(5)
p6eval rakudo e59795: OUTPUT«5␤»
15:25 rv2733 left
[particle] rakudo: $_ = 42; { say $_; say $^A }.(5) 15:25
rjbs So if there are no ^params, $_ can get the optional param. If there are, $_ is just $_.
p6eval rakudo e59795: OUTPUT«42␤5␤»
TimToady really means -> $_ is rw = OUTER::<$_> { } 15:26
rjbs That makes sense to me, I think. Acts like 5's (_) proto being implicit, sorta.
diakopter moritz_: why 15:28
15:29 ajs joined 15:34 Maddingue joined 15:36 hercynium joined
masak rakudo: my $a = 42 but role { method times(&c) { c for ^self } }; $a.times: { say "LOL" } # almost, but not quite, Ruby :P 15:36
p6eval rakudo e59795: OUTPUT«LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤LOL␤» 15:37
lue ... 15:38
lol
Juerd That's very almost-but-not-quite-entirely-unlike Ruby. 15:43
15:43 Mowah joined
TimToady rakudo: my $a = 42 but role { method times(&c) { c for ^self } }; $a.times:{ say "LOL" } 15:44
p6eval rakudo e59795: OUTPUT«Method 'times:{ say "LOL" }' not found for invocant of class ''␤ in main program body at line 11:/tmp/v0cAK8X5wm␤»
diakopter feedb 15:45
TimToady rakudo needs to reject :{} as name extension like std does 15:46
masak "Perl 6: forcing in whitespace between terms since 2002." 15:47
moritz_ rakudo: say chr :16<ab> 15:50
p6eval rakudo e59795: OUTPUT«\xAB␤»
moritz_ diakopter: I'm pretty sure that worked before 15:51
lue rakudo: say chr(:16<ab>)
p6eval rakudo e59795: OUTPUT«\xAB␤»
lue rakudo: say (:16<ab>).WHAT
p6eval rakudo e59795: OUTPUT«Num()␤»
pugssvn r31578 | lwall++ | [cheatsheet] remove spurious comma noted by diakopter++ 15:52
r31578 | add missing camelia noted by Juerd++
15:53 dolmen joined 15:54 dolmen is now known as Guest72762
Guest72762 rekudo: my $x = "Red"; say $x ~~ "Red" | "Blue" | Yellow"; 15:54
rakudo: my $x = "Red"; say $x ~~ "Red" | "Blue" | Yellow";
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "say $x ~~ "␤»
masak o.O
Guest72762 rakudo: my $x = "Red"; say $x ~~ ("Red" | "Blue" | Yellow");
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "say $x ~~ "␤»
masak the first one should work... 15:55
Juerd Second too :)
masak botched quotes?
15:55 macdaddy joined
masak rakudo: my $x = "Red"; say $x ~~ "Red" | "Blue" | "Yellow" 15:55
p6eval rakudo e59795: OUTPUT«1␤»
Juerd What did you do different?
15:55 macdaddy is now known as Guest865
masak Guest72762: where did you get those quotes? 15:55
they seem suspect.
Juerd: I typed it in. 15:56
15:56 Guest72762 is now known as dolmen__
TimToady std: my $x = "Red"; say $x ~~ "Red" | "Blue" | Yellow"; 15:56
p6eval std 31577: OUTPUT«===SORRY!===␤Confused at /tmp/WrMAX3lbrA line 1:␤------> "Red"; say $x ~~ "Red" | "Blue" | Yellow⏏";␤ expecting any of:␤ POST␤ argument list␤ bracketed infix␤ infix or meta-infix␤ postfix␤
..postfix_prefix_meta_operator␤ statement modifier loop…
dolmen__ masak: on my keyboard: I'm using the Freenode webchat
TimToady std: my $x = "Red"; say $x ~~ "Red" | "Blue" | "Yellow";
p6eval std 31577: OUTPUT«ok 00:01 111m␤» 15:57
spinclad .u "
phenny U+0022 QUOTATION MARK (")
TimToady the quotes are fine if you use an even number of 'em
spinclad std: Yellow"
p6eval std 31577: OUTPUT«===SORRY!===␤Confused at /tmp/06wz2bVPIb line 1:␤------> Yellow⏏"␤ expecting any of:␤ POST␤ argument list␤ bracketed infix␤ infix or meta-infix␤ postfix␤ postfix_prefix_meta_operator␤ statement modifier 15:58
..loop␤Undeclared name:␤ 'Yellow' used at…
masak oh!
didn't see that. :)
dolmen__ There is a good opportunity for talking about Perl 6 on StackOverflow: stackoverflow.com/questions/3205065...arison-ope
spinclad was blind two
dolmen__ oh yes, I missed the left quote on yellow 15:59
TimToady std: Yellow"␤␤␤␤"MOAR $code"
p6eval std 31577: OUTPUT«===SORRY!===␤Two terms in a row at /tmp/eWt5vhHw54 line 1:␤------> Yellow⏏"␤ expecting any of:␤ POST␤ argument list␤ bracketed infix␤ infix or meta-infix␤ postfix␤ postfix_prefix_meta_operator␤ statement
..modifier loop␤Undeclared name:␤ 'Yello…
lue ooh, that makes a great puzzle. I missed that.
Juerd Wow, incredible how several people missed the same rather obvious mistake :)
TimToady hmm, I think my runaway detection might be borken 16:00
masak It's like missing the error in "I have to feed the the cat." :)
Juerd I see that one though
Even in the
the image that goes like this.
TimToady std: Yellow "␤␤␤␤"MOAR $code" 16:01
p6eval std 31577: OUTPUT«===SORRY!===␤(Possible runaway string from line 1)␤Confused at /tmp/fM_JoEEQn0 line 5:␤------> "⏏MOAR $code"␤ expecting any of:␤ POST␤ bracketed infix␤ infix or meta-infix␤ postfix␤ postfix_prefix_meta_operator␤
..statement modifier loop␤Undecl…
TimToady it was just failing immediately on line 1
Juerd thenextweb.com/shareables/2010/06/2...your-mind/
lue afk 16:03
masak Juerd: I saw it, but might have missed it if you hadn't warned me :)
in unrelated news, I feel a headache coming on :) 16:04
dolmen__ rakudo: say 23 ~~ ( 1..23 | 1000..2000 ) 16:05
p6eval rakudo e59795: ( no output )
dolmen__ rakudo: say (23 ~~ ( 1..23 | 1000..2000 ))
p6eval rakudo e59795: ( no output )
masak dolmen__: seems to hang locally.
TimToady the perl5-compatible code on stackoverflow is not perl6 compatible
perl6 does not auto-any lists 16:06
16:07 justatheory joined
dolmen__ perl6: say (23 ~~ ( 1..23 | 1000..2000 )) 16:08
p6eval pugs: OUTPUT«*** ␤ Unexpected ".."␤ expecting "_", exponent, term postfix, operator or ")"␤ ambiguous use of a non associative operator␤ at /tmp/p6JlWexHLG line 1, column 26␤»
..elf 31578: OUTPUT«Parse error in: /tmp/SJeO8Ozzlj␤panic at line 1 column 27 (pos 27): "#<Match:0x0000000090e908>" is not associative␤WHERE: say (23 ~~ ( 1..23 | 1000..2000 ))␤WHERE: /\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:2121:in `_EXPR_raw'␤
..STD_red…
..rakudo e59795: ( no output )
masak Haskell type classes, just like Perl 6 roles, ignore class hierarchy restrictions. but it seems the former also allows "after the fact" tying of a class to a role (to use Perl 6 terminology), whereas the latter doesn't without MONKEY_TYPING.
TimToady oughta work
dolmen__ perl6: say (23 ~~ 1..23 ) 16:09
p6eval rakudo e59795: OUTPUT«1␤»
..elf 31578: ( no output )
..pugs: OUTPUT«␤»
dolmen__ perl6: say (1..2 | 4..5) 16:10
TimToady precedence
p6eval elf 31578: OUTPUT«Parse error in: /tmp/yXucKUeIwJ␤panic at line 1 column 15 (pos 15): "#<Match:0x0000000094b060>" is not associative␤WHERE: say (1..2 | 4..5)␤WHERE: /\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:2121:in `_EXPR_raw'␤ STD_red/std.rb:1967:in `block in
.._EX…
..rakudo e59795: OUTPUT«any(1, 2, 3, 4, 5)␤»
..pugs: OUTPUT«*** ␤ Unexpected ".."␤ expecting "_", exponent, term postfix, operator or ")"␤ ambiguous use of a non associative operator␤ at /tmp/_Au55EhBo3 line 1, column 14␤»
TimToady rakudo: say 23 ~~ (1..23) | (1000..2000)
p6eval rakudo e59795: ( no output )
dolmen__ rakudo should not give 3, isn't it?
TimToady precedence is wrong, | is tighter than .. 16:11
dolmen__ rakudo: say (1..2) | (4..5)
p6eval rakudo e59795: OUTPUT«any(1, 2, 4, 5)␤»
16:11 ash_ left
dolmen__ ok 16:11
TimToady rakudo: say 23 ~~ (1..23) 16:12
p6eval rakudo e59795: OUTPUT«1␤»
TimToady rakudo: say (1..23) | (1000..2000) 16:13
p6eval rakudo e59795: ( no output )
TimToady those ranges shouldn't be flattening
item context isn't supposed to flatten
rakudo: say (1..23) | (100..105) 16:14
p6eval rakudo e59795: OUTPUT«any(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 100, 101, 102, 103, 104, 105)␤»
TimToady blech
pmichaud: ^^ 16:15
masak rakudobug?
masak submits one
rakudo: my $a = 1..4; say $a.perl 16:17
p6eval rakudo e59795: OUTPUT«1..4␤»
TimToady maybe it's a bug in junctions 16:18
or in the binding logic for list-associative operators that don't take lists as arguments 16:20
16:21 rgrau_ left
slavik I just realized something ... "if $number in 1.100 {}" is the same as "if $number == any(1..100) {}" 16:22
:D
actually, can lists be flattened that way?
16:22 dsherer joined
moritz_ or if $number ~~ 1..100 16:22
slavik moritz_: isn't that for regex type stuff? 16:23
so it would be doing a regex match?
moritz_ no 16:24
TimToady any provides a list context to its args, so flattens 1..100 into a list of 100 integers
moritz_ ~~ is general "smart matching"
rakudo: say 5 ~~ Int ; # type check
TimToady matching against the range object directly is preferred for efficiency
p6eval rakudo e59795: OUTPUT«1␤»
slavik TimToady: so it's the effect I was looking for.
TimToady especially if the range is 100..* :)
slavik oh 16:25
I see
TimToady rakudo: say 1000000 ~~ 100..*
p6eval rakudo e59795: OUTPUT«1␤»
slavik rakudo: say "yes" if 5 ~~ 1..*
p6eval rakudo e59795: OUTPUT«yes␤»
slavik rakudo: say "yes" if 5 == any(1..*)
TimToady we don't support lazy anys (yet)
slavik ahh
p6eval rakudo e59795: ( no output )
16:25 agentzh left 16:26 silug left
slavik TimToady: what would be the actual diff between smart matching against a large list and a lazy any on a large list? 16:26
TimToady and even if we did, 1000000 ~~ any(100..*) would take a *long* time
slavik as in: which would be more efficient?
16:26 ash_ joined, agentzh joined
moritz_ comparing a number with a range just compares the end points 16:26
TimToady a lazy any would still have to generate all the values up to the test value
moritz_ in direct smart matching
so it's always O(1) 16:27
slavik I see
TimToady lazy any would have to assume a monotonic function
slavik is there more docs on how smart matching works?
moritz_ S03
slavik ty
TimToady so in theory you could say sub is_fib { $^n ~~ any(0,1,*+*...*) } 16:28
moritz_ perlcabal.org/syn/S03.html#Smart_matching
justatheory TimToady: Ow.
TimToady and it would just generate fibs until it exceeded $^n
slavik any(0,1,*+*...*) - TimToady, please explain how that makes sense, I think I get it, but I am not sure.
TimToady as long as your list is monotonic, you can always tell if you need to generate more values, or have passed the test value 16:29
or for alternating signs, whether the abs is monotonic 16:30
otherwise you've "solved" the halting problem by running out of memory 16:31
slavik lol
TimToady: can you explain that notation inside any though? I don't get it
I get the first starting values, but is star a place holder in 0,1,*?
and + is aware of the lists?
TimToady S03:1809 16:32
slavik k
TimToady parsed as 0, 1, *+* ... *
and ... is list infix precedence, so governs all of it 16:33
moritz_ slsl ll
sorry :-)
TimToady cat? 16:34
moritz_ no, hanging screen or ssh or so
slavik TimToady: going to read about it and get more confused, because I am confused already ^^ 16:35
moritz_ even Enter~. didn't work
slavik: what TimToady last said about monotonic series isn't specced yet (afaict), but rather speculative
so you won't find anything to read about it, save IRC logs :-)
slavik already am 16:36
TimToady: 1809? 16:37
List infix precedence ?
TimToady which is why I'm sorely tempted to allow sub is_prime { $^n ~~ any(2,3,5...*) }
should read: C<< infix:<...> >>, the series operator. 16:38
moritz_ so how would any() determine that it's acting on an infinite, monotonic series as opposed to any(1, 2, 3, 4, 5, 6, -5) ? 16:39
TimToady or just follow the autolink in the IR Clog
it probably wouldn't. It would just be erroneous if it didn't 16:40
moritz_ doesn't quite follow
TimToady oh, how does it know it's finite?
well, it could be constructed lazily
16:41 ashleydev left
TimToady or finite lists can advertise how many already-reified values they have somehow 16:41
ash_ o.0 would 2,3,5...* give you all primes? that's crazy...
jnthn back 16:42
TimToady it has been proposed
ash_ oh lazy evaluation, how i <3 thee
TimToady presumably such a series would do an appropriate level of memoization for already sieved values
ash_ i'd love to see some way of caching lazy series to /tmp or what have you, so if you wanted to be really lazy, only eval it once.... maybe i can make a perl6 module to do that... 16:43
moritz_ if we rely on already-reified values, things as any(gather { take 1; take 2; take -3 }) would go wrong
TimToady we would probably have to indicate the desire for an infinite any explicitly somehow 16:46
any(monotonic 1..*) or some such 16:47
many(1..*) :)
16:48 cdarroch joined, cdarroch left, cdarroch joined
masak food & 16:48
16:48 masak left, tri1 joined
[particle] wonders if there's a /dev/primes for linux... 16:48
TimToady or a /dev/pi 16:49
or allow only series operators to go infinite in any(), since ... is pretty near turing complete 16:51
Gothmog_ /dev/busybeaver would be great, too ;)
TimToady /dev/e, /dev/ϕ, /dev/√2, /dev/Ω 16:53
jnthn Wow, that cheat sheet is pretty information-dense.
TimToady++
TimToady no roleses, only nasty classeses
rjbs /dev/ℝ sounds more fun. 16:56
16:56 dakkar left
TimToady looks forward to the day when you can MAKEDEV /dev/primes --p6 '2,3,5...*' 16:57
16:58 dsherer left
rjbs rakudo: (5 + *).signature.perl 16:58
p6eval rakudo e59795: ( no output )
rjbs rakudo: (5 + *).signature.perl.say 16:59
p6eval rakudo e59795: OUTPUT«:(;; Mu $y)␤»
16:59 ashleydev joined
TimToady rjbs: that will take a bit longer than /dev/ﬡ₀ 16:59
rjbs rakudo: (5 + * / *).signature.perl.say
p6eval rakudo e59795: OUTPUT«Method 'Num' not found for invocant of class 'WhateverCode'␤ in 'Cool::Numeric' at line 1670:CORE.setting␤ in 'Cool::Numeric' at line 1671:CORE.setting␤ in 'infix:<+>' at line 6109:CORE.setting␤ in main program body at line 11:/tmp/54EQTGYnIe␤»
moritz_ the leading ;; just say that the things after it don't participate in multi dispatch
and that's NYI
I think there was a partial patch in RT... did anybody review it?
rjbs but will 5+*/* eventually get me a /2 block?
moritz_ yes
rjbs Thanks. 17:00
17:00 mariano__ joined
TimToady but eventually multi dispatch will be hidden inside proto, so (Mu $y) will be adequate 17:01
jnthn moritz_: I reviewed it. Thing is that it was around the time pmichaud++ was doing all the block refactors. 17:24
moritz_: And I doubt it'll apply cleanly now.
(And it woulda got in pm's way to apply it before.)
I'm essentially OK with the approach it takes though 17:25
17:25 rgrau` joined 17:28 tri1 left 17:30 agentzh left
sorear good morning #perl6 17:39
pmichaud: _ doesn't match <alpha> or <digit> 17:41
17:41 s1n left
sorear er, *backlogs more* 17:41
moritz_ rakudo: say '_' ~~ /<alpha>/ 17:42
p6eval rakudo e59795: OUTPUT«_␤»
17:50 pmurias joined
pmurias sorear: why does STD use all those stages? 17:50
17:53 cinch left, cinch joined
sorear eh? 17:59
18:03 Solarion left 18:08 mikehh left
pmurias ah, they check the new STD can build a working STD 18:08
sorear: why do some files in STD have a 'compiled' .pmc suffix? historical reasons? 18:09
sorear I think it's mostly to mark them as Perl 5 18:11
they predate .pm6
pmurias it would make sense to rename them to .pm 18:12
as .pmc seems to imply they are generated
sorear: who should be mentioned as STD's authors (i'm creating a Dist::Zilla dist for STD) 18:14
dalek ecza: e2da99d | sorear++ | (4 files):
Implement code generator support for object slots
18:17
sorear pmurias: ask TimToady 18:23
pmurias TimToady: ping
sorear so, this Dist::Zilla dist for STD
18:23 silug joined
sorear are you taking over the Great Renaming and packaging effort? 18:24
pmurias just packaging it up 18:28
sorear: are you interested in the 'Great Renaming and packaging effort'
18:28 silug left
pmurias i'm just doing because it's something that needs to be done not because i particularly want to 18:29
sorear: what amount of tests should be run when installing STD? 18:31
TimToady well, until sorear++ got into the act, I was pretty much the only author of STDeco 18:35
there might be a few other tweakers in the logs though 18:36
pmurias TimToady: do p5 files still need the .pmc 18:37
?
TimToady: when installing STD how much tests should be run (wouldn't parsing the whole test suit take a bit long?) 18:38
TimToady: why is mangle.pl not a module? 18:39
sorear pmurias: standard functionality test is to parse STD.pm6
I use the spectests as weekly regression testing, not while developing 18:40
TimToady with his much faster computer seems to wind up running them much more often
18:40 solarion joined
ash_ ping moritz_ 18:41
pmurias sorear: parsing STD.pm6 is done on every make? 18:42
moritz_ ash_: pong 18:47
ash_ i made a really simple working version of try.rakudo.org github.com/moritz/try.rakudo.org/bl...cgi/tmp.pl its that single file, it doesn't store sessions, or remember anything between executions (so variables are lost on each line executed) but it works, i am setting it up on my server for now as a test bed for writing tutorials, i just wanted to let you know 18:50
sorear pmurias: yes
moritz_ ash_: thanks
ash_ its also pretty unsafe, if someone tried to execute a system call, it lets them (i don't know how to restrict that)
but it does send the contents to the server, eval it in perl6, and send the results back, so that part is working in my example 18:51
pmurias sorear: i'm thinking if just parsing 01-sanity/01-tap.t wouldn't be enough 18:52
as waiting for modules to run the very long test suits is annoying
moritz_ ash_: I have to work out how to remove things from lexical scopes - then I can get a basic safe mode working
ash_ what does github.com/rakudo/rakudo/blob/master/lib/Safe.pm do? 18:53
moritz_ nothing effective, I fear
ash_ ah, got ya
moritz_ it worked when the setting wasn't lexical, but installed stuff into the package
ash_ I also timeout requests that take longer than 10 seconds, for now, so if you go putting sleeps in there you get errors 18:54
sorear pmurias: tryfile STD.pm6 only takes 2:30 here. that's faster then Moose's testsuite
I think it'll be fine
it catches 99% of problems anyway
ash_: chroot and rlimit are your friends. alternatively, study Geordi 18:55
pmurias sorear: do you want to help with creating the STD dist?
ash_ yeah, i was planning on doing a chroot, i didn't know aobut rlimit but i will look into it
sorear actually you should use all three 18:56
ash_ grr, my server is a dreamhost server and i keep going over the allowed memory usage when building rakudo
sorear pmurias: I do not understand how that is possible 18:57
ash_ pbc's are portable right?
pmurias sorear: all three?
pmurias is very very confused 18:58
sorear ash_: pbcs are portable but for best performance you should generate them on a machine of the same wordsize and endianness
ash_ pmichaud: i think sorear was talking to me 18:59
[Coke] ash_: you mean pmurias ? =-)
ash_ oops
sorear pmurias: ash should use rlimit + chroot + geordi tricks
ash_ sorry, mixed up names
ash_ grubmles... stupid tab complete being all stupid
Tene You can use the selinux tool 'sandbox' to arbitrarily restrict the behavior of a program. 19:00
sorear Tene: can sandbox block resource consumption attacks? 19:01
tylercurtis ash_: what's your server's url? :P
ash_ greaterthaninfinity.com 19:03
19:04 baest joined
pugssvn r31579 | pmurias++ | [smop] LexicalScope.clone 19:04
r31580 | pmurias++ | [mildew] fix a bug in trailing_return
r31581 | pmurias++ | the STD dist i'm building 19:05
ash_ i am putting this at greaterthaninfinity.com/try but its broken for now 19:07
TimToady hmm, my machine parsed STD.pm6 in 32 seconds, and does a snaptest in 21 minutes 19:08
19:08 Su-Shee joined
Tene sorear: yes, through cgroups. 19:09
TimToady <pmurias> TimToady: do p5 files still need the .pmc 19:11
no, but .pm is ambiguous 19:12
<pmurias> TimToady: why is mangle.pl not a module?
because I couldn't be bothered to remember how to write a module
and it just wants to go in main anyway
so that p5 can just say ::mangle everywhere 19:14
pmurias TimToady: what is a bit confusing in both Cursor.pmc and Cursor.pm6 being handwritten 19:16
sorear allison++ bringing much needed sanity back to parrotland
Cursor.pmc is not hand written
TimToady pmurias: in theory all of those P5 modules are going to be derived from P6 code 19:17
pmurias sorear: meant CursorBase.pmc and CursorBase.pm6 19:18
[Coke] does wonder why he hangs out here. =-)
19:19 sahadev joined
slavik because we all do coke? 19:21
slavik runs away
19:21 rhr left
[Coke] ха! 19:23
19:24 timbunce left 19:30 sftp left 19:31 Mowah left, sftp joined
moritz_ nopaste.snit.ch/21887 # attempt at a Safe mode 19:38
[Coke] moritz_: can you remove Q:PIR access also? 19:39
moritz_ [Coke]: don't think so... it's a compiler feature
pmichaud: any ideas for switchting of Q:PIR and pir::stuff for a safe mode?
[Coke] hokay. 19:40
moritz_ at least not easily
19:40 rjbs left
jnthn Could recognize use Safe; like we do e.g. use MONKEY_TYPING; and set a contextual, then check it in the Q:PIR thingymmy 19:47
s/thingummy/action method/
Tene Better would be for Safe to modify the grammar itself. 19:48
IMO
moritz_ how would I remove or substitute a token? 19:50
substitute token term:sym<pir::op> { ... } with a new regex / <!> /
rakudo: say ?('' ~~ /<!>/) 19:51
p6eval rakudo e59795: OUTPUT«0␤»
19:52 tri1 joined 19:53 _mpu joined
Tene It's just a method in the Perl6::Grammar class, right? So can't you augment Perl6::Grammar? 19:53
replace it with a panic?
moritz_ I know how to add methods by augmenting 19:54
but I don't know how to override one
Tene Hmm.
moritz_ rakudo: class A { method f() { } }; use MONKEY_TYPING; augment class A { method f() { say "augmented" } }; A.new.f
p6eval rakudo e59795: OUTPUT«===SORRY!===␤A method named 'f' already exists in class 'A'. It may have been supplied by a role.␤» 19:55
19:55 eternaleye joined
tylercurtis rakudo: augment slang MAIN { token quote:sym<Q:PIR> { <.panic: "Q:PIR disabled in Safe mode."> } }; Q:PIR{ say "should not appear" } 20:00
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Malformed augment at line 11, near "slang MAIN"␤»
jnthn Rakudo dun known no slang, like. 20:01
tylercurtis didn't expect so.
moritz_: Perhaps have a Safe::eval function for now that evals a string with a subclass of the normal grammar that gets rid of Q:PIR? 20:02
moritz_ tylercurtis: that doesn't help for the REPL (which we want to use for try.rakudo.org), because each Safe::eval would be in its own scope, losing outer lexicals 20:03
20:03 shade_ is now known as shade\
dalek kudo: 1971474 | moritz++ | lib/Safe.pm:
[Safe.pm] remove non-functional code
20:05
moritz_ jnthn: if I set a contextual to forbid term:sym<pir::op>, can't the user reset it?
rakudo: BEGIN { $*MONKEY_TYPING = 1 }; augment class Str { method foo { 34 } }; say "blubb".foo 20:07
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Cannot modify readonly value␤»
tylercurtis moritz_: how does the current REPL persist the lexical scope between lines? Could a similar trick be done for a Safe::eval-based REPL? 20:08
moritz_ it might, but it might be tricky
TimToady rakudo: BEGIN my $*MONKEY_TYPING = 1; augment class Str { method foo { 34 } }; say "blubb".foo 20:09
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Cannot modify readonly value␤»
TimToady o_O 20:10
moritz_ it's because $*MONKEY_TYPING is bound to 0
once rakudo implements binding, $*MONKEY_TYPING := 1 will work
TimToady rakudo: BEGIN my $*MONKEY_TYPING := 1; augment class Str { method foo { 34 } }; say "blubb".foo
p6eval rakudo e59795: OUTPUT«===SORRY!===␤:= binding of variables not yet implemented␤»
TimToady fnork!
20:11 rgrau` left
ash_ there is a dynamic variable for MONKEY_TYPING? 20:11
neat
TimToady but 'my $*MONKEY_TYPING' is supposed to create a *new* lexical
moritz_ I know
sorear just use geordi + chroot + rlimit already 20:12
it's not like you'll *ever* manage to get all the loopholes out of the compiler
Tene sorear: link about geordi? 20:13
sorear language-based security isn't something you can retrofit after 10 years
Tene I'm having trouble asking google.
moritz_ sorear: I'd like to have two lines of defense, if possible
sorear www.xs4all.nl/~weegen/eelis/geordi/
moritz_ ./perl6 -e 'use FORBID_PIR; pir::printerr__vS("BLA\n")'
===SORRY!===
pir::op forbidden in safe mode
ash_ moritz_: does that work? (or is that an example?) 20:18
20:18 rhr joined
moritz_ that works locally here 20:18
ash_ neat 20:19
20:20 tadzik joined 20:22 fda314925 left
moritz_ sorear: I'm not sure how easy or hard it will be to adopt the ptrace trick to a dynamic language where compilation and run time aren't easily separated 20:24
ingy greetings 20:25
20:25 gongyiliao joined 20:26 tri1 left
ingy I just found a crazy error in rakudo 20:26
20:26 gongyiliao left, gongyiliao joined
moritz_ RT has ~600 of those :-) 20:26
but do tell
20:27 gongyiliao left
dalek kudo: c80319f | moritz++ | src/Perl6/ (2 files):
add FORBID_PIR pseudo package which disallows Q:PIR { } and pir::stuff
20:28
ingy you can't name a subroutine "${keyword}_text" 20:29
like get_foo
or lt_foo
knowing TimToady, this is probably a feature
moritz_ rakudo: sub get_foo() { say 3 }; get_foo()
p6eval rakudo e59795: OUTPUT«3␤» 20:30
ingy hmm
moritz_ rakudo: sub if_foo() { say 3 }; if_foo()
p6eval rakudo e59795: OUTPUT«3␤»
moritz_ rakudo: sub if_foo() { say 3 }; if_foo
p6eval rakudo e59795: OUTPUT«3␤»
ingy rakudo: sub get_fun() { say 3 }; get_fun()
p6eval rakudo e59795: OUTPUT«3␤»
moritz_ doesn't see the problem
sbp rakudo: sub get_foo { say 3 }; get_foo 20:31
p6eval rakudo e59795: OUTPUT«3␤»
ingy you need newlines in there
not a one liner
moritz_ rakudo: sub get_foo { say 3 }; ␤get_foo 20:32
p6eval rakudo e59795: OUTPUT«3␤»
ingy sub get_fun() { say 3
}
get_fun();
moritz_ rakudo: sub get_foo { say 3␤ }; ␤get_foo
p6eval rakudo e59795: OUTPUT«3␤»
ingy after the open curly too
ash_ rakudo: sub get_fun() { ␤ say 3␤ } ␤get_fun
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub get_fu"␤»
ingy :)
20:32 envi^home left
moritz_ now *that's* weird 20:33
please submit!
ash_ rakudo: sub get_fun() { ␤ say 3␤ }; ␤get_fun
p6eval rakudo e59795: OUTPUT«3␤»
ash_ its the mixing ; ? sub's don't always need those though, right?
20:33 tri1 joined
frettled rakudo: sub get_fun() { ␤ say 3␤ }␤get_fun 20:33
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub get_fu"␤» 20:34
20:34 Su-Shee left
ingy rakudo: sub gxt_fun() { ␤ say 3␤ }; ␤gxt_fun 20:34
p6eval rakudo e59795: OUTPUT«3␤»
moritz_ after }\n the ; should be optional
ingy see?!
20:34 gbacon left
ingy rakudo: sub gxt_fun() { ␤ say 3␤ } ␤gxt_fun 20:34
frettled rakudo: sub gxt_fun() { ␤ say 3␤ }␤gxt_fun
p6eval rakudo e59795: OUTPUT«3␤»
ingy the name matters
frettled ingy: I agree, that's just crazy.
ingy: quick, submit before masakbot beats you to it ;) 20:35
ingy gxt_fun works but not get_fun
TimToady std: sub get_fun() { ␤ say 3␤ }␤get_fun
20:35 silug joined
p6eval std 31581: OUTPUT«ok 00:01 113m␤» 20:35
ingy :) 20:36
TimToady std: sub if_fun() { ␤ say 3␤ }␤if_fun
p6eval std 31581: OUTPUT«ok 00:01 110m␤»
TimToady (std doesn't know anything about get really)
tylercurtis rakudo: sub ge_fun() { ␤ say 3␤ } ␤ge_fun 20:38
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub ge_fun"␤»
tylercurtis rakudo: sub fdiv_fun() { ␤ say 3␤ } ␤ge_fun
frettled tylercurtis: ooh, maybe we're on to something here...
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub fdiv_f"␤»
frettled rakudo: sub gt_gt() { ␤ say 3␤ }␤gt_gt
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub gt_gt("␤»
frettled rakudo: sub gt_gt_gt() { ␤ say 3␤ }␤gt_gt_gt 20:39
sbp rakudo: sub gt_() { ␤ say 3␤ }␤gt_
TimToady fdiv?!?
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub gt_gt_"␤»
rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub gt_() "␤»
sbp rakudo: sub gt() { ␤ say 3␤ }␤gt
p6eval rakudo e59795: OUTPUT«3␤»
frettled rakudo: sub gtgtgt() { ␤ say 3␤ }␤gtgtgt
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub gtgtgt"␤»
tylercurtis TimToady: fdiv is a parrot op for floored division.
rakudo: sub isnull_fun() { ␤ say 3␤ } ␤isnull_fun
p6eval rakudo e59795: OUTPUT«3␤»
frettled rakudo: sub gteqlt() { ␤ say 3␤ }␤gteqlt
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub gteqlt"␤»
tylercurtis rakudo: sub fdiv_fun() { ␤ say 3␤ } ␤fdiv_fun 20:40
p6eval rakudo e59795: OUTPUT«3␤»
frettled tylercurtis: so we're getting rakudo to channel parrot. We then have a parroty error. pieces of nine.
ingy how do I pass an array into a sub and receive the elements as positional args?
tylercurtis frettled: that does not appear to be the case, actually. I accidentally left ge_fun at the end there.
moritz_ ingy: foo(|@array)
tylercurtis rakudo: sub ge_fun() { ␤ say 3␤ } ␤say 4 20:41
p6eval rakudo e59795: OUTPUT«4␤»
ingy moritz_: what does the foo sig look like?
tylercurtis rakudo: sub ge_fun() { ␤ say 3␤ } ␤ge_fun()
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Confused at line 11, near "sub ge_fun"␤»
tylercurtis Apparently, it's the usage of the function that's the problem. 20:42
moritz_ rakudo: sub f($x, $y) { say $x + $y }; my @a = 42, 23; say f(|@a)
p6eval rakudo e59795: OUTPUT«65␤1␤»
moritz_ rakudo: sub f($x, $y) { say $x + $y }; my @a = 42, 23; f(|@a)
p6eval rakudo e59795: OUTPUT«65␤»
ingy moritz_: say I have $function and @args, where $function can point to funcs that take different # of args. 20:45
20:45 eternaleye left
moritz_ ingy: and you want to pass as many as it can take? 20:46
20:46 ewilhelm left, ewilhelm joined, ewilhelm left, ewilhelm joined
ingy moritz_: yeah, I don't want it to check up on me 20:46
moritz_ then you need to introspect the signature 20:47
TimToady or put a *@more on the end to slurp them up
moritz_ rakudo: say (-> $x, $y, $y { }).arity
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Redeclaration of symbol $y at line 11, near " { }).arit"␤»
moritz_ rakudo: say (-> $x, $y, $y { }).arity 20:48
ingy gets interested!
p6eval rakudo e59795: OUTPUT«===SORRY!===␤Redeclaration of symbol $y at line 11, near " { }).arit"␤»
moritz_ rakudo: say (-> $x, $y, $z { }).arity
20:48 rhr left
p6eval rakudo e59795: OUTPUT«3␤» 20:48
moritz_ rakudo: say (-> $x, $y, $z? { }).arity
p6eval rakudo e59795: OUTPUT«2␤»
moritz_ rakudo: say (-> $x, $y, $z? { }).count
p6eval rakudo e59795: OUTPUT«3␤»
TimToady at some point we will also support partial binding with cursors
moritz_ rakudo: say (-> $x, $y, $z? { }).signature.params».name
p6eval rakudo e59795: OUTPUT«$x$y$z␤»
moritz_ see S06/Signature Introspection/
TimToady introspection is usually the wrong way to do anything :) 20:49
moritz_ yes
but the right way isn't implemented yet
and not even specced yet
jnthn Indeed.
20:49 clintongormley left
TimToady should be close to implemented though, now that pmichaud++ put in cursors 20:49
moritz_ we still need a way to actually call it 20:50
and to get some information back how much was bound
ingy TimToady: /me loves to do _everything_ the wrong way.
frettled There's more than one wrong way to do it.
jnthn Introspection enables you to build some really neat things. It's a good thing. Just not on a critical path, which binding tends to be. 20:51
Or for things that need to be done a lot.
ingy jnthn: done a lot by people != Ingy 20:52
jnthn :-)
Well, my entire Perl 6 module history so far has been introspection heavy.
...all 2 of them. :-)
moritz_ actually Math::Model uses signature introspection for good cause, too 20:53
jnthn :-)
ingy nod. I'm having fun beating up on Perl's little sister.
moritz_ to find out which block depends on which other variables
jnthn moritz_: That's a so neat idea. :-)
moritz_ so that you can write things like acceleration => { $:force / $:mass }
20:54 masak joined
masak o/ 20:54
ingy: crazy bug. pmichaud discovered something similar (but not identical) about a month ago.
diakopter o
jnthn / 20:55
ingy masak: can you file that for me? :)
masak jnthn, diakopter: exercising the right to lay down arms?
20:55 diakopter sets mode: +v masak
masak submits rakudobug 20:55
jnthn
.oO( I bet if we -v masakbot++ it'll *still* keep on submitting Rakudo bugs )
ingy masak: all I wanted to do was write a 'get_function' sub. I had no idea it would be that hard. ;) 20:56
moritz_ ingy: a ; after the } seems to help, no?
ingy perl6 makes simple things simple and trivial things maddening.
masak ingy: what moritz_ said. seem to be easy to work around in this case. 20:57
ingy: you should do what some of us do and lead '# RAKUDO' comments next to workarounds.
20:57 moritz_ sets mode: +o masak
TimToady well, partial binding will look something like: ($newcursor,$retval) = $oldcursor.invoke-with-partial-bind(&block, $args); 20:57
masak that way, you can come back to them and make them better when Rakudo improves.
ingy masak: thanks 20:58
masak TimToady: did you see my comment about your 'lines' spec patch not working in practice?
TimToady or there will be a mutable cursor container that takes oldcursor in and returns newcursor out
you mean the \N*\n not chomping? 20:59
masak aye.
TimToady yes, just haven't got back to it
masak just checking. no rush. 21:00
it was one of these "heh, let's go from spec to implementation in less than half an hour... waitaminute" moments.
21:01 tadzik left
pugssvn r31582 | lwall++ | [Str] fix lines def to use .comb(/ ^^ \N* /) for masak++ 21:02
masak \o/
and a much cuter definition, too :) 21:03
"*giggle* anything but newlines"
pugssvn r31583 | lwall++ | [S06] define a * statement to represent a call from a proto to its multis 21:04
Tene ubuntu doesn't seem to ship the selinux sandbox utility.
ash_ moritz_: is there anyway i could put my tmp work on your server (or wherever try.rakudo.org will be)? dreamhost is being annoying, i tried building it on my computer but its not linked the same 21:05
TimToady masak: the ^^ is necessary only to suppress matching between \n$ 21:07
masak oh, right.
TimToady otherwise could just be \N*
jnthn my |$cap = (*); 21:08
So
my |$cap = *;
TimToady not a statement
jnthn Would be different otoh?
And I think it should be
my (|$cap) := *;
or
my (|$cap) := (*);
masak huh, a regex engine that produced things meant for .comb could do a much better job than just a general regex engine.
21:09 nimiezko joined
jnthn OTTH, returns are a Parcel so maybe we need a way not to capturize or something. 21:09
TimToady well, statement * is probably sugar for something else anyway
I wrote $cap but yeah, it's really a parcel 21:10
jnthn That's fine, but the something else could be perhaps less magical if we're binding.
ingy Could not find sub &say ???
masak rakudo: sub foo() { ␤ say 3␤ } ␤foo
p6eval rakudo c80319: OUTPUT«3␤»
TimToady "O See Can You Say" 21:11
jnthn TimToady: Anyway, I'll think it through a bit more.
TimToady: My gut reaction is that it feel along the right lines but not quite right yet. 21:12
TimToady generally I think people will use the ENTER/LEAVE trick and let * stand as its own return value
nimiezko How far goes the implementation of S16 in rakudo now ?
jnthn Yes, that one looks OK to me.
Though the * there vs (*) above irks me slightly. 21:13
TimToady well, statement is about the only place left where we haven't given * a meaning yet :)
21:13 mariano__ left
jnthn :-) 21:13
[particle] if i could count the times i've seen questions of S16... 21:14
TimToady do *; would also work
ingy if I dynamically load a module with eval, does it not have 'say' available?
masak nimiezko: only simple things so far. 21:15
TimToady or do {*} to keep the same looking magic
jnthn rakudo: eval('use Test; ok 42')
p6eval rakudo c80319: OUTPUT«ok 1 - ␤»
masak nimiezko: I also think that S16 is a little too abstracty for its own good. but that is my personal opinion.
ingy rakudo: eval('use Test;'); ok 42 21:16
p6eval rakudo c80319: OUTPUT«Could not find sub &ok␤ in main program body at line 11:/tmp/WYSusYhumO␤»
jnthn That's correct.
nimiezko do not really know
jnthn (Import is lexical by default.)
Tene rakudo: eval('use Test;'); Test::ok 42
TimToady and eval is its own lexical scope
p6eval rakudo c80319: OUTPUT«Can not find sub Test::ok␤ in main program body at line 1␤»
nimiezko thinking about if there is any opening of files supported
jnthn Tene: The subs in Test.pm are lexical subs too ;-) 21:17
ingy well, this isn't really replicating my problem
jnthn Tene: But nice try. :-)
21:17 tylercurtis left
jnthn ingy: Oh... :-S 21:17
ingy: You've probably hit the roles + scope bug.
ingy: Is you're failing say inside a role?
ingy no
I'll see if I can mimize it
minimize
TimToady pun to follow 21:18
TimToady I mized my pun down to nothing
ingy ^^
21:18 cjk101010 left
nimiezko masak : sorry, misinterpretation, I thought you talked about my question 21:18
masak nimiezko: I was. you asked how implemented S16 is. 21:19
nimiezko do not know enough of the synopses to have a real opinion on it
masak :)
jnthn nimiezko: Yes, open is implemented. Won't handle binary files...yet. 21:20
Somebody should implement that. ;-)
TimToady maybe we could get someone to pay for it too
jnthn Let me google for somebody who'd do that...
TimToady we'll also need a good (tor)mentor 21:21
masak :)
21:22 _mpu left
nimiezko and what about $*IN and others ? 21:22
jnthn Said tormentor and his tormentee should also submit mid-term reports next week.
nimiezko: $*IN works
rakudo: say $*IN.get
p6eval rakudo c80319: OUTPUT«Land der Berge, Land am Strome,␤»
masak those are in place.
you can even redirect them :)
jnthn rakudo: say +$*IN.lines
p6eval rakudo c80319: OUTPUT«23␤»
jnthn rakudo: say "OMG, the Austrian national anthem is {+$*IN.lines} lines long!" 21:23
p6eval rakudo c80319: OUTPUT«OMG, the Austrian national anthem is 23 lines long!␤»
ash_ seen cygx?
nimiezko ouch, that's just me, trying to run perl6 code forgetting to add the "6" after the perl in command line
jnthn Yes, 6 is good to have. :-) 21:24
ash_ purl: seen cygx
masak rakudo: say "OMG, the Austrian national anthem is $*IN.lines.Int() lines long!"
p6eval rakudo c80319: OUTPUT«OMG, the Austrian national anthem is 23 lines long!␤»
21:25 rhr joined
ash_ rakudo: say "OMG, the Austrian national anthem is {+$*IN.lines} lines long!" 21:26
p6eval rakudo c80319: OUTPUT«OMG, the Austrian national anthem is 23 lines long!␤»
jnthn rakudo: say "Ich will ein $*IN.get(), aber nur ich hab ist ein $*IN.get(). :-/"
p6eval rakudo c80319: OUTPUT«Ich will ein Land der Berge, Land am Strome,, aber nur ich hab ist ein Land der Äcker, Land der Dome,. :-/␤»
jnthn aw, comma fel
masak points for trying, though. 21:27
TimToady awek fel & 21:28
jnthn TimToady++ # speaks perfect Swedish too
;-)
masak it looks so... fel.
pmurias hates disappearing code, editing the dists generated by Dist::Zilla seems a likely culprit 21:29
21:30 tri1 left, skids left 21:31 ash_ left
lue rakudo: my $a = 2; my $b := $a; $b = 3; say $a; 21:34
p6eval rakudo c80319: OUTPUT«:= binding of variables not yet implemented␤ in 'infix:<:=>' at line 680:CORE.setting␤ in main program body at line 11:/tmp/DmVCvP3OpK␤»
ingy jnthn: I got it fairly minimal 21:35
pmichaud 17:41 <sorear> pmichaud: _ doesn't match <alpha> or <digit>
ingy say Foo.pm is: class Foo; method xyz($name) { say ">> $name" }
pmichaud sorear: _ matches <alpha>
ingy my $class = 'Foo'; eval "use $class"; "$class".new.xyz("hello");
pmichaud ingy: eval "use $class" is not likely to work, since such usage is lexically scoped (iirc) 21:36
ingy Could not find sub &say
pmichaud: that works fine
pmichaud ingy: if it works now, it's because of a rakudo bug.
ingy Foo fails to compile
masak rakudo: say $*IN.lines>>.chars.perl
ingy Foo can't see say
p6eval rakudo c80319: OUTPUT«(31, 31, 32, 30, 32, 27, 27, 0, 31, 31, 28, 28, 28, 27, 27, 0, 26, 37, 31, 29, 31, 26, 26)␤»
21:37 cdarroch left
ingy pmichaud: if I take out the 'say' it seems to all work fine. 21:38
pmichaud ingy: checking. it has to do with scoping issues, I'm sure.
masak rakudo: say $*IN.lines>>.words>>.[*-1].perl 21:39
p6eval rakudo c80319: OUTPUT«("vielgeliebtes", "\x[c3]\x[96]sterreich!")␤»
21:39 colm joined
lue
.oO(what is in $*IN in p6eval?)
21:40
masak lue: Austria.
lue rakudo: say "\x[C3,96]"
jnthn The whole Austria.
p6eval rakudo c80319: OUTPUT«Ã␤»
jnthn masak: I'm having vacation in Austria at the end of August! \o/
lue .u 0096 21:41
phenny U+0096 (No name found)
masak jnthn: tell them I said 'hi'.
lue: german.about.com/library/blmus_anthemA.htm
pmichaud ingy: I don't get the same error you're seeing. 21:42
masak rakudo: for $*IN.lines() -> { say .words[*-1] }
21:42 am0c joined
p6eval rakudo c80319: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤ in main program body at line 1:/tmp/Jk9jJMdh0i␤» 21:42
masak er.
rakudo: for $*IN.lines() { say .words[*-1] }
p6eval rakudo c80319: OUTPUT«Strome,␤Dome,␤zukunftsreich!␤Söhne,␤Schöne,␤Österreich,␤Österreich!␤umstritten␤inmitten,␤gleich.␤Ahnentagen␤getragen,␤Österreich,␤Österreich!␤Zeiten,␤schreiten,␤hoffnungsreich.␤Brüderchören,␤schwören,␤Österreich,␤Österreich!␤»
21:43 colm left
pmichaud gist.github.com/468690 # what in the world is going on here?! 21:44
jnthn masak: Strange how the anthem mentions ostriches so often. 21:45
pmichaud: looking...
masak jnthn: one gets the feeling there's something they're sticking their heads in the sand about.
pmichaud .new on a string treats the string like a class name?
jnthn pmichaud: OH
pmichaud: We already have that in RT
pmichaud: It's, erm.
ingy pmichaud: did you put those snippets in Foo.pm and foo.pl?
jnthn pmichaud: Well tbh I really don't want to know how it happens. 21:46
pmurias jnthn: they must have a serious shortage of them in Austria...
pmichaud ohhhhh, I know!
it's a p6object thing.
jnthn lol
Can we fix it? ;-)
masak rakudo: my $str-or-int = <Str Int>.pick; say $str-or-int.new.WHAT
pmichaud p6object is converting the string to a class name
p6eval rakudo c80319: OUTPUT«Str()␤»
masak rakudo: my $str-or-int = <Str Int>.pick; say $str-or-int.new.WHAT
p6eval rakudo c80319: OUTPUT«Str()␤»
jnthn ETOODYNAMIC
masak rakudo: my $str-or-int = <Str Int>.pick; say $str-or-int.new.WHAT for ^10
p6eval rakudo c80319: OUTPUT«Str()␤Str()␤Str()␤Str()␤Str()␤Str()␤Str()␤Str()␤Str()␤Str()␤» 21:47
pmichaud jnthn: yes, I suspect we can. easier is to fix in rakudo than to try to update p6object itself.
21:47 tedv joined
jnthn pmichaud: Aye, and p6object probably only has so long left to live in its current form :-) 21:47
pmichaud jnthn: well, don't forget that past and pct is currently p6object based 21:48
jnthn 65224 class name as string unexpectedly "works"
lue any other numbers?
jnthn pmichaud: We'll worry about that a little further down the line.
pmichaud lue: I know I keep losing this... but is there a url for your := patch again?
(sorry for losing it.) 21:49
ingy pmichaud: I'm confused...
pmichaud ingy: "$class".new should not be returning an instance of $class
that's a bug in Rakudo.
21:49 ruoso left
ingy what should it return? 21:49
pmichaud a new string
just like 123.new would return a new Int 21:50
or [1,2,3].new would return a new Array
ingy how do I get an instance of $clas?
pmichaud ::$class might work, someday. 21:51
eval($class) probably works today.
oh, that would give the type object
so to get an instance, you'd want ::$class.new (or eval($class).new )
might even need to be ::{$class} though. I need to review the package syntax rules. 21:52
ingy eval("$class").new.xyz("hello"); # give same &say error
lue (it's coming..............) 21:53
pmichaud ingy: that looks like it must be a recent bug introduced today
lue gist.github.com/463775 original patch + Q:PIR block removal [more] 21:54
ingy pmichaud: my build is ove a week old
pmichaud ingy: oh, then all bets are off.
a *lot* has changed in the past week.
ingy I see
pmichaud the closure model has been completely redone
ingy what build should I use?
masak "Perl 6: a *lot* has changed in the past week." :P
lue gist.github.com/465939 dealing with arrays and hashes [1 more]
pmichaud ingy: hard to say. 21:55
apparently the version as of 0000 CDT doesn't have the &say problem, but current HEAD does
ingy :\
lue gist.github.com/465750 ::= binding [done]
21:55 Ross left
ingy pmichaud: what's the git commit of 0000 CDT? 21:55
pmichaud 894e79 according to my log 21:56
lue there ye are, pmichaud.
pmichaud lue: looking
diakopter masak: lol 21:57
lue
.oO(Perl 6: Do *)
sjohnson is there an oop string method that searches inside a string for a string in P6? 21:58
and not as a regular expression?
masak sjohnson: .index and .rindex
sjohnson nice, will try it
rakudo: my $str = 'happy'; say $str.index('.'); 21:59
p6eval rakudo c80319: ( no output )
sjohnson rakudo: my $str = 'happy.moose'; say $str.index('.');
p6eval rakudo c80319: OUTPUT«5␤»
sjohnson rakudo: my $str = '.happymoose'; say $str.index('.');
p6eval rakudo c80319: OUTPUT«0␤»
sjohnson hmm.. is there a similar way that that would return more of a boolean result, to let me know it at least found it?
.oO(i suppose defined( would also tell me that though..)
22:00
pmichaud defined, I think
masak aye.
pmichaud you can also do $str.index('.') // $whatever
sjohnson :thumbsup:
lue rakudo: our sub a($a) { say $a + 1 }; our sub b($b) { say $b + 2 }; my @a = [a(), b()]; @a[1](5);
p6eval rakudo c80319: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤ in 'a' at line 11:/tmp/yZ6CNTGoHl␤ in main program body at line 11:/tmp/yZ6CNTGoHl␤»
sjohnson i cant really seem to find it in p5, hence i decided to see if p6 has that technology
that is, without busting out cpan 22:01
lue Thought I could get away with that :)
masak when StrPos is implemented, one'll be able to drop the 'defined' part. but it's future-proof and will still work with StrPos, too.
sjohnson nevermind, index is in p5
ingy pmichaud: > git co 894e79
Note: moving to '894e79' which isn't a local branch
masak *no* implementation has StrPos yet.
sjohnson thank you perl6 heros
rakudo: my $str = '.happymoose'; say $str.index('z'); 22:03
p6eval rakudo c80319: ( no output )
sjohnson ahh, p5 would say -1 22:04
22:04 ash_ joined
sjohnson note to self: remind oneself that p6 is different than p5 in some cases 22:04
masak sjohnson: it shouldn't say 'no output'.
sjohnson: try locally.
sjohnson: but you won't ever get -1 from Perl 6 in that case; see S32/Str.
sjohnson: hence pmichaud's 'defined or //' advice and my addendum above. 22:05
sjohnson i got a lot of reading ahead of me :)
hmm... has // come to mean "and" ? 22:06
or the "and" version of defined?
masak sjohnson: no, it means "or, failing that".
ingy pmichaud: do you work on master?
sjohnson hmm... does it replace the || in p5?
pmichaud ingy: I always work with master, yes.
masak sjohnson: no, || replaces || :)
sjohnson: // is in Perl 5.10, too.
lue
.oO( while masak seems to prefer alpha :) )
22:07
masak sjohnson: it's the 'defined-or' operator.
sjohnson time to learn about this // technology
is there a defined-and ?
\\
:)
pmichaud sjohnson: // returns its lhs if the lhs is defined, otherwise it returns the rhs
defined-and would be && :-P
masak lue: yeah, but it feels increasingly wrong to develop for alpha.
pmichaud oh, maybe not.
anyway. 22:08
sjohnson interesting operands
masak sjohnson: there's less of a use case for keeping only undefined values and throwing away defined ones :P
sjohnson you learn something (about perl6) every day
and perl 5.10 too
22:09 stef__ joined
sorear TimToady: What was wrong with nextsame for MMD? 22:10
lue is reminded, again, of the PTO
sorear I need to hurry up and implement StrPos I see
lue As I read more, I can see why StrPos doesn't exist in practice yet. 22:14
masak lue: why is that?
lue I guess it's just the talk about Unicode abstraction that got me. 22:15
(were !'s some sort of quoting construct in P5?) 22:17
masak lue: yeah, those Unicode levels still feel semi-underspec'd to me.
lue
.oO(S33 Unicode)
masak rakudo: say q!OH HAI! # lue: like this? :)
p6eval rakudo c80319: OUTPUT«OH HAI␤»
ingy pmichaud: it's working with that build 22:18
lue that explains why my vim highlighting is acting up.
(probably not P6 then)
ingy $class.new.xyz("hello"); # works too
$class.new seems like it should work
TimToady? ^^
hmm 22:19
pmichaud $class.new will work if $class is a type object.
ingy right
pmichaud note that "Foo" (with the quotes) is not a type object :-)
ingy eval "$class_name" # should return a class object? 22:20
pmichaud sure, if the class object is defined in the current scope.
lue Strings look like a fun concept that needs some work. [ I should tell you about my plans to upset Unicode with Circular Gallifreyan sometime :) ]
22:22 alester left
ingy pmichaud: this works on the new build (and seems like it should) gist.github.com/468744 22:23
pmichaud ingy: it may run now, yes. But it's not correct Perl 6.
ingy ?
why not? 22:24
pmichaud $class is a string
thus $class.new will eventually return a Str
ingy no
pmichaud oh, wait.
ingy it's a class
pmichaud okay, I see.
ingy object
pmichaud eventually it will fail because eval("use $class") will be lexically scoped to the eval, I think.
ingy so how do I dynamically load a module? 22:25
the right way
:)
pmichaud I believe that will be 'import'
ingy does import load from disk? 22:26
lue ? there's a use and an import?
pmichaud oops, wrong. it's "need"
wrong again, it's "require"
See S11.
head1 Runtime Importation
22:27 pmurias left
ingy does require scope things like use? 22:27
pmichaud it's all there in the spec, I think. 22:28
there's a version that does scope and a version that doesn't. 22:29
ingy please don't "fix" use without implementing require. :)
pmichaud I have no idea how much of 'require' is currently implemented in rakudo.
I'm sure we'll have require before we "fix" use, yes.
ingy pmichaud: I think it's not implemented
doesn't work over here
rakudo: require Test; 22:30
p6eval rakudo c80319: OUTPUT«Could not find sub &Test␤ in main program body at line 11:/tmp/tcuwCkuLpH␤»
pmichaud looks like nyi, yes.
ingy rakudo: require 'Test';
p6eval rakudo c80319: OUTPUT«Could not find sub &require␤ in main program body at line 11:/tmp/INxBQVQDp2␤»
pmichaud feel free to submit a ticket requesting it :)
ingy bleh
I'm spending too much time on P6
(for an Acmeist)
;)
pmichaud we all spend a bit too much time on p6. But that's just because it's so -Ofun 22:31
ingy I'm just trying to get TestML working everywhere so I can get other, more interesting modules working everywhere
but p6 has the nicest irc channel
community++
22:31 masak left
ingy except for that masak jerk! 22:32
;D
is there a way to ask a class/package/module for a named function? 22:41
I'm using $class.can($name)
slavik package::function() ?
wrong perl version :(
ingy but my functions are not really methods 22:42
so it feels icky
and will likely break later.
when TimToady thinks it's icky
what is 'package' in p6? 22:43
a function container?
that would be nice (if I can introspect it)
22:45 fozo joined
fozo Okay I installed git and then unistalled it and when I enter a folder or my start menu I get a werid error saying something like "cannot find git path" 22:46
Tene Package::{$foo} 22:47
according to S10
ingy TimToady: 'Package' is in $pkg
er 22:48
Tene rakudo: package Foo { sub blah { say "lolol" } }; my $x = Foo::{'blah'}; $x();
22:48 timbunce joined
p6eval rakudo c80319: OUTPUT«Could not find sub &Foo␤ in main program body at line 11:/tmp/OawxE9c33y␤» 22:48
ingy I meant Tene ^^
fozo I have no clue what that means!
Tene rakudo: package Foo { sub blah { say "lolol" } }; my $x = ::Foo::{'blah'}; $x();
p6eval rakudo c80319: OUTPUT«Null PMC access in invoke()␤ in main program body at line 1␤»
fozo again WHAAATT?!?!? 22:49
Tene fozo: Have you asked in the git irc channel?
fozo no
Tene Why are you asking #perl6, then?
fozo hey is there a web devcolpment channel?
because it was for rakudo 22:50
Tene Ah.
I have no idea; never really used windows. I recommend you ask #git.
fozo okay ty 22:51
Tene Good luck! :)
fozo "== Cannot send to channel: #git" what does this mean? 22:52
ingy Tene: so you were saying... :)
Tene fozo: I'm sorry, I don't know. You should probably look at the channel topic, and check to see if your IRC client has received any other messages, perhaps in a status window? 22:53
Maybe there was a join message.
fozo well ty
ingy rakudo: package Foo { sub blah { say "lolol" } }; say "OK" if Foo::{blah}
p6eval rakudo c80319: OUTPUT«Could not find sub &Foo␤ in main program body at line 11:/tmp/Yqb3lM_F_3␤» 22:54
ingy rakudo: class Foo { sub blah { say "lolol" } }; say "OK" if Foo::{blah}
p6eval rakudo c80319: OUTPUT«Could not find sub &Foo␤ in main program body at line 11:/tmp/hBVvjxARLu␤»
jnthn ingy: our sub...
ingy rakudo: class Foo { our sub blah { say "lolol" } }; say "OK" if Foo::{blah} 22:55
p6eval rakudo c80319: OUTPUT«Could not find sub &Foo␤ in main program body at line 11:/tmp/yhAXNy3TUm␤»
jnthn rakudo: module Foo { sub bar { say 42 } }; Foo::bar()
gah
p6eval rakudo c80319: OUTPUT«Can not find sub Foo::bar␤ in main program body at line 1␤»
jnthn rakudo: module Foo { our sub bar { say 42 } }; Foo::bar()
p6eval rakudo c80319: OUTPUT«42␤»
22:55 am0c left
ingy module Foo { our sub bar { say 42 } }; my $pkg = "Foo"; my $name = "bar"; my $fun = eval "${pkg}::$name"; $fun() 22:57
grr 22:58
rakudo: module Foo { our sub bar { say 42 } }; my $pkg = "Foo"; my $name = "bar"; my $fun = eval "${pkg}::$name"; $fun()
p6eval rakudo c80319: OUTPUT«Could not find sub &pkg␤ in main program body at line 11:/tmp/5vgaCZC6KX␤»
ingy rakudo: module Foo { our sub bar { say 42 } }; my $pkg = "Foo"; my $name = "bar"; my $fun = eval "$pkg" ~ "::$name"; $fun() 22:59
p6eval rakudo c80319: OUTPUT«42␤invoke() not implemented in class 'Boolean'␤ in main program body at line 11:/tmp/XdT3O1YbPY␤»
ingy rakudo: module Foo { our sub bar { say 42 } }; my $pkg = "Foo"; my $name = "bar"; my $fun = eval "$pkg" ~ "::$name"; $fun.()
p6eval rakudo c80319: OUTPUT«42␤invoke() not implemented in class 'Boolean'␤ in main program body at line 11:/tmp/9kNLJOzF4R␤»
ingy ? 23:00
23:01 lestrrat is now known as lest_away
ingy rakudo: module Foo { our sub bar { say "PASS" } }; my $pkg = "Foo"; my $name = "bar"; my $fun = Foo::bar; $fun.() 23:02
p6eval rakudo c80319: OUTPUT«PASS␤invoke() not implemented in class 'Boolean'␤ in main program body at line 11:/tmp/qbWyUVuDi7␤»
ingy oh
jnthn: I need a reference to Foo::bar
jnthn: and I need it from "Foo" and "bar" variables 23:03
jnthn ingy: There's not a good way to do that at the moment besides eval('&' ~ $pkg' ~ '::' ~ $name) or similar 23:04
ingy that's fine 23:05
rakudo: module Foo { our sub bar { say 42 } }; my $pkg = "Foo"; my $name = "bar"; my $fun = eval "&$pkg" ~ "::$name"; $fun.()
p6eval rakudo c80319: OUTPUT«42␤»
jnthn rakudo: module Foo { our sub bar { say "PASS" } }; my $pkg = 'Foo'; my $name = 'bar'; my $f = eval('&' ~ $pkg' ~ '::' ~ $name); $f();
ingy thanks
p6eval rakudo c80319: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤»
jnthn heh, you beat me *and* got it correct. :-)
ingy jnthn: beat ya
23:05 slavik left
ingy \o/ 23:05
lue feels we need a separate channel to discuss changes to Perl 6 sometimes. 23:06
ingy lue: what do you feel this channel is for?
rakudo: package Foo { our sub bar { say 42 } }; my $pkg = "Foo"; my $name = "bar"; my $fun = eval "&$pkg" ~ "::$name"; $fun.() 23:07
p6eval rakudo c80319: OUTPUT«42␤»
ingy works for "package" too
jnthn Yes, it's just package Foo; that will get you in bother. :-)
rakudo: package Foo; say 42;
p6eval rakudo c80319: OUTPUT«===SORRY!===␤This appears to be Perl 5 code. If you intended it to be Perl 6 code, please use a Perl 6 style package block like "package Foo { ... }", or "module Foo; ...". at line 11, near "say 42;"␤»
lue I know this channel is the right place, but it almost seems like you need to start talking about it at the right moment, or it won't get the discussion it deserves... 23:08
ingy noted
jnthn lue: I don't think another channel for people not to be on at the right moment will increases the chances. ;-)
ingy XD 23:09
lue :)
ingy later p6 taters
jnthn o/
_sri will blizkost ship with rakudo/parrot at some point?
23:09 am0c joined
lue can't wait for diaspora* 23:09
23:09 timbunce left
jnthn _sri: Expect it will be in the Rakudo * distribution release. 23:10
_sri \o/
thats something you should make people aware of, makes me feel all warm and fuzzy inside
lue or, we could create a section on perl6.org for a — <.< — >.> — forum. [JOKE]
jnthn _sri: I writed it into slides I gave...and really should upload. 23:11
Will try and do that at the weekend.
23:11 mtve joined
lue in a class, is it safe to set initial values for variables outside of any methods? 23:12
23:14 masonkramer joined 23:15 kid51 joined
jnthn lue: Got a short example? 23:17
lue class cpu2A03; has @!memorymap; @!memorymap = 0 xx 0x2000; # something like that 23:19
I guess I'm just being paranoid here :)
jnthn oh, that won't work but 23:21
has @!memorymap = 0 xx 0x2000;
Will be fine
(it will turn the RHS of the = into an anonymous method)
(and run it once per object you create)
23:22 takadonet joined
lue ah, so I have to set it within a method. Because the xx stuff will have to happen more than once, in addition to some binding :) 23:24
jnthn Right. 23:27
lue my next roadblock seems to be the need to open binary files (if it doesn't work already) 23:28
jnthn Well, in what I showed it makes the method for you.
Oh, masak++ is working on that
It's broken at the moment, but having somebody with a use case will surely help spur him on. ;-)
TimToady just run od on it and slurp it in as an array of integers. :) 23:29
lue (well, I might as well avoid creating the memory map twice, and create it only once with the info from the ROM.)
jnthn Careful not to od on the workarounds! ;-) 23:30
lue (hrm, let's see, ROM runs from 0x8000 to 0xFFFF...) 23:31
TimToady you should write a song about it, so it would be an odditty
lue rakudo: say (0xFFFF - 0x8000 + 1).fmt('%x')
p6eval rakudo c80319: OUTPUT«8000␤»
lue or write a poem, call it an oddesey!
perigrin write the song in Python and it will be a whitespace oddity.
lue well, that was stupid on my part. I forgot bash hex math :)
s/bash/basic/ 23:32
perigrin I did wonder what kind of mad sh skills you had for a second
TimToady <pmichaud> ::$class might work, someday. 23:33
lue write the song in Ruby and it'll be playable on the 時のオカリナ
TimToady unlikely, but ::($class) is specced
lue :)
ash_ TimToady: is ::($package) available too? 23:34
does it have to be a class in other words
TimToady ::() is any symbolic package-like interpolation 23:35
could even be the variable name in $foo::($bar)
ash_ $a.::(Foo).'$bar'() ? 23:36
TimToady but foo::{$bar} does a direct hash lookup of whatever is in $bar, which had better have the sigil
ingy rakudo: package Foo { our sub bar { say 42 } }; my $pkg = "Foo"; my $name = "bark"; my $fun = eval "&$pkg" ~ "::$name"; if not $fun { say "OK" }
p6eval rakudo c80319: OUTPUT«OK␤»
ingy rakudo: package Foo { our sub bar { say 42 } }; my $pkg = "Foo"; my $name = "bar"; my $fun = eval "&$pkg" ~ "::$name"; if not $fun { say "OK" }
p6eval rakudo c80319: ( no output )
TimToady there is likely no method named '$bar'
ingy :)
TimToady "$bar" maybe
ash_ err
lue is a filename different than a string in P6? (in other words, is there a separate type for filenames?)
ash_ yeah, sorry
ingy this stuff is easy and consistent in Python :P 23:37
lue (masak talking earlier has me worried)
TimToady it's the same until it's different
ash_ i guess i should of said $a.::("$class")."method"();
grr
TimToady currently we spec a "path" type for filenames
ash_ $a.::("$class")."$method"();
TimToady and qp[/etc/passwd] is supposed to make one
first quotes are unneeded 23:38
ingy when is the * release target date?
TimToady 29th I believe
lue could I use a var of type Str and do qp[$var] ?
ingy post OSCON, good!
lue Yes. July 29th. 2010 BC. 23:39
erm, wait. That's not right....
TimToady Before Christmas
ingy OSCON-- # for screwing up too many Perl releases
sorear TimToady: eval 'module Foo { our $x = 2; }'; say $::Foo::x; #what does this do
TimToady should print 2, given that module defaults to "our" 23:40
lue TimToady: I believe it's Before Camel :)
sorear there's some stuff in the spec hinting at per-UNIT GLOBALs, so I suspect the eval's GLOBAL::Foo:: is invisible to the main unit
TimToady though, hmm, I can see where it could go astray 23:41
lue rakudo: my $a = "/dev/stdio.h"; my $b = qp[$a]; say $b
p6eval rakudo c80319: OUTPUT«===SORRY!===␤Confused at line 11, near "my $b = qp"␤»
lue TimToady: is the type path with an upper or lower case 'p' ?
TimToady upper 23:42
though as with most of IO.pod, it appears to be rather over-engineered 23:43
23:45 ruoso joined
lue Can we sprinkle some of that engineer on the under-engineered then? 23:45
sorear TimToady: What motivated the switch from callsame; to *;? 23:46
TimToady brevity 23:47
ingy rakudo: module Foo::Bleh { our sub bar { say 42 } }; my $pkg = "Foo::Bleh"; my $name = "bar"; my $fun = eval "&$pkg" ~ "::$name"; if not $fun { say "OK" }
sjohnson $bar!
p6eval rakudo c80319: ( no output )
ingy rakudo: module Foo::Bleh { our sub bar { say 42 } }; my $pkg = "Foo::Bleh"; my $name = "bar"; my $fun = eval "&$pkg" ~ "::$name"; if $fun { say "OK" }
p6eval rakudo c80319: OUTPUT«OK␤»
ingy rakudo: module Foo::Bleh { our sub bar { say 42 } }; my $pkg = "Foo::Bleh"; my $name = "bar"; my $fun = eval "&$pkg" ~ "::$name"; $fun.()
p6eval rakudo c80319: OUTPUT«42␤»
lue suddenly ponders easter eggs in rakudo, but it passes. 23:48
TimToady and trying to keep straight the role of proto as a dispatcher from its role as an "only" 23:49
in any case, if there were a word, it would be something more like "firstsame" 23:50
since the point is that it is setting up a dispatcher, not twiddling an existing one 23:51
but mostly, I just want to be able to write {*} 23:52
lue rakudo: my @a; @a[0..5] = 2; say @a
p6eval rakudo c80319: OUTPUT«2Any()Any()Any()Any()Any()␤»
lue rakudo: my @a; @a[0..5] «=« 2; say @a
p6eval rakudo c80319: OUTPUT«Cannot modify readonly value␤ in '&infix:<=>' at line 1␤ in 'hyper' at line 204:CORE.setting␤ in 'hyper' at line 211:CORE.setting␤ in main program body at line 1␤»
lue rakudo: my @a; @a[0..5] »=» 2; say @a
p6eval rakudo c80319: OUTPUT«Cannot modify readonly value␤ in '&infix:<=>' at line 1␤ in 'hyper' at line 204:CORE.setting␤ in 'hyper' at line 211:CORE.setting␤ in main program body at line 1␤»
lue *sob* 23:53
ash_ slices don't work yet
TimToady rakudo doesn't know how to turn a slice into an lvalue et
Tene rakudo: my @a; @a[0..5] = 2 xx *; say @a.perl;
ash_ NYI
p6eval rakudo c80319: OUTPUT«[2, 2, 2, 2, 2, 2]␤»
TimToady *yet
at least, not with a metaop...
lue every line of actual coding I type, I find more stuff that doesn't work. :D 23:54
23:55 hercynium left, Psyche^ joined
sorear TimToady: how do proto regexes work now? 23:57
[Coke] lue - if the channel isn't timed right,there's always perl6-lang 23:59
23:59 Patterner left, Psyche^ is now known as Patterner