Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-11-12

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:04 sorear the whole thing is kind of strange
00:05 sorear because the very existance of IntStr invalidates the optimizer's ability to assume that an Int will never be a Str
00:08 cognominal_ When one changes the semantic of a language, it is bound to mess with the optimizer :)
00:08 cognominal_ … which assumes so much about the semantic
00:23 japhb sorear, I let your comment rumble around the back of my head for a while, and I still am not sure which behavior you think we should have.
00:24 japhb I've been banging my head against the wall trying to get a fully consistent version of $dual.Int --> Int, while jnthn++ seems to have been wondering what is so hard with $dual.Int --> $dual
00:27 lumi_ joined #perl6
00:57 jnthn japhb: I think IntStr probably needs to override .Numeric, .Real and .Int to return the pure Int nature of the thing.
00:57 phenny jnthn: 11 Nov 23:56Z <cognominal_> tell jnthn an oddity with the span of an infix EXPR match  https://gist.github.com/cdc05adc82ad98272ea7
00:57 jnthn cognominal_: Yes, see in the debugger widen_EXPR or so, to see how I dealt with that.
00:58 cognominal_ cool
01:00 anuby joined #perl6
01:01 cognominal_ why do you need that in the debugger?
01:02 anuby joined #perl6
01:03 jnthn cognominal_: The debugger is pretty good at knowing what the "current thing" is
01:04 jnthn cognominal_: It highlights it to show you where you are
01:05 cognominal_ I definitively should look it closely
01:08 jnthn 'night, #perl6
01:08 hypolin joined #perl6
01:08 cognominal_ usually debugger are at the granulariy of the statement so I did not expect your "expression widening" be relevant
01:34 cognominal__ joined #perl6
01:41 colomon_ joined #perl6
01:41 colomon_ joined #perl6
01:43 colomon_ joined #perl6
01:44 tokuhiro_ joined #perl6
01:56 diakopter nr: sub sayf($fmt, *@args) { printf "$fmt\n", |@args }; sayf "%s 3", 5
01:56 p6eval rakudo 72a27f, niecza v22-19-gd874a8e: OUTPUT«5 3␤»
02:21 cognominal__ joined #perl6
03:16 QinGW`` joined #perl6
03:58 orafu joined #perl6
04:02 cognominal__ joined #perl6
04:30 cognominal__ joined #perl6
04:54 cognominal__ joined #perl6
05:08 xinming joined #perl6
05:41 cognominal joined #perl6
05:41 erkan joined #perl6
05:41 erkan joined #perl6
05:45 rindolf joined #perl6
06:04 birdwindupbird joined #perl6
06:28 gootle joined #perl6
07:18 rindolf joined #perl6
07:21 japhb phenny, tell jnthn Yep, I'd come to the same conclusion too -- except that I also think *Str need to override all the string-related things so that their first parent (Int, Num, etc.) doesn't try to handle stringification.  I also had to choose a booleanization mode, and a few other details I've forgotten at the moment.  And then there's RatStr and ComplexStr, which are going to be interesting beasts.  Ah well, I'll keep pounding my head o
07:22 phenny japhb: I'll pass that on when jnthn is around.
07:22 japhb n it until it makes sense.  :-)
07:25 SamuraiJack joined #perl6
07:34 rindolf joined #perl6
07:49 domidumont joined #perl6
07:54 flightrecorder joined #perl6
08:01 moritz \o
08:01 diakopter o/
08:05 cognominal joined #perl6
08:05 * diakopter reads Code Optimization: Effective Memory Usage  ... with fascination
08:07 FROGGS joined #perl6
08:14 dalek niecza: 202e700 | sorear++ | / (10 files):
08:14 dalek niecza: Top removal: basic smart constructors, symbol table
08:14 dalek niecza: review: https://github.com/sorear/niecza/commit/202e70069b
08:16 imarcusthis joined #perl6
08:21 Psyche^ joined #perl6
08:34 domidumont joined #perl6
08:35 rindolf joined #perl6
08:36 sorear \o/ below 50
08:36 dalek niecza: 48d66de | sorear++ | lib/ (4 files):
08:36 dalek niecza: Top removal: more smart constructors
08:36 dalek niecza: review: https://github.com/sorear/niecza/commit/48d66de4fb
08:39 domidumont joined #perl6
08:40 cognominal joined #perl6
08:41 FROGGS sorear: below fifty what?
08:41 FROGGS hi, btw
08:41 FROGGS ;o)
08:44 sorear FROGGS: references to Compartment.Top, the global variable that holds a reference to the current setting
08:44 sorear I've been trying to allow the niecza runtime to use two settings concurrently; this has been a _very_ hairy yak
08:44 sorear started at >700
08:45 FROGGS ohh, okay, cool
08:46 FROGGS I thought you want to give up the work on niecza? (not that I want that)
08:48 sorear dunno.  we're in a bit of a codependency situation atm
08:48 FROGGS what do you mean?
08:49 rindolf joined #perl6
08:49 moritz niecza depends on sorear, and sorear depends on niecza? :-)
08:49 FROGGS hehe
09:03 rindolf joined #perl6
09:14 rindolf joined #perl6
09:15 kresike joined #perl6
09:15 kresike hello all you happy perl6 people
09:16 dalek niecza: cde23d6 | sorear++ | lib/ (6 files):
09:16 dalek niecza: Use InvokeMethod/InvokeSub whereever feasable instead of GetInferiorRoot directly
09:16 dalek niecza: review: https://github.com/sorear/niecza/commit/cde23d6426
09:27 rindolf joined #perl6
09:30 rindolf joined #perl6
09:33 dalek niecza: c80570d | sorear++ | lib/ (7 files):
09:33 dalek niecza: misc top removal: MakePair, LHF
09:33 dalek niecza: review: https://github.com/sorear/niecza/commit/c80570d034
09:33 fhelmberger joined #perl6
09:35 dakkar joined #perl6
09:42 rindolf joined #perl6
09:47 jnthn morning, #perl6
09:47 phenny jnthn: 07:21Z <japhb> tell jnthn Yep, I'd come to the same conclusion too -- except that I also think *Str need to override all the string-related things so that their first parent (Int, Num, etc.) doesn't try to handle stringification.  I also had to choose a booleanization mode, and a few other details I've forgotten at the moment.  And then there's RatStr and ComplexStr, which are going to be interesting beasts.  Ah well, I'll keep pounding my head o
09:51 rindolf joined #perl6
09:52 jnthn phenny: tell japhb Well, RatStr and ComplexStr don't have the unboxing stuff to worry about, at least...
09:52 phenny jnthn: I'll pass that on when japhb is around.
09:56 dalek niecza: 532462b | sorear++ | / (4 files):
09:56 dalek niecza: Bring compartment stack management under compiler control
09:56 dalek niecza: review: https://github.com/sorear/niecza/commit/532462be25
09:56 wk joined #perl6
09:57 sorear sleep&
10:00 FROGGS sleep well
10:06 rindolf joined #perl6
10:13 snearch joined #perl6
10:17 grondilu joined #perl6
10:18 grondilu Say I would like to define an arrow like syntax for anonymous functions:  "x->x**2" instead of -> $x { $x**2 }.  Can I do that with a macro?
10:18 rindolf joined #perl6
10:20 moritz eventually you will, once 'is parsed' is implemented
10:21 grondilu ok
10:33 rindolf joined #perl6
10:37 rindolf joined #perl6
10:39 rindolf joined #perl6
10:47 tadzik good morning #perl6
10:47 moritz \o tadzik
10:48 felher o/
10:48 FROGGS hi tadzik
10:48 moritz with a bit of luck I should have teh internets at home again tonight
10:49 jnthn moritz: yay!
10:52 masak O frabjous day! Callooh! Callay!
10:53 masak (antenoon, #perl6)
10:53 tadzik hello hello
10:54 masak "Macros are functions that are called by the compiler during compilation. Within these functions the programmer has access to compiler APIs. For example, it is possible to generate, analyze and typecheck code." -- I like that description.
10:54 masak it's from http://scalamacros.org/ -- Scala's macros are factored quite differently from Perl 6's, for various reasons.
10:54 masak but the above could still apply to Perl 6 as well. I should spend some time thinking about the "analyze" and "typecheck" aspects.
10:55 rindolf joined #perl6
10:56 moritz it would be great if that resulted in some better abstraction within the compiler
10:56 moritz ie routines (maybe methods in World) for typechecking
10:57 moritz maybe we already have that, and I haven't really noticed
10:57 tadzik multi macros :>
10:57 moritz but somehow I feel we have lots of stuff inside the compiler that might be APIfied
10:58 masak tadzik: multi macros should already work, it's just that we need better AST introspection to do anything more with them than dispatch on number of args.
10:58 tadzik yeah
10:58 masak moritz: World was already a great step in that direction, IMO.
10:58 masak first time I looked at World: "whoa, a Perl 6 API".
10:59 moritz aye
11:01 Psyche^ joined #perl6
11:02 jnthn Note that the type checking we do today happens at CHECK time.
11:02 jnthn Well, just after CHECK time really.
11:03 jnthn Otherwise you couldn't analyze post-declared calls, for example... Or something may happen to invalidate an assumption you made.
11:03 jnthn Given we typically consider programs relatively mutable until CHECK time is done, macro application time is probably a bit early for type checking.
11:06 masak maybe the quasi block could contain a CHECK block? :)
11:06 jnthn That could work better
11:06 jnthn So long as it's a plain CHECK, and not a QCHECK
11:06 sergot hi o/
11:07 tadzik sergot: o/
11:07 jnthn o/ sergot
11:07 * jnthn waits for the QCHECK reprimand :D
11:07 sergot tadzik: should I keep working on modules.perl6.org? :)
11:08 tadzik oh, that'd be nice :)
11:08 tadzik but, are those cronjobs running?
11:09 sergot tadzik: yes, they're running
11:09 tadzik hrm
11:10 tadzik I don't see my TAP module there
11:10 sergot Because I didn't connect it with ecosystem. :(
11:11 sergot It's the first thing I should do.
11:11 tadzik ah
11:11 tadzik so projects.json is not updated?
11:12 sergot No, it's not. I'll do this. :)
11:13 tadzik you can probably just copy it over from /home/tjs/somethingsomething
11:13 rindolf joined #perl6
11:13 bbkr_ joined #perl6
11:13 tadzik or I'll have to update permissions for that.
11:28 Gryllida joined #perl6
11:30 masak jnthn: sorry, I forgot to reprimand you in due time, and the reprimand timed out. :)
11:30 jnthn .oO( phew! )
11:30 masak jnthn: but here's your obligatory Q*bert: https://en.wikipedia.org/wiki/Q*bert
11:31 jnthn Gee, that's older than me :P
11:33 masak good old NES days.
11:37 rindolf joined #perl6
11:41 rindolf joined #perl6
11:42 FROGGS looks like 1982 was a pretty cool year^^
11:42 masak jnthn: I think all CHECK blocks inside quasis should be QCHECK blocks. so we might as well drop the Q.
11:54 * moritz has lots of spectest failures
11:54 moritz oh, wrong branch
11:57 rindolf FROGGS: why?
12:06 rindolf joined #perl6
12:21 rindolf joined #perl6
12:25 sftp joined #perl6
12:29 rindolf joined #perl6
12:35 Psyche^ joined #perl6
12:38 tokuhiro_ joined #perl6
12:39 tokuhiro_ joined #perl6
13:20 dalek Perlito: 66ec858 | (Flavio S. Glock)++ | TODO-perlito5:
13:20 dalek Perlito: Perlito5 - TODO update
13:20 dalek Perlito: review: https://github.com/fglock/Perlito/commit/66ec8581ff
13:28 brrt joined #perl6
13:31 xinming joined #perl6
13:43 FROGGS rindolf: that Q*bert game was made in 1982 like me
13:44 rindolf FROGGS: ah.
13:44 atrodo joined #perl6
13:45 dalek Perlito: 7bc739e | (Flavio S. Glock)++ | / (6 files):
13:45 dalek Perlito: Perlito5 - parser - add 'Perlito5::AST::Given'
13:45 dalek Perlito: review: https://github.com/fglock/Perlito/commit/7bc739e843
13:58 rindolf FROGGS: ah, my younger sister was born in 1982 too.
13:58 FROGGS ;o)
14:04 PacoAir joined #perl6
14:04 tadzik heh, my older sister is from 1972
14:05 FROGGS well, mine from 1980 and 1976
14:05 FROGGS but doesnt matter, 1982++ ;o)
14:05 tadzik what about 1983? ;)
14:07 FROGGS well, 1982++ actualy is 1983
14:07 moritz r: 1982++
14:07 p6eval rakudo 72a27f: OUTPUT«Cannot assign to a non-container␤  in sub postfix:<++> at src/gen/CORE.setting:3077␤  in block  at /tmp/hw5STbAiFC:1␤␤»
14:08 masak nqp: 1981++
14:08 p6eval nqp: OUTPUT«Error while compiling block : Error while compiling op postinc: Post-increment can only work on a variable␤current instr.: '' pc 43971 (src/stage2/QAST.pir:15393) (src/stage2/QAST.nqp:2331)␤»
14:08 tadzik cool error message
14:13 flightrecorder joined #perl6
14:13 daxim joined #perl6
14:16 dalek Perlito: 376e088 | (Flavio S. Glock)++ | TODO-perlito5:
14:16 dalek Perlito: Perlito5 - TODO update
14:16 dalek Perlito: review: https://github.com/fglock/Perlito/commit/376e088e95
14:25 FROGGS joined #perl6
14:30 isBEKaml joined #perl6
14:45 domidumont joined #perl6
14:58 rindolf joined #perl6
15:01 stopbit joined #perl6
15:01 GlitchMr joined #perl6
15:29 benabik joined #perl6
15:30 xinming joined #perl6
15:31 domidumont joined #perl6
15:50 ifim joined #perl6
16:02 isBEKaml joined #perl6
16:03 sqirrel joined #perl6
16:12 gaussblurinc joined #perl6
16:13 kresike bye folks
16:13 masak o/
16:14 brrt left #perl6
16:17 MayDaniel joined #perl6
16:21 moritz \o
16:23 masak moritz! \o/
16:23 masak moritz: got internet yet?
16:26 rindolf moritz: \o/
16:30 moritz masak: at work, yes. At home: haven't checked yet
16:31 kaare_ joined #perl6
16:31 masak ah.
16:31 * moritz -> home
16:36 tokuhiro_ joined #perl6
16:37 isBEKaml joined #perl6
16:41 att__ joined #perl6
16:48 isBEKaml hello, #perl6!
16:49 masak isBEKaml! \o/
16:49 isBEKaml masak: Hi.. I'm still having issues with cygwin builds of parrot and rakudo. :|
16:50 isBEKaml I've asked on #parrot, it looks like a slow channel these days.
16:52 masak ok.
16:52 masak I wish I could help, but I know very little about cygwin, unfortunately.
16:52 masak you said an earlier version of Parrot builds for you, but not Parrot HEAD?
16:53 isBEKaml Well, the problem goes both ways. I've had some success building parrot from cmd prompt, but nqp just conks out looking for a shell script.
16:53 isBEKaml but with cygwin, it doesn't even go on to build.
16:53 isBEKaml aye, that was from cmd prompt. I didn't try 4.7 on cygwin.
16:55 alester joined #perl6
16:56 tokuhiro_ joined #perl6
16:56 isBEKaml path issues: /usr/bin/sh: line 0: cd: srcpmc: No such file or directory
16:56 isBEKaml that was from nqp on cmd prompt.
16:56 isBEKaml it ate the backslash.
16:57 isBEKaml from gmake clean: /usr/bin/sh: C:strawberryperlbinperl.exe: command not found
16:57 isBEKaml :)
17:00 masak hm. no idea. :/
17:02 mikemol joined #perl6
17:05 isBEKaml I'm manually editing the Makefile to use '\\' instead of '\'. Let's see how that goes.
17:06 masak isBEKaml++ # perseverence
17:06 diakopter isBEKaml: I've tried several times over the past year to build parrot on cygwin, all with failure
17:06 diakopter s/year/two years/
17:07 isBEKaml diakopter: ah, so I'm not the only one with issues. I hear rurban++ develops on cygwin for parrot.
17:07 isBEKaml I don't know how that works for him.
17:07 diakopter that's because he *is* cygwin
17:08 diakopter (ok, I exaggerate)
17:12 isBEKaml well, boo - I just remembered that Make has the ability to convert '/' to platform specific separators
17:13 kurahaupo joined #perl6
17:16 * masak .oO( category error detected near 'he [rurban] *is* cygwin'... )
17:17 rurban parrot build OOTB in my cygwins
17:17 benabik joined #perl6
17:17 diakopter rurban: which windows?
17:17 wk joined #perl6
17:18 rurban can you send me your cygwin failures
17:18 rurban I test on XP and Win7
17:18 isBEKaml rurban: https://gist.github.com/4055922
17:19 rurban isBEKaml: looks like a text mount or strange PerlIO setting
17:19 rurban is this FAT?
17:19 isBEKaml now it fails on dyncall with nqp build on cmd: https://gist.github.com/4060617
17:20 isBEKaml rurban: no, NTFS
17:20 rurban I see, wrong tools in your path
17:20 rurban gmake is not the cygwin make, its the strawberry or mingw make
17:21 isBEKaml rurban: gmake is what I use on cmd prompt.
17:21 isBEKaml rurban: I use make on cygwin.
17:21 rurban this cannot work, /usr/bin must be at the front of your PATH
17:21 isBEKaml gmake came with strawberry.
17:21 rurban del .\libdyncall_s.a will not work on cygwin
17:22 rurban there is only rm, no del. wrong toolchain.
17:22 isBEKaml rurban: I see the confusion. The libdyncall issue came from windows cmd prompt. It has nothing to do with cygwin.
17:22 rurban yes
17:22 isBEKaml rurban: the cygwin issue is what I gave you earlier. 4055922
17:23 rurban I regularly smoke cygwin and mingw on my windows vm's
17:23 rurban even with msvc8 and activeperl
17:24 isBEKaml rurban: I don't know what's wrong with my steps in building on cygwin. I do a fresh git clone, perl Configure pointing to current dir for install (without icu) and make. BAM!
17:24 diakopter msvc2010 works for me, msvc2012 doesn't
17:25 SamuraiJack joined #perl6
17:25 diakopter also, I can't build parrot with strawberry last time I tried
17:26 isBEKaml rurban: also, `which make` gives me /usr/bin/make.
17:26 rurban hmm, I also no problem at src/string/api.c :461 CONST_STRING(interp, "");
17:27 japhb diakopter, link to the code/memory optimization article?
17:27 phenny japhb: 09:52Z <jnthn> tell japhb Well, RatStr and ComplexStr don't have the unboxing stuff to worry about, at least...
17:27 isBEKaml I couldn't find anything wrong there, either. Could it be some line ending thing here?
17:27 isBEKaml CRLF <-> LF? but I have core.autocrlf git config to true (by default, this is msysgit)
17:28 diakopter japhb: it's a pdf of a hacked .chm of an out-of-print book
17:28 diakopter s/hacked/pirated/
17:29 rurban isBEKaml: can you try with cygwin tools only? cygwin git, cygwin make and so on. looks like a mingw problem
17:29 isBEKaml rurban: I'll try - I really should get down to removing unnecessary tools from my machine.
17:30 rurban no, only sanify  your PATH and/or install the missing cygwin tools
17:31 japhb diakopter, awww.  I love that kind of stuff.  Too bad it's not readily available.  :-(
17:32 diakopter I was going to buy it on Amazon, but it's... $450.
17:33 isBEKaml rurban: okay, I have cygwin autoconf tools, and perl. I'll install git. cygwin tools are first on $PATH followed by other stuff like mingw, strawberry...
17:34 japhb diakopter, woah.  That's ... REALLY steep.  My college textbooks weren't nearly that bad.
17:34 isBEKaml diakopter: 450 dollars for a book?
17:34 rurban maybe it was git
17:34 diakopter rurban: do you know of anyone who uses parrot on cygwin (regularly)?
17:34 diakopter (other than yourself, of course)
17:34 isBEKaml rurban: that would mean a fresh checkout :( slow connection here.
17:35 PerlJam r: role R { }; my @a := Array.new but R; @a[0] = 42;  # known?
17:35 p6eval rakudo 72a27f: OUTPUT«elements() not implemented in class 'Mu'␤  in method REIFY at src/gen/CORE.setting:5995␤  in method REIFY at src/gen/CORE.setting:6250␤  in method reify at src/gen/CORE.setting:5403␤  in method gimme at src/gen/CORE.setting:5768␤  in method exists at src/gen/CORE.s…
17:35 rurban me and I get regular bug reports on the cygwin list
17:35 PerlJam r: my @a := Array.new; @a[0] = 42;
17:35 p6eval rakudo 72a27f:  ( no output )
17:35 PerlJam r: my @a := Array.new; @a[0] = 42; say @a;
17:35 p6eval rakudo 72a27f: OUTPUT«42␤»
17:35 diakopter rurban: where is this cygwin list?
17:38 rurban Michael Schaap is one name from cygwin. http://dir.gmane.org/gmane.os.cygwin
17:39 isBEKaml rurban: No, same issue. :(
17:39 orafu joined #perl6
17:40 diakopter omg; stupidest forum search form ever. change a sorting option and re-search, it doesn't take you back to page 1 of the result.
17:40 rurban can you gist your cygcheck -s -v -r > cygcheck.out  (as in http://cygwin.com/problems.html)
17:40 diakopter how could anyone possibly expect a search form to behave that way
17:41 rurban you mean this one: http://search.gmane.org/?query=parrot&amp;group=gmane.os.cygwin ?
17:41 diakopter right.
17:41 diakopter I was on page 2 of that
17:41 diakopter then clicked "Newest First"
17:41 diakopter then clicked "Search >>"
17:42 diakopter it took me to page 2 of Newest First
17:42 rurban This is xapian, which normally keeps your settings on the next pages
17:42 diakopter that's a terrible usability decision
17:43 diakopter in my not-so-humble opinion, that is
17:43 isBEKaml rurban: here: https://gist.github.com/4060778
17:44 rurban It might be a xapian bug. I had similar problem on some xapian templates by myself.
17:45 spider-mario joined #perl6
17:45 diakopter I don't see any parrot errors reported since 2010-05-03
17:46 rurban diakopter: yes, since then it was pretty stable. Most problem came from attempts to do something without the parrot-devel package. like starting parrot.
17:47 rurban I fixed most upstream, but I would still call parrot packaging non-stable and non-conformant
17:47 diakopter ok. I'll interpret the lack of feedback as lack of use
17:47 rurban isBEKaml: I see no apparent problem in your cygcheck. do you run this in mintty or which term?
17:48 isBEKaml rurban: xterm
17:48 rurban diakopter: I'm not so sure. When there were problems I got immediate feedback. Since I fixed the problem no complaints anymore
17:49 diakopter oh, here's one: https://github.com/parrot/parrot/issues/241
17:49 rurban The cygwin xterm or another one?
17:49 isBEKaml cygwin xterm
17:49 isBEKaml OOTB
17:50 isBEKaml I haven't really configured cygwin much after an install.
17:51 rurban I only know of several fatal perl bugs (upstream problems), not yet parrot. I'll recheck again
17:53 rurban isBEKaml: I never really tested 64bit windows
17:54 isBEKaml rurban: I'll do a fresh checkout and try again. I'll report back in tomorrow (slow connection and everything, takes out about 2 hrs for a full checkout)
17:54 isBEKaml (parrot should really cut down on the 100+ branches on github)
17:56 rurban Windows is much much faster on kvm
17:56 rurban I just compiled parrot afresh, no problems
17:57 rurban Oh, you are in Calcutta. That must be pretty late now
17:58 gaussblurinc_ joined #perl6
17:59 isBEKaml|2 joined #perl6
18:00 isBEKaml|2 rurban: India, yes. It's about midnight here.
18:01 isBEKaml|2 (Mumbai)
18:02 rurban Mumbai is a bit nearer. I'm pretty sure there's something wrong with your system, not with parrot. The rakudo build error looks strange though, using gmake on cygwin
18:02 benabik joined #perl6
18:03 isBEKaml|2 rurban: No, the rakudo error is different. Like I said, it's nothing to do with cygwin - I only used cmd prompt when I couldn't build anything out of cygwin.
18:07 mucker joined #perl6
18:09 Chillance joined #perl6
18:13 isBEKaml rurban: I'll clean the paths and run them again tomorrow.
18:17 benabik_ joined #perl6
18:19 benabik_ joined #perl6
18:20 bowtie joined #perl6
18:21 flightrecorder joined #perl6
18:36 brrt joined #perl6
18:42 domidumont joined #perl6
19:06 cognominal joined #perl6
19:13 rindolf Hi all, can I use ASCII dashes/hyphens ("-") inside Perl 6 identifiers? I recall that I can.
19:21 cognominal rn: my $a-b'c = "hi"; say $a-b'c
19:21 p6eval rakudo 72a27f, niecza v22-24-g532462b: OUTPUT«hi␤»
19:23 cognominal rindolf: I think the dahs and quotes  are allowed only in "internal" positions, not in the beginning nor at the end of the part that follows the sigils.
19:23 cognominal rn: my $a--b''c = "hi"; say $a--b''c
19:23 p6eval niecza v22-24-g532462b: OUTPUT«[31m===[0mSORRY![31m===[0m��Two terms in a row at /tmp/mFP6_d1_L9 line 1:�------> [32mmy $a--[33m�[31mb''c = "hi"; say $a--b''c[0m��Parse failed��»
19:23 p6eval ..rakudo 72a27f: OUTPUT«===SORRY!===␤Confused␤at /tmp/X20qFMyjK2:1␤»
19:24 cognominal Apprently you can't use two in a row either.
19:25 rindolf rn: my $hello-world = "Hi There"; say $hello-world;
19:25 p6eval rakudo 72a27f, niecza v22-24-g532462b: OUTPUT«Hi There␤»
19:41 ifim joined #perl6
20:00 cognominal joined #perl6
20:04 obra joined #perl6
20:05 cognominal_ joined #perl6
20:23 kurahaupo joined #perl6
20:35 cognominal joined #perl6
20:38 diakopter I just tried to copy text on my laptop and paste it on my phone. I feel stupid.
20:39 masak you're not.
20:39 masak I get this meme with increasingly regular intervals.
20:39 masak it's just that the devices aren't connected enough for your use case yet.
20:40 diakopter c'mon synergy2, make an app...
20:40 masak the guy who tried to copy-and-paste from his computer to the back of an envelope, however... :)
20:40 * geekosaur wonders how long before the existing shared pasteboards add that
20:56 masak I like the point that http://www.modernperlbooks.com/mt/2012/11/api-as-documentation.html makes.
20:57 masak I like making APIs inside my programs, even if I'm the only one ends up consuming them.
21:04 PerlJam In Moose-land it's possible for a role to apply a method modifier to the class that consumes it.  How is this done in Perl 6?
21:06 jnthn Presumably using a module that implements method modifiers.
21:07 doy (role method modifiers)--
21:07 PerlJam okay.
21:07 jnthn Roles are meant to be composable units of reusability.
21:08 * diakopter roles jnthn a biscuit
21:08 jnthn There's little reusable about a role that couples to a class as tightly as a method modifier in the role would.
21:09 jnthn Short of the role being parametric on the method name, but then why not put the semantic on the method itself by implementing a trait...
21:11 lue [looking up method modifiers] Is it fair for me to think of method modifiers as [similar to] phasers?
21:16 sorear o/
21:16 jnthn lue: No, more in the space of callsame etc.
21:17 jnthn o/ sorear
21:17 PerlJam jnthn: I was playing around with how I would turn an Array into a fixed size Array and the solution that occurred first was to make a FixedSize role that could be mixed in to Array where the FixedSize role would have an at_pos() method that does the size check then calls nextsame to execute Array.at_pos
21:17 masak lue! \o/
21:18 masak lue: I think method modifiers are things like 'before', 'after' and 'around', a la Moose.
21:18 tadzik which are awesome, imho :)
21:18 lue Ah. I'm looking at Moose::Manual::MethodModifiers, and it didn't at first strike me how it was useful. If it's like callsame though, I'd think using, well, callsame would be a good idea.
21:19 jnthn PerlJam: Something like that could work, yes. Though there's lots of other ways to do that kinda thing.
21:20 masak lue: well, people keep wanting the method modifiers, too.
21:20 jnthn PerlJam: I know somebody is looking into that at the moment.
21:21 PerlJam jnthn: making fixed size arrays?
21:21 jnthn PerlJam: Yes.
21:22 jnthn PerlJam: Somebody who got in contact with TPF wanting to do something on Rakudo as their open source community service thingy as part of their college. They got passed along to me; I've of course mentioned #perl6 is an awesome place to drop by, but didn't see them here yet...
21:22 lue I can see where method modifiers are useful, but I think I'm failing to see why you'd put them in a role (as opposed to putting the modifier's code in the method itself), except to do something something like  around 'sub1' => &wrapper; around 'sub2' => &wrapper;  etc.
21:23 * lue now of course stumbles upon the Moose manual's "Wrapping multiple methods at once" section
21:24 doy the main reason that people use method modifiers in roles in moose is to wrap methods in other roles, not necessarily to wrap methods in classes
21:25 doy because that avoids requiring manual conflict resolution
21:25 doy but... that's really not a great way to solve that problem
21:26 PerlJam In my example, the Array class has an at_pos method that is used for indexing into the array.  To make a fixed size array, I'd want at_pos to behave exactly as it does, but add some code before it that does the checking.  Hence what led me to think of method modifiers.
21:26 lue .oO(Then again, my one case for useful modifiers could also be done with macros...)
21:27 PerlJam lue: that was my second idea that I haven't explored yet :)
21:27 jnthn Everything can be done with macros! Just ask masak :D
21:27 lue Maybe if I used Perl 5 I'd understand method modifiers better, but I keep on trying to find a situation where there's no other (P6) solution...
21:27 jnthn PerlJam: The role approach is the sane one, imho
21:30 PerlJam r: my @a := Array.new; say @a.perl;  role R { }; my @b := Array.new but R; say @a.perl;
21:30 p6eval rakudo 72a27f: OUTPUT«Array.new()␤Array.new()␤»
21:30 PerlJam r: my @a := Array.new; @a[0] = 42; say @a.perl;  role R { }; my @b := Array.new but R; @b[0] = 5; say @b.perl;
21:30 sorear lue: method modifiers in p5 are a convenience too, but more of one, because 'callsame' is harder to use in p5
21:30 p6eval rakudo 72a27f: OUTPUT«Array.new(42)␤elements() not implemented in class 'Mu'␤  in method REIFY at src/gen/CORE.setting:5995␤  in method REIFY at src/gen/CORE.setting:6250␤  in method reify at src/gen/CORE.setting:5403␤  in method gimme at src/gen/CORE.setting:5768␤  in method exists at …
21:31 sorear lue: largely because context flows inward
21:31 PerlJam ah.
21:31 jnthn PerlJam: Hmmm...
21:31 PerlJam did that binding not work correctly?
21:31 jnthn PerlJam: I'm not sure what happene.d
21:32 jnthn PerlJam: It really shoulda worked...
21:33 lue OK. I see it still could be a convenience in P6, my mind was stuck in "when do I *need* it?" land.
21:34 * PerlJam builds the rakudo debugger for the first time
21:36 timotimo i wonder: when should a macro chapter for the perl 6 book be written?
21:36 PerlJam timotimo: whenever masak has time :)
21:36 timotimo not that i'm volunteering, but why should we force masak to do it? :P
21:37 sorear lue: "after" in p5 looks like this: sub foo { my $self = shift; my @res; if (!defined wantarray) { $self->SUPER::foo(@_) } elsif (wantarray) { @res = $self->SUPER::foo(@_) } else { @res = scalar $self->SUPER::foo(@_) }; do stuff; return wantarray ? @res : $res[0] }
21:37 doy callsame is harder in p5 also because SUPER:: is broken (the method is resolved based on the package the call is compiled in, not the package the current method is installed into)
21:38 doy so anything involving SUPER:: just won't work in roles
21:42 lue looking up wantarray in the specs, I just found a use of ¢a. What should that be replaced with?
21:42 masak lue: where did you find ¢a?
21:43 lue in S08. [I can find line number in a second if you want.]
21:44 lue S08:221
21:44 * masak looks
21:45 masak there simply isn't a "capture sigils".
21:45 masak I guess captures aren't important enough to have their own sigil. a bit like sets and bags.
21:45 masak I do believe ¢ occurs in STD.pm6, though.
21:45 masak oh, that's $¢
21:49 cognominal joined #perl6
21:50 lue So would replacing it with a $ be good?
21:51 masak yes. that always works, regardless of data type.
21:51 masak even arrays and hashes :)
21:52 lue Not quite sure what the @% is supposed to be just below that either.
21:52 lue (ascii version of ¢?)
21:52 timotimo is there a good replacement example for the book to replace the outdated "substr has three- and four-parameter versions"?
21:52 sorear $¢ needs to go, btw
21:52 masak oh yay! why?
21:52 sorear it is the _only_ thing in Perl 6 that cnanot be written in ASCII
21:53 masak timotimo: there's a substr-rw in both Rakudo and Niecza, I belive.
21:53 sorear timotimo: I think substr still has afour-parameter version?
21:53 masak sorear: that's what I've been saying for years. :)
21:53 timotimo i thought it was removed from the specs?
21:53 * diakopter assents
21:53 timotimo the point of the section seemed to be "look, one of the versions binds the first parameter as rw, the other one doesn't"
21:59 lue .oO(I like the look of the ¢, it's a shame it's not on most people's keyboards. There aren't a lot of ascii chars left for [s||tw]igils)
22:00 benabik ¢ is Opt-4 on OS X
22:01 sorear also, this is a utf-8 channel
22:01 * benabik hopes he's using UTF8...
22:02 cognominal joined #perl6
22:02 sorear you are, lue isn't
22:02 lue Huh, I see benabik and my cent signs correctly. /me checks settings
22:02 sorear and irssi stupidly is just replacing all of lue's characters with question marks
22:02 doy i can see both benabik's and lue's ¢ just fine
22:03 sorear whatever client doy is using is handling this better than $ancient_irssi
22:03 jnthn My irssi renders both fine, fwiw.
22:03 benabik I can see both, but it marks lue with [incompatible encoding]
22:03 benabik it = Colloquy
22:04 diakopter there's all those P5 special ones - like $`
22:08 lue I think I fixed it. ¢
22:09 dalek book: c3af22b | timo++ | src/roles.pod:
22:09 dalek book: Improve sentence based on issue77
22:09 dalek book: review: https://github.com/perl6/book/commit/c3af22bc92
22:10 flussence yep, that's a ¢ now
22:10 cognominal joined #perl6
22:11 rjt_ left #perl6
22:12 cognominal joined #perl6
22:12 sorear lue: wfm
22:14 masak lue++ # utf-8
22:14 lue xchat-- for it's default "IRC" encoding.
22:15 lue s/it's/its/
22:21 dalek book: 8a1cd47 | timo++ | src/operators.pod:
22:21 dalek book: Use reworded sentence from #75
22:21 dalek book: review: https://github.com/perl6/book/commit/8a1cd47df9
22:25 masak 'night, #perl6
22:25 tadzik good knight
22:30 marloshouse joined #perl6
22:31 kurahaupo left #perl6
22:33 leont joined #perl6
22:38 jnthn 'night, #perl6
22:39 sorear knight jnthn
22:47 xillver joined #perl6
23:02 cognominal joined #perl6
23:02 cognominal rn:  constant $indiana_pi = 3; constant indiana_tau = 2 * $indiana_pi
23:02 p6eval rakudo 72a27f, niecza v22-24-g532462b:  ( no output )
23:13 whiteknight joined #perl6
23:14 fgomez joined #perl6
23:20 japhb cognominal++ # Reminding me to add a Tom Petty station to Pandora
23:24 leont left #perl6
23:29 circlepuller joined #perl6
23:29 mtk joined #perl6
23:29 ruoso joined #perl6
23:29 baest joined #perl6
23:29 revdiablo joined #perl6
23:29 zb joined #perl6
23:36 cognominal I thought that sigiless constant were compile time and sigilwith run tine, I was wrong. S03 says they are both compile time
23:38 sorear you can also have sigilful and sigilless runtime variables
23:38 sorear my \foo = 2+2; # run time
23:43 rjbs joined #perl6
23:44 fgomez joined #perl6
23:51 benabik joined #perl6
23:55 cognominal joined #perl6
23:56 LordVorp joined #perl6
23:58 ironcamel joined #perl6

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

Perl 6 | Reference Documentation | Rakudo