»ö« | 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. |
|||
TimToady | rakudo: say (1...10).map(* * *).map(* * 10) | 00:00 | |
p6eval | rakudo e58b16: OUTPUT«20120300560900» | ||
TimToady | rakudo: say ~(1...10).map(* * *).map(* * 10) | ||
p6eval | rakudo e58b16: OUTPUT«20 120 300 560 900» | ||
TimToady | that's also quite wrong | 00:01 | |
oh, way | |||
*wait | |||
rakudo: say ~(1...10).map(* ** 2).map(* * 10) | |||
p6eval | rakudo e58b16: OUTPUT«10 40 90 160 250 360 490 640 810 1000» | ||
TimToady | no, it's fine, it's my brane is rwong | 00:02 | |
00:02
bjarneh joined
|
|||
jnthn | I think it's more a bug in the iterator impl | 00:02 | |
Likely oversight/unchecked condition than anything fundemental. | |||
But too tired to trace it now | |||
00:03
eiro left
|
|||
TimToady | rakudo: say (1 ... 10).grep({ $_ %% 2}).grep(*) | 00:03 | |
p6eval | rakudo e58b16: ( no output ) | ||
TimToady | rakudo: say ~(1 ... 10).grep(*).grep(*) | ||
p6eval | rakudo e58b16: ( no output ) | 00:04 | |
TimToady | rakudo: say ~(1 .. 10).grep(*).grep(*) | ||
sorear | is my *$a := foo; the best way to get the head of a lazy list in P6? | ||
00:04
eiro joined
|
|||
p6eval | rakudo e58b16: ( no output ) | 00:04 | |
TimToady | well, if you don't want the tail, maybe | ||
also, probably fails with too many args | 00:05 | ||
sorear | I'm thinking about the correct equivalent code for if (my ($C) = $C->foo) { .. } | ||
TimToady | that looks vaguely familar :) | 00:06 | |
how 'bout foo[0] | |||
hmm, might be heavy | 00:07 | ||
well, my ($a) = foo might just still work | |||
or possibly my ($a,*@) = foo will do | 00:08 | ||
since the my makes a sig in p6 | 00:09 | ||
jnthn | I hope you wanted a := :-) | ||
But yes, I think that'd work | |||
slurpies are lazy | |||
TimToady | ((my $a),*) = foo to force nonsig | ||
though probably nyi | |||
jnthn | my ($a,*@) = foo will parse it as a sig but then whine that it's too complex to be turned into a plain old list | 00:10 | |
TimToady | rakudo: say (my $a) = 1,2,3; say $a | ||
p6eval | rakudo e58b16: OUTPUT«Any()» | ||
jnthn | huh. | ||
TimToady | thats...bogus | ||
jnthn | That's very odd | ||
TimToady | rakudo: my $a; say ($a) = 1,2,3; say $a | 00:11 | |
lue | only one say got interpreted, it seems. | ||
p6eval | rakudo e58b16: OUTPUT«Any()» | ||
TimToady | rakudo: my $a; ($a) = 1,2,3; say $a | ||
lue | [timtoady's first try] | ||
p6eval | rakudo e58b16: OUTPUT«1 2 3» | ||
TimToady | rakudo: (my $a) = 1,2,3; say $a | ||
p6eval | rakudo e58b16: OUTPUT«1 2 3» | ||
TimToady | rakudo: ((my $a),*) = 1,2,3; say $a | 00:12 | |
p6eval | rakudo e58b16: OUTPUT«1» | ||
TimToady | there you go | ||
rakudo: (my $a,*) = 1,2,3; say $a | |||
p6eval | rakudo e58b16: OUTPUT«1» | ||
sorear | TimToady: not planning to actually generate Perl 6 for input to Rakudo | ||
instead I'm plotting niecza's regex compiler | 00:13 | ||
TimToady | well, tmtowtdi | ||
ingy | rakudo: class C { has $.v is rw }; my $o = C.new; $o.v = "a\nb\n"; my $s = $o.v; $s ~~ s/\n$// | 00:16 | |
00:16
Guest48289 left,
ispeak_ joined
|
|||
p6eval | rakudo e58b16: ( no output ) | 00:16 | |
ingy | rakudo: class C { has $.v is rw }; my $o = C.new; $o.v = "a\nb\n"; my $s = $o.v; $s ~~ s/\n$//; say $s; | 00:17 | |
p6eval | rakudo e58b16: OUTPUT«ab» | ||
TimToady | try with $$ instead | 00:18 | |
unless, of course, that's not what you want :) | 00:19 | ||
00:20
ispeak_ left
|
|||
ingy | jnthn: have you seen: Null PMC access in find_method('new') | 00:20 | |
jnthn | Not for a long time. | ||
00:20
chitragupt left,
[Coke] left,
gfldex left,
LionMadeOfLions left,
rokoteko left,
cosimo left
|
|||
ingy | jnthn: IIIII | 00:22 | |
sorry | |||
TimToady | this is #perlIIIIII | ||
ingy | jnthn: I get it on a $s ~~ /...// | ||
TimToady: :P | 00:23 | ||
sorear | Perl IX | ||
00:23
eiro left
|
|||
TimToady | is that like Ice IX? | 00:23 | |
turns the whole world into a Perl cube? | 00:24 | ||
00:24
frew joined
00:25
[Coke] joined,
rokoteko joined
|
|||
ingy | rakudo: my $s = *; $s ~~ s/...//; | 00:26 | |
p6eval | rakudo e58b16: ( no output ) | ||
ingy | rakudo: my $s = *; $s ~~ s/...//; say $s | 00:27 | |
p6eval | rakudo e58b16: OUTPUT«!whatever_dispatch_helper» | ||
ingy | rakudo: my $s = *; say $s | ||
p6eval | rakudo e58b16: OUTPUT«!whatever_dispatch_helper» | ||
TimToady | DIHWIDT | ||
ingy | rakudo: say * | ||
p6eval | rakudo e58b16: OUTPUT«!whatever_dispatch_helper» | ||
00:27
chitragupt joined
|
|||
jnthn | So it's doing *.Str which gets curried | 00:27 | |
TimToady | .Str isn't supposed to curry * | 00:28 | |
.Stringy is | |||
sorear | rakudo: say *.Str | ||
p6eval | rakudo e58b16: OUTPUT«_block65» | ||
00:28
cognominal joined
|
|||
TimToady | just as .Str isn't supposed to thread junctions | 00:28 | |
ingy is lost | 00:29 | ||
TimToady | .Str is a low-level "turn this into a single string no matter what" | ||
00:29
Pravin joined
00:30
Pravin left
|
|||
TimToady | ~$x is the same as .Stringy, which says, 'do stringification', and can autothread over junctions | 00:30 | |
00:30
cosimo joined
|
|||
sorear | .Stringy turns an object into a Str, Buf, or Cat !?!? | 00:30 | |
TimToady | say (1|2).Str | ||
rakudo: say (1|2).Str | |||
p6eval | rakudo e58b16: OUTPUT«any(1, 2)» | ||
TimToady | rakudo: say ~(1|2) | ||
p6eval | rakudo e58b16: OUTPUT«any(1, 2)» | ||
TimToady | which is wrong | 00:31 | |
00:31
mtnviewmark joined
|
|||
TimToady | should say any("1","2") | 00:31 | |
rakudo: say ~(1|2).Stringy | |||
p6eval | rakudo e58b16: OUTPUT«Method 'Stringy' not found for invocant of class 'Int' in main program body at line 1» | ||
TimToady | rakudo: say (1|2) ~ "" | 00:32 | |
p6eval | rakudo e58b16: OUTPUT«any("1", "2")» | ||
TimToady | liek that, only unary :) | ||
*ke | |||
sorear | std: my $x is smiling; | ||
p6eval | std 31610: OUTPUT«ok 00:01 111m» | ||
sorear | rakudo: my $x is smiling; | ||
TimToady | std doesn't check traits at all | ||
p6eval | rakudo e58b16: OUTPUT«No applicable candidates found to dispatch to for 'trait_mod:<is>'. Available candidates are::(Mu $child, Role $r):(Routine $r, Any :default($default)!):(Code $block, Any $arg?, Any :export($export)!):(Mu $child, Mu $parent):(Mu $type where ({ ... }), Any :rw($rw)!):(Mu | ||
..$type… | |||
00:33
mtnviewmark left
|
|||
sorear | wait, how did rakudo even get that far | 00:33 | |
I thought 'my $x is smiling' did a name lookup on ::smiling | |||
before calling any multis | |||
TimToady | only to see if it's a known type | ||
if not, it must be a trait that is handled by a compile-time dispatch | 00:34 | ||
sorear | what if it is a known type? | ||
TimToady | then it's an "isa" | ||
sorear | my $x is Foo => Foo is container type | 00:35 | |
my $x is cow => trait_mod:<is>($declarand, :cow) | |||
? | |||
TimToady | or that, yes, on a non-class | ||
rakudo: my $x is Scalar of Int = 42; say $x | |||
ingy | what's a more direct way to do subst besides ~~ s/// ? | ||
p6eval | rakudo e58b16: OUTPUT«No applicable candidates found to dispatch to for 'trait_mod:<is>'. Available candidates are::(Mu $child, Role $r):(Routine $r, Any :default($default)!):(Code $block, Any $arg?, Any :export($export)!):(Mu $child, Mu $parent):(Mu $type where ({ ... }), Any :rw($rw)!):(Mu | 00:36 | |
..$type… | |||
ingy | because the ~~ is screwed up | ||
TimToady | rakudo: my @x is Array of Int = ^42; say ~@x | ||
p6eval | rakudo e58b16: OUTPUT«Modifications to classes are not allowed after instantiation. in 'trait_mod:<is>' at line 61:CORE.setting in main program body at line 20:/tmp/lnm3f03urY» | ||
TimToady | um | 00:37 | |
lue | don't quote me, but I think s/// is described in S05 | ||
TimToady | rakudo: my $x = 'abc'; $x.=substr(/b/,'r'); say $x | 00:38 | |
rakudo: my $x = 'abc'; $x.=subst(/b/,'r'); say $x | |||
p6eval | rakudo e58b16: ( no output ) | ||
rakudo e58b16: OUTPUT«arc» | |||
00:38
LionMadeOfLions joined
|
|||
TimToady | rakudo: my $x = 'abc'; say $x.subst(/b/,'r'); | 00:38 | |
p6eval | rakudo e58b16: OUTPUT«arc» | ||
TimToady | that kind of more direct? | ||
ingy | rakudo: my $x = 'abc'; $x.subst(/b/,'r'); say $rx | 00:40 | |
rakudo: my $x = 'abc'; $x.subst(/b/,'r'); say $x | |||
p6eval | rakudo e58b16: OUTPUT«===SORRY!===Symbol '$rx' not predeclared in <anonymous> (/tmp/nGyLgWWCRw:20)» | ||
rakudo e58b16: OUTPUT«abc» | |||
lue | .oO(~~ is smart match, so I guess it should deal with regex matches too. A pun in P6 is just waiting.) |
||
ingy | rakudo: my $x = 'abc'; $x.=subst(/b/,'r'); say $x | ||
p6eval | rakudo e58b16: OUTPUT«arc» | ||
ingy | TimToady: yeah | ||
Null PMC access in find_method('new') was caused by ~~s/// but .=subst() worked fine :( | 00:42 | ||
lue | rakudo: my $a = Regex.new(<alpha>) | 00:44 | |
p6eval | rakudo e58b16: OUTPUT«too few positional arguments: 2 passed, 3 (or more) expected in main program body at line 1» | ||
lue | rakudo: my $a = /<alpha>/; say $a.WHAT | 00:47 | |
p6eval | rakudo e58b16: OUTPUT«Regex()» | ||
lue | rakudo: my $a = /<alpha>+/; my $b = "!! smart" ~~ $a; say "$\ match" | 00:49 | |
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Unsupported use of $\ variable; in Perl 6 please use the filehandle's :ors attribute at line 20, near " match\""» | ||
lue | rakudo: my $a = /<alpha>+/; my $b = "!! smart" ~~ $a; say "$b match" | ||
p6eval | rakudo 692aa1: OUTPUT«smart match» | ||
TimToady | decommuting & | ||
lue | .oO(the pun needs a little work, but at least it's out there.) |
00:51 | |
00:54
jaldhar joined
|
|||
ingy | is 'this' a p6 keyword? | 00:55 | |
lue | afk | 00:58 | |
00:58
jaldhar left
|
|||
sorear | ingy: yes, but it's spelled 'self' | 01:00 | |
01:18
meppl left
|
|||
ash_ | rakudo: class Foo { has $.a; method bar { self.a } }; say Foo.new(:a(10)).bar; | 01:30 | |
p6eval | rakudo 692aa1: OUTPUT«10» | ||
awwaiid | rakudo: class Foo { has $.a; method bar { .a } }; say | 02:09 | |
p6eval | rakudo 692aa1: OUTPUT«» | ||
awwaiid | er | 02:10 | |
rakudo: class Foo { has $.a; method bar { .a } }; say Foo.new(:a(10)).bar; | |||
p6eval | rakudo 692aa1: ( no output ) | ||
ash_ | rakudo: class Foo { has $.a; method bar { $!a } }; say Foo.new(:a(10)).bar; | 02:13 | |
p6eval | rakudo 692aa1: OUTPUT«10» | ||
ash_ | rakudo: class Foo { has $.a; method bar($this:) { $this.a } }; say Foo.new(:a(10)).bar; # if you want to use this instead of self... | 02:15 | |
p6eval | rakudo 692aa1: OUTPUT«10» | ||
02:15
gfx joined
|
|||
lue | I'm guessing string encoding standards (Unicode, Shift-JIS, etc.) comes from Parrot? | 02:20 | |
TimToady | string encoding standards usually come from standards bodies | 02:22 | |
lue | It's availability comes from Parrot, I meant. :) | 02:24 | |
s/'// | |||
02:26
jaldhar joined
|
|||
lue | or rather: Are my options for encoding methods in Rakudo limited by what's been implemented in Parrot? | 02:30 | |
TimToady | well...considering rakudo doesn't really do buffers yet, it's whatever you get as options on open | 02:32 | |
02:33
snarkyboojum left
02:35
stef__ joined
|
|||
lue | one of masak's commits seems to suggest we don't have control over available encoding methods directly. | 02:36 | |
[ I could be misinterpreting it though :) ] | |||
02:37
snarkyboojum joined
02:38
stef_ left
|
|||
sorear | lue: encodings are just algorithms, you can write your own | 02:42 | |
sorear is thinking classes need to be a special kind of sub | |||
TimToady | why? | 02:45 | |
02:49
ash_ left
02:57
sftp left
02:59
xinming left
03:01
ash_ joined
|
|||
lue is trying to find out how to write such an algorithm | 03:07 | ||
03:10
xinming joined
03:13
xinming left
|
|||
sorear | TimToady: because they have a lexical scope and are cloned | 03:16 | |
03:23
ash_ left
03:29
xinming joined
03:57
xinming left
03:59
xinming joined
04:07
snarkyboojum left
04:18
hercynium left
04:35
ash_ joined,
bjarneh left
04:38
justatheory left,
azert0x joined,
azert0x left
04:41
azert0x joined,
azert0x left,
ash_ left
|
|||
sorear | rakudo: my class A { say A.new; } | 04:53 | |
p6eval | rakudo 692aa1: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected in main program body at line 1» | ||
sorear | pugs my class A { say A.new; } | ||
pugs: my class A { say A.new; } | |||
p6eval | pugs: OUTPUT«<obj:A>» | ||
sorear | elf: my class A { say A.new; } | ||
p6eval | elf 31610: OUTPUT«syntax error at (eval 124) line 4, near "{ package A"BEGIN not safe after errors--compilation aborted at (eval 124) line 5. at ./elf_h line 5881» | 04:54 | |
sorear | mildew: my class A { say A.new; } | ||
p6eval | mildew: OUTPUT«Can't open perl script "mildew": No such file or directory» | ||
04:58
xinming left
05:01
tylerni7 left
05:03
envi^home joined
05:08
tylerni7 joined
05:09
tylerni7 left,
tylerni7 joined
|
|||
lue is going insane trying to find one webpage about implementing an encoding standard | 05:12 | ||
05:15
tylerni8 joined
05:16
tylerni7 left
05:21
tylerni8 left,
tylerni7 joined,
tylerni7 left,
tylerni7 joined
05:29
azert0x joined
05:30
xinming joined
05:31
ashleydev joined
05:44
tylercurtis left
05:47
PerlJam left
05:48
PerlJam joined
|
|||
sorear | lue: character encoding standards are completely insane | 05:50 | |
every country has ten of the stupid things | |||
also, everybody hates encodings invented by foreigners | |||
I will be amazed if Unicode catches on outside the US | |||
here's one of the more awesome ones: www.unicode.org/reports/tr16/ | 05:52 | ||
(implemented natively in the Perl 5 core!) | |||
05:53
meppl joined
|
|||
lue | I can't find one document on how to implement an encoding standard, that's what's making me loopy right now :) | 05:57 | |
But I agree, way too many encoding standards O.o | 05:58 | ||
sorear | what, exactly, are you having trouble with? | 06:00 | |
what encoding standard are you trying to implement? | |||
I would assume you're trying to find the spec for an encoding stnadard | |||
06:01
cls_bsd joined
|
|||
lue | well, I'm looking for general tips on implementing encoding standards (probably ISO-8859-1 first, to let some tests pass). | 06:02 | |
sorear | 1. find the definition of the encoding | 06:03 | |
2. implement it | |||
it really is that easy | |||
find the person who implemented :=; this is 1000x easier | |||
lue found himself | |||
sorear | never can tell with those IRC people | 06:04 | |
they're often collective pseudonyms | |||
lue | The idea I got is a low-level one, where I get the number and then manually pull the letter from a correctly encoded font :D | 06:05 | |
If it's that easy, then I'll gladly give that idea up. | 06:06 | ||
sorear | ok | 06:07 | |
a character encoding is an algorithm for mapping strings to byte sequences | |||
are you following me | |||
lue | yes. | 06:08 | |
sorear | most encodings (Baudot, SCSU and the ISO-2022 family are the main exceptions here) encode each character independantly | ||
a becomes 61, « becomes C2 AB, «a« becomes C2 AB 61 C2 AB | 06:09 | ||
in one well-known encoding | |||
still follow | |||
lue | yes. | 06:10 | |
[I think the idea I got is the kind of idea you implement at the OS level] | |||
06:12
Guest38858 left,
Guest38858 joined,
Guest38858 is now known as pragma_
|
|||
sorear | just out of curiousity, how old are you | 06:14 | |
lue | 15 | 06:15 | |
I know how character encoding works, what happened is I got an overcomplicated idea which made my life miserable. | |||
sorear | hah. I knew it | ||
06:16
constant left
|
|||
lue | Now that I know that's overcomplicating things, my life is good again. thank you sorear. | 06:16 | |
sorear | back when I was 15 I, too, was obsessed with exactly this sort of thing | ||
06:17
constant joined,
constant left,
constant joined
|
|||
sorear | (I think I still have a copy of that OS I wrote with a text editor, a shell, and a B compiler lying around somewhere. Idiot me didn't understand B+ trees back then so the whole thing is nigh-unusably slow...) | 06:18 | |
so, for most encodings, you can encode characters one at a time | |||
a string is a lot like a list of characters | |||
rakudo: say "«a«".comb.perl | |||
p6eval | rakudo 692aa1: OUTPUT«("«", "a", "«")» | ||
sorear | you can unpack it into a real list with .comb | ||
how about a really, really simple encoding: UTF-32BE | 06:19 | ||
UTF-32BE is defined using Unicode | 06:20 | ||
Unicode assigns numbers to characters, so it's already most of an encoding | |||
but the numbers Unicode assigns go up to ~1 million, and normal character encodings are only allowed to use 0 - 255 | |||
UTF-32 uses base 256 arithmetic to represent each character in 4 "digits" | 06:21 | ||
rakudo: sub char2utf32($ch) { my $unicode_index = ord($ch); (($ch div 16777216) mod 256), (($ch div 65536) mod 256), (($ch div 256) mod 256), (($ch div 256)) }; say "«a«".comb.map(&char2utf32).perl.say | 06:22 | ||
p6eval | rakudo 692aa1: ( no output ) | 06:23 | |
sorear | rakudo: sub char2utf32($ch) { my $unicode_index = ord($ch); (($ch div 16777216) mod 256), (($ch div 65536) mod 256), (($ch div 256) mod 256), (($ch div 256)) }; say "«a«".comb.map(&char2utf32).perl | ||
p6eval | rakudo 692aa1: ( no output ) | ||
sorear | what gives, Rakudo | ||
rakudo: sub char2utf32($ch) { my $unicode_index = ord($ch); return (($ch div 16777216) mod 256), (($ch div 65536) mod 256), (($ch div 256) mod 256), (($ch div 256)) }; say "«a«".comb.map(&char2utf32).perl | |||
p6eval | rakudo 692aa1: ( no output ) | ||
sorear | ok, rakudo appears to be broken | 06:26 | |
> sub char2utf32($ch) { my $u = ord($ch); return (($u div 16777216) mod 256), (($u div 65536) mod 256), (($u div 256) mod 256), (($u mod 256)) }; say "«a«".comb.map(&char2utf32).flat.perl | 06:27 | ||
(0, 0, 0, 194, 0, 0, 0, 171, 0, 0, 0, 97, 0, 0, 0, 194, 0, 0, 0, 171) | |||
much better | |||
p6eval-- | |||
lue: still with me? | 06:28 | ||
lue | yes. | ||
sorear | do you understand what that code is doing? | ||
lue | yes, it takes a character (I presume to utf8) and turns it into utf-32 | 06:29 | |
[I'll read up on the specifics of UTF-32] | |||
sorear | I just explained UTF-32. | ||
If you still need to "read up", then no, you're *not* following me and I need to explain something | |||
What do I need to explain? | |||
06:30
xinming left,
cognominal left
|
|||
lue | Sorry, I didn't mean it like that. | 06:31 | |
06:32
stef__ left,
xinming joined
|
|||
lue | [I actually don't know what I meant there; I incorrectly thought there was more magic to UTF-32] | 06:32 | |
sorear | Oh. Ok. | 06:33 | |
(I'm just doing a list of numbers because Rakudo doesn't support byte strings well yet. masak++ for being in the middle of fixing this) | |||
Another important family of encodings are the "SBCS" encodings, or Single-Byte Character Set | 06:34 | ||
SBCS encodings, as their names imply, devote 1 and only 1 byte to each character | |||
therefore, they can faithfully represent no more than 256 characters | |||
lue | (ASCII and ANSI immediately come to mind, although ASCII is technically 7-bit) | 06:35 | |
sorear | all SBCS encodings predate Unicode, and SBCS encodings were the dominant family (outside of Asia, anyway) before recently | ||
ANSI is not a protocol | |||
er | |||
ANSI is not a character set | |||
06:36
cognominal joined
|
|||
sorear | ANSI is a byte-oriented interactive protocol for communicating with video terminals like the DEC VT-102 | 06:36 | |
among other services, ANSI allows a character encoding to be negotiated, allowing text to be sent to the terminal | 06:37 | ||
lue | Alright. (I must've misread something.) | ||
sorear | ANSI also provides services for editing already sent text, changing font sizes, ejecting sheets of paper, making noises, reprogramming the terminal so that the space bar generates "rm -rf /\n", and many other things | 06:38 | |
to my knowledge, no complete implementation exists | |||
note that ANSI is actually the name of a standards body | |||
the standard most people are talking about has a much different name | |||
as is common for standards, it is actually available from several different organizations | |||
you can get a free copy at www.ecma-international.org/publicat...ma-048.pdf | 06:39 | ||
this is the single most confusing document I have ever attempted to read | |||
I've read disassembler output which made more sense | 06:40 | ||
also, it's not just you | |||
lots of people misunderstand what it is | |||
end of tangent | 06:41 | ||
ASCII is, yes, an example | |||
it's the mother of most SBCSes, actually | |||
most national SBCSes came about by importing US-ASCII computers and adding some other characters | 06:42 | ||
most of them added characters in the 128-255 range that ASCII didn't use (because ASCII was designed for use as part of a 7-bit teleprinter line protocol) | |||
not quite always, though | 06:43 | ||
a lot of people replaced $ with their favorite currency symbol | |||
pugssvn | r31611 | lwall++ | [spec] random cleanup of fossils from before proto became a multi wrapper | ||
06:43
PZt left
|
|||
sorear | the Finns replaced [ \ ] { | } with Ä Ö Ë ä ö ë | 06:44 | |
the Finnish code deserves special mention for two reasons. | |||
One, all IRC servers nominally use it, and as such #moo[ and #moo{ are considered to be the same channel (because they're really #mooä and #mooÄ and it's case insensitive | 06:45 | ||
Two, trigraphs were added to C to support them (and possibly other contries that did the same thing?) if( array ??( index ??) ) ??< code here ??> | 06:46 | ||
lue | That's interesting. | ||
sorear | The Japanese (back before computers were powerful enough to support a kanji font) used an 8-bit code with the katakana sylabery in part of 128-255 | 06:47 | |
but they also switched out \ for the yen sign for some reason | |||
anyways, towards the end of the SBCS era, every country that used non-US-English letters had their own, incompatible, SBCS | 06:48 | ||
06:49
gfx left
|
|||
lue | .oO(what joy international emails and the Internet in general must've been) |
06:49 | |
sorear | I should also mention EBCDIC, IBM's ASCII competitor, which was origenally intended to be a compatible extension of the old (pre-1900) punch card formats, but they managed to invent six versions of it that weren't even compatible with *each other*... luckily this is dead now | ||
exactly | |||
international e-mail is what about the end of this era | 06:50 | ||
brought about | |||
near the end, the ISO tried to improve the situation as much as they could while still using 8-bit codes | 06:51 | ||
so they came up with a few encodings each of which served several countries, collectively known as ISO-8859 | 06:52 | ||
06:52
LionMade0fLions joined
|
|||
sorear | ISO-8859-1 was designed to serve England, France, Spain, the U.S, Germany | 06:52 | |
lue | (about 13 or 14 of them, if I recall) | ||
TimToady | -1 became -15 when they added the euro | ||
but people still just call it latin-1 | 06:53 | ||
sorear | it has ASCII, «french quotes», áccentos, eñe, sharp s (ß), a few other things | ||
TimToady | and that became the first 256 chars of Unicode | ||
.u ¬ | 06:54 | ||
phenny | U+00AC NOT SIGN (¬) | ||
sorear | Unicode is not a character encoding. It's a character *set*. Unicode, for the first time, made it possible to talk about characters independant of any one encoding | ||
06:54
LionMadeOfLions left,
breinbaas joined
|
|||
TimToady | but the codepoints have abstract numbers that just happen to match latin-1 | 06:55 | |
sorear | after Unicode was invented (early 90s), changing text between encodings became a well-defined proposition | ||
they match a lot of existing encodings | |||
TimToady | as long as you believed in UCS-2 | ||
sorear | I think the general rule was "as little creativity as possible, match status quo whenever you can" | ||
stuff like smilies are in Unicode mostly because a few of the SBCSes had them | 06:56 | ||
TimToady | I know a bunch of CJK folks who would say a great deal too much creativity was used :) | ||
Zapf Dingbats and such | 06:57 | ||
sorear | I know almost nothing about pre-Unicode CJK encodings, so I'm not talking about that aspect of the history | ||
you're welcome to though | |||
lue | what a wonderful history you're giving by the way, sorear. | ||
sorear | this is the end of my tangent. | 06:59 | |
encodings used now in the West fall into two groups | |||
the "legacy" SBCS encodings are now defined as a 1:1 map between Unicode character numbers and bytes | |||
TimToady | non-linear for anything not ISO-8859-1ish | 07:00 | |
and the UTFs | 07:01 | ||
which presume to represent any valid Unicode codepoint | |||
albeit by different schemes | |||
lue | I can't help but wonder why Unicode stopped at such a seemingly arbitrary number, 0x10FFFF | 07:02 | |
TimToady | UTF-32 is a fixed-width scheme | ||
sorear | that's the other group of encodings used now | ||
TimToady | they figgered 16 planes were enough | ||
sorear | the Unicode-based encodings | ||
the Unicode-based encodings are defined as a simple mathematical translation of the codepoint numbers | 07:03 | ||
TimToady | UTF-16 was original viewed as fixed width before they invented surrogates to represent chars above ffff | ||
but it's really variable width | |||
UTF-8 is anabashedly variable width | |||
*un | |||
sorear | the simplest Unicode-based encoding is the one I showed you earlier - UTF32 | ||
moritz_ | good morning | ||
TimToady | o/ | ||
lue | good morning moritz_ o/ | ||
TimToady | UTF-32 is more or less equivalent to UCS-4 | 07:04 | |
and UCS-2 was equivalent to UTF-16 before they invented surrogates | |||
lue can't wait to see what happens to Unicode when we discover sentient aliens as advanced as us... *muhahahaha* | |||
TimToady | UCS-1, if it existed, would more or less be Latin-1 | ||
sorear | I think merging our character set standards will be the least of our worries when that happens | 07:05 | |
TimToady | mostly the western world is moving almost exclusively to UTF-8 for interchange of data | ||
in the east there tends to be a preference for UTF-16 because it is more compact for east asian characters | 07:06 | ||
(where they use Unicode at all; many continue to use Big-5 or ISO-2022 or whatever their original non-unicode character set was) | 07:07 | ||
ingy | how do I subst "x/y/z" into "x/y"? | 07:08 | |
sorear | the common east asian characters in Unicode are assigned around 4000-8000, the rare ones are assigned above 10000 | ||
TimToady | see the perl5 encode module for much more on this subject | ||
ingy | sorear: the bareword 'this' seemed to cause silent errors... | 07:09 | |
sorear | ingy: it's spelled self in perl6 | ||
TimToady: does an East Asian think of 一 as U+4E00 or as a codepoint in their native set? | |||
(independant of how they encode it) | |||
ingy | sorear: I know that. But I was using a $this.foo and forgot the $ and it got no compile or runtime errors | 07:10 | |
TimToady | they think of it as a character they learned in school, and don't much give a rip about the other :) | ||
std: this.foo | |||
ingy | sorear: so I assumed 'this' meant something | ||
p6eval | std 31611: OUTPUT«===SORRY!===Undeclared routine: 'this' used at line 1Check failedFAILED 00:01 110m» | ||
TimToady | rakudo: this.foo | ||
p6eval | rakudo 692aa1: OUTPUT«Could not find sub &this in main program body at line 20:/tmp/Pdi9pnukUK» | ||
ingy | *shrug* | ||
IT HAPPENED! | |||
:) | 07:11 | ||
TimToady | were you trapping run-time errors? | ||
rakudo doesn't catch undef routines at compile time like std does | |||
ingy | maybe | ||
I have no ida what I'm trapping most of the time | |||
:) | |||
00:08 <@ingy> how do I subst "x/y/z" into "x/y"? | 07:12 | ||
:] | |||
TimToady | same way you would in Perl 5, but quote the / | ||
moritz_ | rakudo: say 'foo x/y/z bla'.subst('x/y/z', 'x/y') | ||
sorear | I need a better way to type stuff like 一 | ||
p6eval | rakudo 692aa1: OUTPUT«foo x/y bla» | ||
sorear | that's control-shift-4E00 :/ | 07:13 | |
lue | well, my biggest concern now is how you can implement new encoding standards (like UTF-32) in P6, and use them for Buf and IO | ||
sorear | unfortunately I've yet to find an input method with documentation in English | ||
moritz_ | sorear: compose - - ? | ||
lue | an em dash? — | ||
ingy | rakudo: say "x/y/z".subst(/(.*)\/.*/, $0) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
sorear | moritz_: that's not a dash, that's the CJK character for one | ||
TimToady | I can just type CTRL-space ichi | ||
sorear | I can't read Japanese at a software manuals level | 07:14 | |
TimToady: what do I need to install to make that work? | |||
moritz_ | ingy: if you want to use any match variables on the RHS of a subst, you need to use a closure, which gets $/ as the first positional parameter | ||
rakudo: say "x/y/z".subst(/(.*)\/.*/, -> $/ { $0 }) | |||
TimToady | 一 is not software manual level; it's first grade. :) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | 07:15 | |
moritz_ | huh | ||
sorear | TimToady: the documentation for installing input methods is well above a first-grade level | ||
moritz_ | rakudo: say "x/y/z".subst(/(.*)\/.*/, -> $/ { 'WTF' }) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
moritz_ | rakudo: say "x/y/z".subst(rx/(.*)\/.*/, -> $/ { 'WTF' }) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
sorear | the only input method I've successfully installed is compose key handling for «, and that took months of shotgun debugging | ||
TimToady | I use anthy | ||
moritz_ | rakudo: say "x/y/z".subst(rx/(<-[/]>*)\/.*/, -> $/ { 'WTF' }) | 07:16 | |
p6eval | rakudo 692aa1: OUTPUT«WTF» | ||
lue | I use IBus with anthy, then I type CTRL Space - Enter | ||
moritz_ | rakudo: say "x/y/z".subst(rx/(<-[/]>*)\/.*/, -> $/ { $0 }) | ||
p6eval | rakudo 692aa1: OUTPUT«x» | ||
moritz_ | backtracking into captures | ||
ingy | GO moritz_!!! | ||
:) | |||
sorear | TimToady: urxvt good enough or do I also need a better terminal? | ||
TimToady | nokloo | 07:17 | |
ingy | I'm just trying to get the dir part of a pathname... | ||
TimToady | I just use gnome term | ||
lue | is there some sort of magic role or something to make your encoding usable with IO and such? | ||
TimToady | mostly you have to make sure LANG=en_US.UTF-8 | 07:18 | |
then most things work right | |||
ingy | rakudo: say "x/y/z".subst(/(.*)/.*/, -> $/ { $0 }) | 07:19 | |
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 20» | ||
ingy | rakudo: say "x/y/z".subst(/(.*)[/].*/, -> $/ { $0 }) | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 20» | ||
TimToady | [] isn't character class in p6 | ||
use '/' | |||
ingy | rakudo: say "x/y/z".subst(/(.*)<[/]>.*/, -> $/ { $0 }) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
ingy | rakudo: say "x/y/z".subst(/(.*)<before />.*/, -> $/ { $0 }) | 07:20 | |
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===regex assertion not terminated by angle bracket at line 20, near " />.*/, ->"» | ||
moritz_ | it's backtracking into captures that's NYI and causes trouble | ||
ingy | rakudo: say "x/y/z".subst(/(.*)<before </>>.*/, -> $/ { $0 }) | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===regex assertion not terminated by angle bracket at line 20, near " </>>.*/, "» | ||
07:21
xinming left
|
|||
ingy | rakudo: say "x/y/z".subst(/(.*)<before [/]>.*/, -> $/ { $0 }) | 07:21 | |
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===regex assertion not terminated by angle bracket at line 20, near " [/]>.*/, "» | ||
TimToady | pmichaud was gonna fix backtracking into things pretty soon | ||
lue | .oO(the spec doesn't seem to say anything about creating new encodings...) |
||
TimToady | the spec wants to believe that every can live happily with unicode :) | ||
*everyone | 07:22 | ||
sorear | lue: create a new encoding and thousands of people will swear to kill you. | ||
ingy | so how can I get the dirpath from a unix filepath? | ||
sorear | don't do it. | ||
ingy | :) | ||
tmtowtdi, I'm sure | |||
TimToady | rindex :) | 07:23 | |
07:23
xinming joined
|
|||
TimToady | rakudo: say "x/y/z".subst(/(.*)'/'.*/, { $0 }) | 07:24 | |
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
TimToady | rakudo: say "x/y/z".subst(/(.*)'/'.*/, -> $/ { $0 }) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
lue | TimToady: weeeell, one test relies on ISO-8859-1 to work right. | ||
(t/spec/S16-filehandles/io.t) | 07:25 | ||
ingy | rakudo: say "x/y/z".subst(/(.*)'/'.*/, -> $/ { 'WTF' }) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
TimToady | rakudo: say "x/y/z".subst(/(.*)'/'.*/, 'foo') | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
lue | goodnight o/ | ||
TimToady | \o | 07:26 | |
rcsheets` | what is that last character inside p6eval's angle quotes? it renders as a thin box for me. | ||
TimToady | rakudo: say "x/y/z".subst(/^(.*)'/'.*$/, 'foo') | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
TimToady | newline | 07:27 | |
.u  | |||
phenny | U+2424 SYMBOL FOR NEWLINE () | ||
rcsheets` | ah, ok. thanks. | ||
ingy | rakudo: $f = "x/y/file"; say $f.substr(0, $f.rindex('/')) | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Symbol '$f' not predeclared in <anonymous> (/tmp/qNbvoUISVZ:20)» | ||
TimToady | most terminals it's an N over L | ||
ingy | rakudo: my $f = "x/y/file"; say $f.substr(0, $f.rindex('/')) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y» | ||
ingy | :) | ||
rcsheets` | i assume it's just the font i'm using | 07:28 | |
TimToady | rakudo: say "x/y/z".match(/^.* <?before '/'>/) | 07:29 | |
p6eval | rakudo 692aa1: OUTPUT«x/y» | ||
TimToady | rcsheets`: could well be a font issue | ||
sorear | installing anthy and uim-anthy and restarting X did nothing. | ||
I need docs for this, and not ones written in Japanese | 07:30 | ||
ctrl-space ichi -> "ichi" | |||
TimToady | what kind of machine? | ||
sorear | PC, debian sid | 07:31 | |
sorear tries installing gnome-terminal | |||
07:32
tedv left
|
|||
TimToady | you might need to tell it that ctrl-space is what turns it on somehow | 07:32 | |
it might be bound to a different seq by default | 07:33 | ||
or you might need to speak to whatever manages your input methods and enable anthy in it | |||
or it could be your term | |||
historically some systems have been loathe to believe that anyone in US_en would want east asian keybindings | 07:34 | ||
but that has improved in the last couple years | |||
er, en_US | 07:35 | ||
*loath | |||
07:35
skids left
|
|||
sorear | I think I need to install something to manage my input methods | 07:35 | |
I don't currently have anything fitting that description | |||
TimToady | scim or ibus, ibus being the newest | ||
ibus is current default on ubuntu | 07:36 | ||
ingy | rakudo: $*PROGRAM_NAME | ||
p6eval | rakudo 692aa1: ( no output ) | ||
ingy | rakudo: say $*PROGRAM_NAME | ||
p6eval | rakudo 692aa1: OUTPUT«/tmp/827m47pFcy» | ||
ingy | rakudo: say $*PROGRAM_NAME.rindex('/') | ||
p6eval | rakudo 692aa1: ( no output ) | 07:37 | |
TimToady | rakudo: say $*PROGRAM_NAME.WHAT | ||
p6eval | rakudo 692aa1: OUTPUT«Str()» | ||
sorear installs ibus, ibus-gtk, ibus-anthy | |||
ingy | I get unimplemented unicode in 'Cool::rindex' at line 2220:CORE.setting | 07:38 | |
sorear | apparently I now need to upgrade libc6, gcc, and python | ||
ingy | rakudo: say $*PROGRAM_NAME.rindex('/') | ||
p6eval | rakudo 692aa1: ( no output ) | ||
07:39
skids joined
|
|||
TimToady | rakudo: say rindex('/',$*PROGRAM_NAME).perl | 07:39 | |
ingy | rakudo: my $p = $*PROGRAM_NAME; say $p.rindex('/') | ||
p6eval | rakudo 692aa1: ( no output ) | 07:40 | |
ingy | rakudo: my $p = $*PROGRAM_NAME.Str; say $p.rindex('/') | ||
TimToady | timing out maybe | ||
p6eval | rakudo 692aa1: ( no output ) | ||
TimToady | rakudo: say rindex('/',$*PROGRAM_NAME).WHAT | ||
ingy | rakudo: say "OK" | ||
p6eval | rakudo 692aa1: ( no output ) | ||
rakudo 692aa1: OUTPUT«OK» | |||
TimToady | Cross-charset index not supported in 'Cool::rindex' at line 2212:CORE.setting in main program body at line 1:foo | 07:41 | |
sorear wonders if he should uninstall uim and xim | 07:42 | ||
TimToady | so some kind of bug that p6eval is deigning not to report | 07:43 | |
sorear | p6eval doesn't report errors recently | ||
07:43
ashleydev left
|
|||
TimToady | I don't think you should need to, as long as you aren't giving old env vars | 07:43 | |
sorear | I think it's part of moritz_ 's information suppression campaign | ||
TimToady | I've got: XMODIFIERS=@im=ibus | 07:44 | |
ingy | TimToady: is $*PROGRAM_NAME not a string? | ||
TimToady | rakudo: say '/'.PARROT | ||
p6eval | rakudo 692aa1: OUTPUT«Str» | ||
TimToady | rakudo: say $*PROGRAM_NAME.PARROT | ||
p6eval | rakudo 692aa1: OUTPUT«String» | ||
ingy | Str vs String? | ||
rakudo: say $*PROGRAM_NAME.Str.PARROT | 07:45 | ||
p6eval | rakudo 692aa1: OUTPUT«String» | ||
TimToady | rakudo: my $s = $*PROGRAM_NAME ~ ''; say $s.rindex('/') | ||
p6eval | rakudo 692aa1: ( no output ) | ||
TimToady | looks like a leaky parrot | 07:46 | |
ingy | rakudo: my $s = ~$*PROGRAM_NAME; say $s.rindex('/') | ||
p6eval | rakudo 692aa1: ( no output ) | ||
07:47
xinming left
|
|||
sorear | perl: warning: Setting locale failed. | 07:48 | |
TimToady | rakudo: say ($*PROGRAM_NAME ~ "").rindex('/') | ||
sorear | D: | ||
p6eval | rakudo 692aa1: ( no output ) | ||
TimToady | do you have the utf8 locales installed? | ||
locale -a should tell you | 07:49 | ||
sorear | I have en_US.utf8 | 07:50 | |
TimToady | and LANG=en_US.UTF-8 is what I use | ||
though, oddly, local -a lists it as .utf8 | 07:51 | ||
probably normalizes | |||
sorear | $LANG is .utf8 here | ||
TimToady | possibly Perl wants the UTF-8 form | ||
sorear | perl -e '' doesn't carp after apt-get returned | ||
TimToady | I dunno | ||
sorear | do I need to poke perl harder to get it to locale carp? | ||
ingy | rakudo: say "x/y/z".subst(/^.* <?before '/'>/, '') | ||
p6eval | rakudo 692aa1: OUTPUT«/z» | 07:52 | |
ingy | rakudo: say "x/y/z".subst(/^(.*) <?before '/'> .*/, -> $/ { $0 }) | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
ingy | :'( | 07:53 | |
TimToady | subst is supposed to set $/ in the outer scope so that the closure sees it without passing it as a param | ||
but I don't think rakudo does that right yet | |||
rakudo: my $p = "x/y/z"; $p ~~ s/(.*) '/'/$0/; say $p | 07:54 | ||
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
07:55
skangas left
|
|||
TimToady | rakudo: my $p = "x/y/z"; $p ~~ s/(.*) '/' .*/$0/; say $p | 07:55 | |
p6eval | rakudo 692aa1: OUTPUT«x/y/z» | ||
TimToady | rakudo: my $p = "x/y/z"; $p ~~ s/.* <( '/' .* )>//; say $p | 07:56 | |
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Confused at line 20, near "$p ~~ s/.*"» | ||
TimToady | rakudo: my $p = "x/y/z"; $p ~~ s/.* '/'//; say $p | 07:57 | |
p6eval | rakudo 692aa1: OUTPUT«z» | ||
TimToady | rakudo: my $p = "x/y/z"; $p ~~ s/$<foo>=[.*] '/' .*/$<foo>/; say $p | 07:58 | |
p6eval | rakudo 692aa1: OUTPUT«Any()» | ||
sorear | according to pstree, ibus-daemon is now running | 07:59 | |
ingy | rakudo: my $f = "x/y/file"; while $f ~~ s/<! '/'>$// {}; say $f | ||
TimToady | rakudo: my $p = "x/y/z"; my $foo; $p ~~ s/$foo=[.*] '/' .*/$foo/; say $p | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Confused at line 20, near "while $f ~"» | ||
rakudo 692aa1: OUTPUT«===SORRY!===Confused at line 20, near "$p ~~ s/$f"» | |||
TimToady | maybe you should just use split :) | ||
sorear | TimToady: pastie.org/1038636 - do you see anything obviously wrong here? | 08:00 | |
ingy | rakudo: my $f = "x/y/file"; while ($f ~~ s/<! '/'>$//) {}; say $f | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 20» | ||
sorear | it's still not working after despite ibus running | ||
hmm | |||
maybe I need to configure ibus to use anthy somehow. | |||
TimToady | I seem to recall someone (ingy?) having trouble with have all the other LC_* set | 08:01 | |
that cleared up after setting only LANG | |||
I get a little ibus gidget in the top bar | 08:02 | ||
ingy | rakudo: my $f = "x/y/file"; export LANG="en_US.UTF-8" | ||
export LANG="en_US.UTF-8" | |||
p6eval | rakudo 692aa1: OUTPUT«Could not find sub &LANG in main program body at line 20:/tmp/OSx9lm_7yu» | ||
TimToady | with a little picture of a world in front of a keyboard | 08:03 | |
that lets you configure ibus | |||
ingy | rakudo: my $f = "x/y/file"; my $a = $f.split('/').pop; say $a.perl | ||
p6eval | rakudo 692aa1: OUTPUT«"file"» | ||
sorear | my computer isn't powerful enough for a top bar | ||
I had to disable it | |||
ingy | rakudo: my $f = "x/y/file"; my $a = $f.split('/'); say $a.perl | ||
p6eval | rakudo 692aa1: OUTPUT«("x", "y", "file")» | ||
ingy | rakudo: my $f = "x/y/file"; my $a = $f.split('/'); $a.pop; say $a.perl | ||
p6eval | rakudo 692aa1: OUTPUT«("x", "y")» | 08:04 | |
ingy | rakudo: my $f = "x/y/file"; my $a = $f.split('/'); $a.pop; say $a.join('/') | ||
TimToady | rakudo: my $f = "x/y/file"; say $f.flip.subst(/.*?'/'/, '').flip | ||
p6eval | rakudo 692aa1: OUTPUT«x/y» | ||
sorear | hmm. this 'ibus-setup' thing looks promisng | ||
一! | 08:05 | ||
sorear dances | |||
ingy | rakudo: say "abc".flip | ||
p6eval | rakudo 692aa1: OUTPUT«cba» | ||
TimToady | すごい! | ||
ingy | TimToady++ | 08:06 | |
TimToady | in p6 we differentiate .reverse from .flip | ||
.reverse is only for lists | |||
sorear | hey, ibus-setup even lets me disable control-space | 08:10 | |
sorear switches IM activation to a key combo he hits less often by accident | |||
TimToady | yeah, I have that problem too... | ||
sorear | TimToady++ | ||
ingy | I _finally_ have TestML really working now. Starting to pass the TestML test suite... | 08:16 | |
p6/rakudo is a huge PITA. | |||
but you all are great to work with! | 08:17 | ||
sorear | How, exactly, do you test a test harness | ||
drbean | sorear: 恭喜! 恭喜! | ||
moritz_ | sorear: like everything else: you put in example input, and monitor the response | 08:18 | |
ingy | sorear: TestML is not a harness | ||
08:18
TiMBuS joined
|
|||
ingy | it's a programming language neutral way to write unit tests, that works under any existing harness | 08:18 | |
sorear | drbean: that doesn't look like any of the 15 hanzi I know | 08:19 | |
TimToady | 恭喜發財 恭喜发财 [gong1 xi3 fa1 cai2] /congratulations for getting rich (traditional Chinese New Year's future use/ | 08:20 | |
sorear | what did that come from? | ||
08:20
azert0x left
|
|||
TimToady | originally, cedict | 08:21 | |
sorear | originally? | ||
TimToady | well, I've had it since 2004 or so, so who knows what it is now... | 08:22 | |
my mouth keeps flopping open, so I'd better flop over soon on purpose before I flop over accidentally | 08:26 | ||
zzz & | |||
08:28
Ross joined
|
|||
sorear | perl6: say class { &?BLOCK.leave(2); } # Opinions? | 08:43 | |
p6eval | rakudo 692aa1: OUTPUT«Could not find sub &?BLOCK in main program body at line 20:/tmp/lna2SdHXlV» | ||
..pugs: OUTPUT«*** No such subroutine: "&class" at /tmp/vAdP1UyJjg line 1, column 5 - line 2, column 0» | |||
sorear | pugs: say class :: { &?BLOCK.leave(2); } | 08:44 | |
p6eval | pugs: OUTPUT«***  Unexpected " {" expecting "(", twigil or word character at /tmp/dzaSDMqFDH line 1, column 13» | ||
sorear | pugs: say anon class { &?BLOCK.leave(2); } | ||
p6eval | pugs: OUTPUT«*** No such subroutine: "&anon" at /tmp/O5Yf7aEIG1 line 1, column 5 - line 2, column 0» | ||
dalek | ecza: 9ddeaf8 | sorear++ | (3 files): A few steps towards class declarations |
08:54 | |
09:02
gfldex joined
09:10
pmurias joined,
Ross left
09:17
Ross joined
09:39
PZt joined
09:40
quietdev joined
|
|||
sorear | results of today's walk: | 09:54 | |
- niecza is going to implement modules using a blatant rip of the .NET assemblies mechanism, which I will then convince TimToady to write into the spec | |||
- precompilation of individual modules only really needs to be supported for the cases where whole program static compilation is possible | 09:55 | ||
- STD.pm6 tangles static analysis too much; the module system, setting loader, trait system should be factored out to an $*ACTIONS-like contextually bound pair | 09:56 | ||
- $STD::ALL could usefully be refactored, perhaps by only storing the roots of compilation units which are referenced by use, or something like that. OUTER is problematic, doubly so because of P5's circular reference stupidity | 09:58 | ||
sorear out. | 10:02 | ||
10:38
eiro joined,
eiro left
10:58
redicaps1 joined
11:00
redicaps1 left
11:16
sftp joined
11:25
M_o_C joined
11:28
Kejohm joined
11:32
Kejohm left
11:35
s1n left
|
|||
cognominal | rakudo: say ?1..2 | 11:39 | |
p6eval | rakudo 692aa1: | ||
..OUTPUT«111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111… | |||
moritz_ | wtf? | 11:44 | |
cognominal | masaked | ||
11:45
Ross left,
Ross joined
|
|||
cognominal | #76442 | 11:45 | |
moritz_ | rakudo: say Bool::True..2 | 11:46 | |
jnthn | rakudo: say ?(1..2) | ||
p6eval | rakudo 692aa1: | ||
..OUTPUT«111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111… | |||
rakudo 692aa1: OUTPUT«1» | |||
jnthn | oh | ||
Bool.succ on true is identity. | |||
11:46
eiro joined,
eiro left
|
|||
moritz_ | right | 11:46 | |
jnthn | I bet that's what causes it. | 11:47 | |
cognominal | I think Range should be a parametric role so as to force the two arguments to be of the same type. | ||
not sure of the details though | |||
moritz_ | or at least if one endpoint is numeric, coerce the other ot numeric | 11:48 | |
cognominal | it makes no sense to have extremty of a range to have different types. | 11:49 | |
I think my example should fail. | 11:50 | ||
jnthn | moritz_: That makes sense, yes | 11:52 | |
11:57
pragma_ left
11:58
M_o_C left
12:01
pmurias left
12:05
pragma_ joined
12:06
pragma_ is now known as Guest38594
12:09
kid51 joined
12:25
ilogger2 joined
12:30
SmokeMachine joined
12:31
rv2733 joined,
SmokeMachine left
12:32
SmokeMachine joined
12:37
takadonet joined
|
|||
takadonet | morning all | 12:38 | |
13:04
SmokeMachine left
13:10
SmokeMachine joined
13:13
takadonet left
13:16
SmokeMachine left
13:40
tylercurtis joined
13:41
TiMBuS joined
13:44
masak joined
|
|||
masak | #perl6! \o/ | 13:44 | |
jnthn | #masak! \o/ | 13:45 | |
masak | rakudo: say (my $a) = 1,2,3; say $a # discovered by TimToady++ | ||
p6eval | rakudo 692aa1: OUTPUT«Any()» | ||
masak | did it ever get reported? | ||
jnthn | masak: Now i'm awake-ish.. | 13:46 | |
rakudo: say ((my $a) = 1,2,3); | |||
p6eval | rakudo 692aa1: OUTPUT«1 2 3» | ||
jnthn | rakudo: (say (my $a)) = 1,2,3; | ||
p6eval | rakudo 692aa1: OUTPUT«Any()» | 13:47 | |
masak | ah. | ||
jnthn | It's only a bug if it's not meant to have parsed as the second of those. | ||
masak asks viv | |||
13:53
mulander joined
|
|||
masak | viv puts the 'say' outermost. gist.github.com/470719 | 13:54 | |
masak submits rakudobug | |||
jnthn | masak++ | 14:04 | |
moritz_ | masak++ # ufo | 14:11 | |
masak | moritz_++ # p6eval yapsi target | ||
moritz_ | masak: I haven't cron-jobbed the rebuild yet | 14:12 | |
masak | no worries. I'm not hacking on it right now. | ||
might be later today, though. :) eager to set my teeth in the new runtime. | |||
moritz_ just made Tufte compile | 14:13 | ||
14:13
azert0x joined,
azert0x left,
pmurias joined
|
|||
moritz_ | and I realized I don't understand enough ruby to continue porting scruffy | 14:14 | |
14:23
azert0x joined,
azert0x left
|
|||
masak | Austrian Airlines and I seem to have just agreed on some nice, cheap YAPC::EU flight tickets for me. :) | 14:27 | |
moritz_ | you use an Australian airline to fly from Sweden to Italy? sweet :-) | ||
masak | er, no :) | 14:28 | |
has anyone else investigated trains from Bologna to Pisa? | 14:29 | ||
jnthn | Austria is the one without Kangaroos | 14:30 | |
masak: Yes | |||
masak: I'll be doing that. | |||
masak | me too. on the Monday. | ||
jnthn | When? | 14:31 | |
masak | I'll be arriving in Bologna 19:15 on 2010-08-02. | ||
jnthn | Ah, OK | ||
Waaaay later than me. | |||
masak | ok. | ||
jnthn | (Like, 7 hours later.) | 14:32 | |
Anyway, probably it's a case of connecting in Florence. | |||
Though there may be some direct trains too. | |||
14:33
timbunce joined
|
|||
masak | jnthn: does one pre-book trains, or just buy them JIT? | 14:33 | |
14:33
azert0x joined,
azert0x left
|
|||
jnthn | masak: I plan to buy them on the day. | 14:33 | |
masak: I did that kinda thing when in Italy before now. | 14:34 | ||
Worked out. | |||
masak | you plan to buy them afk, and not thourhg the intertubes? | ||
*through | |||
jnthn | Probably | ||
I'm not sure what options for buying them over the Intertubes are for Italy | |||
I think I looked into it when doing vacation in Italy previously, and ended up not doing so. | 14:35 | ||
masak | ok. | ||
14:35
azert0x joined
14:36
azert0x left,
azert0x joined
|
|||
masak | "No subsets of Ada are allowed. Babbage is just the opposite. None of Babbage is defined except its extensibility - each user must define his own version. To end the debate of large languages versus small, Babbage allows each user to make the language any size he wants. Babbage is the ideal language for the "me" generation." -- www.tlc-systems.com/babbage.htm | 14:37 | |
that sounds a bit like Perl 6, actually :) | 14:38 | ||
moritz_ | it sounds a bit more extremist than Perl 6 | ||
(which is a large language by default) | |||
masak | I guess it is. | ||
or it's a small language with a default large language slapped on. | |||
*lol* -- the calling convention is "call by telephone" :P | 14:39 | ||
"This is especially effective for long-distance parameter passing." | |||
moritz_ | masak: I'm hacking a bit on SVG.pm... currently SVG.serialize takes a single positional argument | 14:44 | |
masak: which makes it a bit awkward to pass pairs to it | 14:45 | ||
SVG.serialize((:x[])) | |||
masak | moritz_: hm. yes. | ||
moritz_ | masak: mind if I magically accept a single, named param instead? | ||
masak | no. | ||
please go ahead. | |||
moritz_ | I'm also writing tests for it :-) | 14:46 | |
masak | moritz_++ | ||
moritz_ | with the background of refactoring later | ||
masak | sounds good. | ||
14:47
patspam joined
|
|||
masak | sorear, lue: when I was 15, I was also toying with the idea of writing an OS. :-P | 14:48 | |
tylercurtis | masak: You should. I cannot wait to see the release announcements for that. :) | 14:53 | |
TimToady | ranges are not always the same type on both sides. see 1..* | 14:54 | |
After Christmas it should be our goal to make Perl 6 fast enough that we can write an OS in it...and then *not* write an OS in it. :) | 14:57 | ||
14:57
skids joined
15:00
oha joined
|
|||
moritz_ | sounds boring :-) | 15:00 | |
rakudo: say .Int.perl for True, False | 15:01 | ||
p6eval | rakudo 692aa1: OUTPUT«Bool::TrueBool::False» | ||
moritz_ | uhm. | ||
masak: wanna submit? :-) | |||
TimToady | rakudo: say .Numeric.perl for True, False | 15:02 | |
p6eval | rakudo 692aa1: OUTPUT«10» | ||
TimToady | but I suspec .Int should do that too | ||
rakudo: say True ~~ Int | |||
masak ubsmits | |||
p6eval | rakudo 692aa1: OUTPUT«0» | ||
moritz_ | rakudo: sub f($t?) { say defined($t).Int }; f("a" => 3) | ||
masak | er, *submits | 15:03 | |
p6eval | rakudo 692aa1: ( no output ) | ||
moritz_ | gives "Method 'Int' not found for invocant of class 'Pair'" locally | ||
which is wrong too, no? | |||
is defined() parsed specially? | |||
ingy | morning | 15:04 | |
masak | moritz_: no. | ||
moritz_ | so another bug? | ||
masak | let me confirm locally. | ||
ingy just discovered that .WHICH is not really unique. | |||
TimToady | rakudo: say defined("a" => 3).WHAT | ||
p6eval | rakudo 692aa1: OUTPUT«0» | ||
masak | moritz_: I get the same. | ||
masak submits rakudobug | |||
moritz_ | rakudo: say 1 xor 1 | 15:05 | |
p6eval | rakudo 692aa1: OUTPUT«1» | ||
moritz_ | huh. | ||
ingy | rakudo: my $h = {}; my $n = $h.WHICH; say $h.WHICH; say $n.WHICH; | ||
p6eval | rakudo 692aa1: OUTPUT«3540921635409216» | ||
TimToady | rakudo say (1 xor 1) | ||
rakudo: say (1 xor 1) | |||
p6eval | rakudo 692aa1: OUTPUT«» | ||
moritz_ | ingy: that'a known problem, .WHICH should include type information | 15:06 | |
masak | that's right, right? | ||
ingy | I think it would be better to add a '.' or something to the beginning of scalars' WHICH | ||
masak | the 'say 1 xor 1' thing. | ||
moritz_ | masak: yes, looser precedence than I thought | 15:07 | |
ingy | moritz_: no, I think WHICH should just be unique | ||
masak | moritz_: makes sense that it's the same as 'or', though. | ||
TimToady | S02:583 | ||
moritz_ | ingy: which it would be achieve with type info, yes | ||
TimToady | rakudo is not up to spec there | ||
ingy | adding a '.' would also, moritz_ | ||
and simpler | |||
:) | |||
masak | rakudo: sub f($t?) { say defined($t).WHAT }; f("a" => 3) | 15:08 | |
moritz_ | ingy: the old spec said that for value objects (Str, Int, Num etc.) .WHICH == $_ | ||
p6eval | rakudo 692aa1: OUTPUT«0» | ||
masak | o.O | ||
ingy | moritz_: and I agree with that | ||
moritz_ | ingy: then a dot doesn't help | ||
ingy | moritz_: oh? | ||
moritz_: example? | |||
moritz_ | unless you do it only for non-value objects | ||
TimToady | S02:583 !!! | 15:09 | |
masak | hugme: hug TimToady | ||
hugme hugs TimToady | |||
moritz_ | TimToady: you may be the language designer, but we're still free to ignore you :-) | ||
ingy | TimToady: to whom do you speak? | ||
masak | rakudo: sub f($t?) { say defined($t).WHAT }; f() | ||
p6eval | rakudo 692aa1: OUTPUT«0» | ||
diakopter winks awake | |||
masak | rakudo: sub f($t?) { say defined($t).Int }; f() | 15:10 | |
p6eval | rakudo 692aa1: ( no output ) | ||
TimToady | ingy: when I cite the spec in the middle of a conversation, it means the spec already discusses this, and it might have some bearing on the conversation, unless you're moritz_++ :) | 15:11 | |
masak | I like the exception clause to that. | 15:12 | |
ingy | moritz_: ''.WHICH -> '.'; '.'.WHICH' -> '..'; $h.WHICH.WHICH -> '.35409216' | ||
TimToady: except you were in the middle of 3 conversations | |||
:) | |||
diakopter | std: S02:583 !!! | ||
p6eval | std 31611: OUTPUT«===SORRY!===Confused at /tmp/v1zB_w_eZb line 1:------> S02:⏏583 !!! expecting any of: coloncircumfix signatureUndeclared name: 'S02' used at line 1Parse failedFAILED 00:01 108m» | ||
ingy | TimToady: and my reponse to your blurt would then be, "url?". | 15:13 | |
ingy just woke up on the grumpy side of the bed | 15:14 | ||
moritz_ | irc.pugscode.org | ||
masak | ingy: just go to the IRC logs, and it'll be a link. | ||
moritz_ | which turns S02:583 into an URL | ||
ingy | o neat! | 15:15 | |
15:15
oha left
|
|||
moritz_ | ingy: we've spent a long time optimizing those autolinking features :-) | 15:15 | |
masak | moritz_++ # again | 15:16 | |
diakopter | rakudo: say ?|0?|0 | ||
p6eval | rakudo 692aa1: OUTPUT«1» | ||
diakopter | rakudo: say ?|0!?|0 | 15:17 | |
p6eval | rakudo 692aa1: OUTPUT«0» | ||
ingy | moritz_++ | 15:18 | |
masak | afk & | 15:19 | |
15:19
masak left
|
|||
ingy | TimToady: so... I'm glad that S02:583 mentions YAML, because I was just starting to write a YAML dumper for p6 when I came across the WHICH issue. For YAML's purposes, adding a '.' to the start of scalars (and using the current numbers for objects) would probably work just great. | 15:21 | |
TimToady: that's akin to a scheme I use for p5... | |||
then again, I'm not too awfully concerned about the collisions for now :) | 15:22 | ||
bbi2-3h... | 15:23 | ||
TimToady thinks "fractional addresses..." | |||
15:28
ashleydev joined
|
|||
moritz_ | phenny: tell masak that I've pushed some fairly substantial changes to SVG, making it use methods internally instead of subs. My plan would be to rename it to XML::Writer or so, and then start a new SVG.pm, which automatically promotes some attributes into :style<...>, and optionally adds an SVG header | 15:31 | |
phenny | moritz_: I'll pass that on when masak is around. | ||
15:33
asig2 joined
15:40
asig2 left
15:48
ashleydev left
|
|||
timbunce | What's the best way to represent exportable constants in a role? | 16:05 | |
TimToady | std: my constant pi is export = 3; # won't work in rakudo though | 16:13 | |
p6eval | std 31611: OUTPUT«ok 00:01 112m» | ||
TimToady | or possibly | ||
std: has constant pi is export = 3; | |||
p6eval | std 31611: OUTPUT«ok 00:01 109m» | 16:14 | |
TimToady | constant is supposed to be 'our' by default | ||
rakudo: my constant pi = 3; | |||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Malformed my at line 20, near "constant p"» | ||
diakopter | std: constant pi is export = 3; | 16:15 | |
TimToady | but rakudo is still parsing it as a scope declarator rather than a sub declarator | ||
p6eval | std 31611: OUTPUT«ok 00:01 109m» | ||
timbunce | TimToady: thanks. What's a workable approach for rakudo meanwhile? | ||
moritz_ wonders if enums are exported | |||
TimToady | rakudo: role Foo { constant pi = 3 }; say Foo::pi | ||
p6eval | rakudo 692aa1: OUTPUT«Can not find sub Foo::pi in main program body at line 1» | 16:16 | |
moritz_ | rakudo: role Foo { our $pi = 3 }; say $Foo::pi | ||
p6eval | rakudo 692aa1: OUTPUT«Null PMC access in type() in main program body at line 20:/tmp/M57BNs8HR2» | ||
moritz_ | rakudo: module Foo { our $pi = 3 }; say $Foo::pi | ||
p6eval | rakudo 692aa1: OUTPUT«3» | ||
moritz_ | feijl | ||
moritz_ submits rakudobug | |||
timbunce | moritz_: yeah, that'll do. thanks | ||
16:17
TiMBuS left
|
|||
jnthn | moritz_: fwiw, I'm not sure how to make that one work. | 16:17 | |
our scoped stuff in roles doesn't make too much sense or at least needs some more thought | 16:18 | ||
TimToady | rakudo: role Foo { our $pi = 3 }; class F does Foo {}; say $F.pi | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Symbol '$F' not predeclared in <anonymous> (/tmp/6oAiHlFE7w:20)» | ||
TimToady | rakudo: role Foo { our $pi = 3 }; class F does Foo {}; say $F::pi | ||
p6eval | rakudo 692aa1: OUTPUT«Null PMC access in type() in main program body at line 20:/tmp/WzM6KtH3Vy» | ||
jnthn | TimToady: heh, that's not going to work for sure | ||
moritz_ | jnthn: maybe by punning the role into a class of the same name? | 16:19 | |
TimToady | rakudo: role Foo { our $pi = 3 }; Foo.new; say $Foo::pi | ||
p6eval | rakudo 692aa1: ( no output ) | ||
TimToady | kaboom? | ||
jnthn | TimToady: er | 16:20 | |
timbunce thinks I'll generate methods for now and wait for the dust to settle... | |||
jnthn | TimToady: Why would the meta-object for a role know about about an our-scoped variable in the role body? | ||
16:20
justatheory joined
|
|||
jnthn | *know anything about | 16:20 | |
diakopter | moritz_: we could make p6eval output the "killed..." message I think | ||
TimToady | std: has constant $.pi = 3; | ||
moritz_ | diakopter: +1 if you know how to do it | ||
p6eval | std 31611: OUTPUT«ok 00:01 110m» | ||
diakopter | heh | ||
jnthn | TimToady: Anyway, for it to work at all we probably need to say that creating a concrete role creates a package along side it, then we'd need to get the concrete form of the role and .WHO it to get the package and lookup in that. | 16:21 | |
16:21
skangas joined
|
|||
jnthn | Since it could easily have been role Foo[$x] { our $y = $x; } | 16:21 | |
TimToady | twoo | 16:22 | |
jnthn | In general, anything our-scoped inside a role is horribly awkward. | ||
TimToady | well, perhaps the generic role has a canonical longname by which its package is named | 16:23 | |
moritz_ | I'm trying to port some Ruby code to Perl 6, and... URKS. @points.extend Scruffy::Helpers::PointContainer unless @points.kind_of? Scruffy::Helpers::PointContainer | ||
jnthn | TimToady: That doesn't address it so much though | ||
TimToady | actually, the canonical name of Foo[$x] is just Foo, but Foo[Int] is the longname, I guess :) | 16:24 | |
jnthn | TimToady: Because it's about instantiations of the role rather than the "role" itself (where a role as it appears in the program is really specifying a role factory that may produce many roles). | ||
TimToady | so Foo:: is the package of the role factory, but ::('Foo[Int]'):: or some such is the package of the instant | 16:25 | |
*instance | |||
lue | y oh hai o/ | ||
TimToady | except, of course, Foo:: doesn't work terribly well for a multi-role | 16:26 | |
jnthn | All roles are multi-roles in a sense | 16:28 | |
TimToady | rakudo: role Foo[Int] { method x { say 1 } }; role Foo[Num] { method x { say 1.414 } }; class X does Foo[Int] {}; X.new.x | ||
p6eval | rakudo 692aa1: ( no output ) | ||
TimToady | shouldn't that work? | ||
heh, Could not find sub &say | 16:29 | ||
jnthn | > role Foo[Int] { method x { 1 } }; role Foo[Num] { method x { 1.414 } }; class | ||
X does Foo[Int] {}; say X.new.x | |||
1 | |||
Yes, it's a lexical chain bug with roles | |||
pmurias | TimToady: how should i go about adding the Perl6:: prefix to packages in STD? | 16:30 | |
jnthn | I hoped pmichaud++'s fixes would help, but sadly not. :-( | ||
TimToady | rakudo: role Foo[Int] { method x { 1.say } }; role Foo[Num] { method x { 1.414.say } }; class X does Foo[Int] {}; X.new.x | ||
p6eval | rakudo 692aa1: OUTPUT«1» | ||
TimToady | rakudo: role Foo[Int] { method x { 1.say } }; role Foo[Num] { method x { 1.414.say } }; class X does Foo[Num] {}; X.new.x | ||
p6eval | rakudo 692aa1: OUTPUT«1.414» | ||
jnthn | Anyway, role Foo { } is really taken to be role Foo[] { } | 16:32 | |
That is, a role that takes no type parameters. | |||
16:35
silug joined
|
|||
TimToady | pmurias: I thought you said you weren't changing STD | 16:39 | |
pmurias | did I? | 16:41 | |
TimToady | or maybe sorear++ indicated that | 16:42 | |
just packaging it in Perl6:: for CPAN | |||
pmurias | I created an installable src/STD-dist | 16:43 | |
TimToady | which, up till now has been a namespace for flakey emulations of Perl 6 | ||
which STD arguably is pretty flakey :) | |||
pmurias | it's has some minor changes needed to specify search locations for some things and make one bug workaround work | ||
moritz_ | pmurias: if you give me a link to a document that describes how to install and run mildew, I can try to fix up the mildew: evalbot target | ||
pmurias | moritz_: that would be great | 16:44 | |
TimToady | anyway, my intent is that someday when Perl 6 is real, STD be a real top-level package for any language derived from STD | 16:45 | |
pmurias | TimToady: i want to add an Perl6:: prefix to stuff so that the dist can be place on CPAN | ||
TimToady | yes, well, that's kinda CPAN's problem | ||
pmurias | * placed | ||
moritz_ | pmurias: you can also prevent it from being indexed by appropriate entries in the META.yaml file | 16:46 | |
pmurias | moritz_: it's intended that mildew will be installed with cpanm Mildew | 16:47 | |
TimToady | if Perl 6 folks can't create new top-level package names without getting the agreement of CPANfolk, then I've got a problem with that. | ||
pmurias | i don't think CPANfolk would complain if dist built from STD-dist was uploaded on cpan | 16:48 | |
but in it's current form it would create a lot of top-level package names | 16:49 | ||
and i'm not sure we want to use things like DEBUG and Stash | |||
TimToady | maybe we need real namespaces (and I don't mean packages in the parrot sense) | 16:50 | |
pmurias | moritz_: dzill --install-command 'cpanm .' in src/STD-dist,v6/Mildew,v6/SMOP,v6/Mildew-Setting should install mildew | ||
moritz_ | pmurias: why not just no-index all files in the STD distribution, add an (indexed) .pod file explaining what it's all about, and be happy? | 16:51 | |
TimToady | and I'd rather prefix all those types with STD:: than Perl6::, I think | ||
it would be nice to have a namespace prefix mechanism that would make GLOBAL:: really mean GLOBAL::STD:: or some such, maybe | 16:52 | ||
needs more thinking...but I hate ::-itis | |||
pmurias | moritz_: if you don't want to use Dist::Zilla i could supply a bunch of tarball | 16:53 | |
* tarballs | |||
moritz_ | pmurias: I'm installing dist::zilla now... shouldn't be a problem | 16:54 | |
TimToady | and STD is called STD because it's not just for STD::P6, but also for STD::P5, STD::Ruby, STD::Python, STD::APL, etc | 16:56 | |
pmurias | STD::P5 would be very handy for p5 users | 16:57 | |
TimToady | it's half written already | ||
ran out of tuits | |||
moritz_ | p5 users have PPI, no? | ||
TimToady | PPI, at least historically, tended to have no understanding of what the code actually means | ||
moritz_ | like me :-) | 16:58 | |
TimToady | p6 needs a p5 parser so it can at least find the end of the { use v5; ... } block | 16:59 | |
pmurias | and PPI is not extensible | ||
TimToady | and perhaps also run the block some day | ||
pmurias | TimToady: wouldn't it be possible to harness the perl5 parser for that? | 17:00 | |
TimToady | std: rx:P5/[a-z]/ | 17:01 | |
p6eval | std 31611: OUTPUT«ok 00:01 125m» | ||
17:01
patspam left,
patspam1 joined,
patspam1 is now known as patspam
|
|||
TimToady | it uses that subset of it already | 17:01 | |
std: rx/[a-z]/ | 17:03 | ||
p6eval | std 31611: OUTPUT«===SORRY!===Invalid regex metacharacter (must be quoted to match literally) at /tmp/KcnLZdfvEt line 1:------> rx/[a-⏏z]/Potential difficulties: [a-z] appears to be an old-school character class; please use <[a..z]> if you mean a character | ||
..c… | |||
pmurias | moritz_: if you encounter any problems with installing Mildew mention them to me | 17:04 | |
TimToady | pmurias: not easily, unless you teach the perl5 parser to treat an unmatched } as an EOF | ||
moritz_ | pmurias: just a question... can I easily install it into a location that's not the system perl, so that I can wipe it again easily? | ||
pmurias | local::lib | 17:05 | |
moritz_ | I feared that answer | ||
pmurias | that's what i use | ||
moritz_ | I use it too | ||
pmurias | moritz_: what's the problem with that? | ||
moritz_ | which is the problem | ||
I want to have a location for my modules | |||
and a separate for mildew modules | |||
so that I can wipe mildew stuff without wiping mine | |||
pmurias | i see | ||
cpanm has and -l option for specifing which local::lib directory to install to | 17:06 | ||
moritz_: do you think that will work? | 17:08 | ||
moritz_ | I'm trying it... | 17:09 | |
Unrecognized command: --install-command. | |||
pmurias | dzill install --install-command? | 17:10 | |
moritz_ | right, just arrived at the same conclusion | ||
pmurias | * dzil | ||
moritz_ | huh. | 17:12 | |
# Failed test 'use STD;' | |||
# at t/use_ok.t line 4. | |||
# Tried to use 'STD'. | |||
# Error: Can't locate File/ShareDir.pm in @INC | |||
cpan[1]> install File::ShareDir | 17:13 | ||
Going to read '/root/.cpan-5.12.1/Metadata' Database was generated on Fri, 09 Jul 2010 23:27:09 GMT | |||
File::ShareDir is up to date (1.02). | |||
pmurias: I have to leave now to buy some food before the stores close, will try again later or tomorrow | |||
pmurias | moritz_: ok | 17:14 | |
moritz_: fixed | 17:17 | ||
pugssvn | r31612 | pmurias++ | [STD-dist] add a missing prereq noticed by mortiz++ | ||
17:20
ashleydev joined
17:21
tedv joined
|
|||
pugssvn | r31613 | lwall++ | [specs] add C<also> declarator to prefix any trait to be applied to the outer declaration | 17:21 | |
r31613 | this lets us say "also is Int" without the 'is' conflicting with Test's is function | |||
r31613 | and it's extensible as new trait_mods are added | |||
pmurias | moritz_: you don't have File::ShareDir? | ||
moritz_ | pmurias: I have | 17:22 | |
pmurias | and the tests don't find it? | 17:23 | |
moritz_ | pmurias: it's just... I have two perls, and currently no idea if dzil and cpanm pick up the right one | ||
anyway, right now it's happily installing a huge dependency tree | |||
pmurias | looking at the @INC should clear some things up | ||
moritz_ | which works for me as long as no action on my part is required :-) | 17:24 | |
pmurias | that's the intended installation experience ;) | 17:25 | |
moritz_ | it's a piece of irony that I need DateTime::TimeZone even though none of the code works with time zones | ||
but Params-Validate requires it, it seems | 17:26 | ||
pmurias | you are still at STD-dist? | ||
moritz_ | no, mildew | ||
STD-dist was easy, because STD ran on the evalbot server previously | |||
pmurias | mildew has a lot of dependencies | 17:27 | |
moritz_: so you decided to postpone shopping? | |||
moritz_ | pmurias: my girlfriend decided for me :/ | 17:28 | |
still 32min left :-) | |||
17:34
Mowah joined
|
|||
pmurias | moritz_: how's the installation going? | 17:39 | |
pugssvn | r31614 | lwall++ | [basic.t] s/does/also does/ in the one spot that uses it | 17:41 | |
17:52
Mowah left
17:55
sftp joined
18:00
paroxyzm joined
|
|||
lue | rakudo: my Buf @a = 1,2,3; @a[3] = 4; say @a; say @a.WHAT | 18:00 | |
p6eval | rakudo 692aa1: ( no output ) | ||
lue | > my Buf @a = 1,2,3; @a[3] = 4; say @a; say @a.WHAT | 18:04 | |
maximum recursion depth exceeded | |||
TimToady | that's an array *of* Buf | 18:05 | |
not an array of Int | |||
lue | oh. I was under the impression that Buf was a type of array. | 18:06 | |
arnsholt | Then you want my Buf $a | ||
TimToady | putting the type in front gives the type of each individual element | ||
which works for $a because there's only one | 18:07 | ||
paroxyzm | Hi! Im interested in perl6 regexes.. i found that article: perlgeek.de/en/article/5-to-6#post_19 and it says : 'aaaa' ~~ m/ a | aaa | aa /; | ||
lue | rakudo: my Buf $a = 1,2,3; say $a | ||
p6eval | rakudo 692aa1: ( no output ) | 18:08 | |
paroxyzm | On my pc the return value is 'a' not 'aaa' | ||
lue | rakudo: say I_AM_A_FAILURE; # seems like p6eval isn't returning errors | 18:09 | |
p6eval | rakudo 692aa1: OUTPUT«Could not find sub &I_AM_A_FAILURE in main program body at line 20:/tmp/fVRVwEgqHV» | ||
lue | rakudo: say 'aaaa' ~~ m/ a | aaa | aa / | 18:12 | |
p6eval | rakudo 692aa1: OUTPUT«a» | ||
tylercurtis | Does Rakudo have LTM? | ||
lue | yes (IIRC), but it's quite clearly broken there :) | ||
moritz_ | only for constant prefixes of proto regexes | 18:13 | |
paroxyzm | What was the meaning of that output? | ||
moritz_ | pmurias: ! Bailing out the installation for Mildew-0.01. Retry with --prompt or --force. | ||
[DZ] [DZ] error running {{["cpanm -L /home/p6eval/mildew-install ."]}} at /usr/local/lib/perl/5.10.0/Moose/Meta/Method/Delegation.pm line 108 | |||
lue | paroxyzm: that post is from 2008. I get the feeling things have changed since then. [as they frequently do in P6] | 18:15 | |
moritz_ | paroxyzm: it's supposed to output 'aaa' | 18:16 | |
just not yet implemented yet | |||
paroxyzm | lue: Thanks :) | ||
moritz_ | lue: I try to keep those posts up-to-date | ||
if you find something where it differs from current spec, please let me know | |||
TimToady | LTM is implemented in STD but not in rakudo | 18:17 | |
moritz_ | and as I pointed out at the top of the page, I described spec status, not "is" status | ||
jnthn | TimToady: A while back you mentioned stuff about native types and part of it was Num.REPR. I've been working out how to slot this into my mental model of Perl 6...and slowly succeeding. But is the implication here that given a type, we can know its representation? | ||
lue | paroxyzm: I forgot to mention that sometimes it's the implementation's fault. :) | ||
jnthn | TimToady: That is, what happens if I go and Int.CREATE(:repr('P6Hash'))? | 18:18 | |
TimToady: But the real reason I'm asking this in a sense is that I've been struggling with fast attribute access in combination with not knowing the underlying representation. | |||
paroxyzm | lue: So what is the best implementation for regexes? | 18:19 | |
lue: anyway p6 will be big if those regexes are to become truth ;) | |||
TimToady | jnthn: if it's P6opaque, the repr can be anything you like, since it's opaque | ||
jnthn | TimToady: That is, knowing that the type is Dog, if we can Dog.CREATE(:repr<anything>), actually tells us nothing we can rely on at runtime. | ||
And that means we hit real problems when trying to emit something more optimal than two names. | 18:20 | ||
(the class and the attribute name) | |||
lue | paroxyzm: I can't say for sure, I'm a 'newb' myself :) | ||
jnthn | Or so far as I can see anyway. | ||
I guess what I'm asking for is the REPR to be choosable by type. | 18:21 | ||
paroxyzm | lue: oh | ||
18:21
justatheory left
|
|||
jnthn | So you commit to "this type will have this REPR" at class composition time. | 18:21 | |
18:21
rcsheets` left
|
|||
jnthn | But not by instance. | 18:21 | |
18:21
rcsheets` joined
18:23
paroxyzm left
|
|||
TimToady | you probably need to get the opinion of one of the other folks who have worked with Responder Interfaces, like ruoso++ or nothingmuch++ | 18:23 | |
jnthn | Aye | ||
TimToady | possibly Dog with an alternative RI is just a different type somehow that doesn't pessimize what Dog is by default | 18:24 | |
18:24
rcsheets` left
|
|||
TimToady | using a different RI might just be a matter of mixing in a different .HOW | 18:24 | |
but I'm not the expert on anything hiding behind .HOW | 18:25 | ||
TimToady has no knowhow | |||
jnthn | :-) | ||
My problem isn't the existence of different representations. | 18:26 | ||
It's more that not being able to know by type what representation I have. | 18:27 | ||
The end result being that either everything is pessimal (too slow) or everything but P6opaque and a bunch of RIs for e.g. int, num etc are pessimal. | 18:28 | ||
Which is OK for now but sucks for the guy who implements another REPR some day and then finds that the mechanism that is used to make P6opaque fast is useless. | 18:29 | ||
(e.g. useless for his representation) | |||
TimToady | well, people who invent reprs had better know how to make them fast them own selves | 18:30 | |
jnthn | Part of it is a code-gen thing though | ||
TimToady | I don't see how you can borrow much from something called "opaque" | ||
it's opaque so we can cheat | 18:31 | ||
if someone looks inside, they'll discover we're cheating :) | |||
but there might be some value in declaring a default repr for a class | 18:32 | ||
and we can even say "you can't override it" for now | |||
jnthn | Imagine we're code-generating an attribute lookup. We're in a single inheritance situation, so in theory we can do all attribute lookups by an offset into the object - eg. fast fast fast. We'd really like at compile time to go and say to the REPR "OK, I'm emitting a look for $!foo in class Bar, please give me a 'hint' that I can also emit in the code, if possible, and I'll give that back to you when we try and retreive the attribute at runtime" | 18:33 | |
Now, in an MI situation or we get augmenting going on and so on, it'll come back and say "sorry dave, I can't do that" | |||
But in situations where it's possible, the REPR could give back something interesting. | 18:34 | ||
If we can't make some assumption about the underlying REPR from the type object, then we either (a) can't do these things or (b) have to tag every hint with "oh and I got the hint from this REPR and if that ain't you, you'd best ignore it and just use the names" | 18:35 | ||
Taht is, we can lazily pessimize, but it seems like it'll cost us a little to have the ability to do so. | 18:36 | ||
TimToady | such a type is, in essence, a native type in the sense that the repr is closed, though the class could add methods | ||
and non-final, in that you can add more offsets under SI | 18:37 | ||
18:37
timbunce left
|
|||
TimToady | rather than lazily pessimizing, I'd rather take the sum of what we know at CHECK time to know which reprs we can lock down | 18:37 | |
jnthn | My point is that | ||
sub foo(Dog $x) { ... } | 18:38 | ||
The type constraint Dog isn't a constraint on the REPR that could be passed in | |||
Unless we associate a single REPR with a type. | |||
TimToady | I think we should drive the repr choice to be just sufficiently declarative to know whether we can optimize at CHECK time | 18:39 | |
jnthn | OK | ||
TimToady | much like most of our other optimizations that you can choose to pessimize if you declare you want to | ||
class Dog is repr(*) or some such | |||
otherwise default is repr(P6opaque) | 18:40 | ||
would that be good enough? | |||
tylercurtis | rakudo: subset Odd of Int where * % 2; my Odd $i = 6; say 'Shouldn't happen.' | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Confused at line 20, near "say 'Shoul"» | ||
jnthn | TimToady: Yes :-) | ||
tylercurtis | rakudo: subset Odd of Int where * % 2; my Odd $i = 6; say 'Shouldn\'t happen.' | ||
18:40
timbunce joined
|
|||
jnthn | TimToady: Thanks. :-) | 18:40 | |
p6eval | rakudo 692aa1: ( no output ) | ||
TimToady | and .bless(:repr) is illegal unless declared is repr(*) | 18:41 | |
jnthn | :-) | ||
Excellent, that helps a lot. | |||
TimToady | we aim to blaze | ||
jnthn | Yes, I've been spending a lot of time recently thinking about that. | ||
jnthn decides to switch focus on enjoying the world cup match for a bit :-) | 18:42 | ||
TimToady | "we aim to breeze" would rhyme better | ||
lue | rakudo: role Thing { ... }; role Stuff does Thing { method a { say 'a' } }; role Thing does Stuff { method b { say 'b' } }; Thing.a | 18:45 | |
p6eval | rakudo 692aa1: ( no output ) | ||
TimToady | .new maybe? | 18:46 | |
lue | well, the error is actually maximum recursion depth exceeded :) | 18:47 | |
rakudo: role Thing { ... }; role Stuff does Thing { method a { say 'a' } }; role Thing does Stuff { method b { say 'b' } }; Thing.new.a | |||
p6eval | rakudo 692aa1: ( no output ) | ||
lue | I'm surprised it doesn't error when A does B and B does A. It's only when I start trying to use it. | 18:49 | |
TimToady | it wouldn't compose until .new forces it to compose a class, I imagine | ||
lue | It could be a wonderful collage of evil if it worked, though :) | 18:50 | |
TimToady | and roles ignore up doeses | ||
s/up/dup | |||
a 'does' on a role merely says, "Be sure you invite my friends along too." | 18:51 | ||
tylercurtis | rakudo: role Thing { ... }; role Stuff does Thing { method a { say 'a' } }; role Thing does Stuff { method b { say 'b' } }; class ActualThing does Stuff { }; ActualThing.new.a | 18:52 | |
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===maximum recursion depth exceeded» | ||
TimToady | well, perhaps that's not how rakudo does it :) | 18:53 | |
jnthn: ^^ | |||
lue | that's the first time an error came up in p6eval today! \o/ | 18:54 | |
pmichaud | good morning, #perl6 | 18:55 | |
lue | (maybe 'does' should be smart enough not to invite itself) | ||
guten tag, pmichaud o/ | |||
pmichaud | picasaweb.google.com/lh/photo/XQe71...directlink # view from my balcony :-) | ||
18:57
hercynium joined
|
|||
lue | ooh! aah! | 18:57 | |
[ I like the part Picasa put under the picture: "Sign in to like this photo" :) ] | |||
the first P6 pun ever: m/smart/ # well, the core of the pun, anyway | 19:00 | ||
TimToady | is that Maui I see? | ||
pmichaud | It is Maui, yes. :-) | 19:01 | |
TimToady | every island smells a little different | 19:02 | |
pmichaud | my son says it smells like popcorn here | 19:04 | |
TimToady | the big island usually smells of sulfur :) | ||
19:05
cono joined
19:08
aubreyja_ joined
|
|||
sorear | good * #perl6 | 19:09 | |
pmurias | hi | ||
moritz_: could you nopaste ~/.cpanm/build.log? | 19:10 | ||
19:14
aubreyja_ left
19:17
ashleydev left
|
|||
sorear | jnthn: talk to me about reprs | 19:19 | |
jnthn: 'Dog' looks like a class but it's really treated as a role | 19:24 | ||
so what I'm planning to do for the general case is to pass a Dog-vtable | 19:25 | ||
with functions for calling all Dog methods, and indexes for all Dog slots | |||
or rather, accessors | |||
19:26
aubreyja joined
|
|||
sorear | also, I'm going to extend the Dog|U notation | 19:26 | |
Dog|U - protoobject repr | 19:27 | ||
Dog|D - standard object repr | |||
Dog|<name> - named repr | |||
the autospecializer will, among other things, generate |D forms of methods | |||
19:32
mtk joined
|
|||
lue | afk | 19:46 | |
19:48
kensanata joined,
eternaleye joined
|
|||
cognominal | what is the way to ask a parametric rôle that the parameter C<does> some other role? | 20:01 | |
role MyRole[T does U] # something like that | |||
I think that Range should be something like role Range[T does TotalOrder] { ... } ; role TotalOrder[U] { method succ() --> U { ... } ... } | 20:05 | ||
20:10
masak joined
|
|||
masak | ahoy! | 20:10 | |
phenny | masak: 15:31Z <moritz_> tell masak that I've pushed some fairly substantial changes to SVG, making it use methods internally instead of subs. My plan would be to rename it to XML::Writer or so, and then start a new SVG.pm, which automatically promotes some attributes into :style<...>, and optionally adds an SVG header | ||
masak renames it now, lest he forget | 20:11 | ||
tylercurtis | masak: Bennu is about to have an actual runtime that makes the build process even more hellish. :) | 20:12 | |
yapsi: my $a; say $a; | |||
p6eval | yapsi: OUTPUT«Any()» | 20:13 | |
tylercurtis | On the plus side, that will soon work. :) | ||
masak | I feel I lack context. what/who's Bennu? | ||
and which hellish build process are we talking about? | 20:14 | ||
20:14
Trashlord joined
|
|||
masak | moritz_: ping | 20:15 | |
tylercurtis | masak: My very early-stage Perl 6 to LLVM compiler that uses SIC. The build process of compiling code using it. | 20:17 | |
masak | oh, right! | ||
sorry, I forgot its name. | |||
tylercurtis: you should add it to the poc-projects.list file in the pls branch of proto. | |||
20:18
mtk left,
jferrero joined
20:19
mtk joined
|
|||
tylercurtis | Now, not only do you need yapsi, old rakudo, recent rakudo, and LLVM, you also need GNU libtool at /usr/local/bin/libtool(because I was too lazy to deal with the problem of OS X's libtool at /usr/bin(which is earlier in my path) being weird). :) | 20:20 | |
masak: Will do, once I finish pushing these changes. | |||
masak | \o/ | 20:21 | |
20:21
mtk is now known as mtk_
|
|||
masak | exciting times. I never dreamed of SIC compiling to LLVM. | 20:21 | |
20:21
mtk_ is now known as mtk
|
|||
moritz_ | masak: pong | 20:22 | |
masak | moritz_: since I pinged, I concluded that the reason ufo wasn't working was because I broke it. nevermind. :) | 20:23 | |
it's fixed now. | |||
moritz_ | speaking of exciting times | ||
Germany 3 -- 2 Urugay | |||
masak | congratulations. | ||
football, right? :P | 20:24 | ||
moritz_ | right :-) | ||
masak .oO( nailed it ) | |||
20:25
kfo joined,
jferrero left
|
|||
jnthn | cognominal: role MyRole[::T where U] { ... } probably works | 20:27 | |
moritz_ | pmurias: ah, found the problem: CHI won't install | 20:28 | |
Couldn't load class (CHI::Driver) because: Invalid version format (dotted-decimal versions require at least three parts) at /usr/lib/perl/5.10/version.pm line 194. | |||
jnthn | TimToady: Well, thing is that in role R1 { method m { } }; role R2 { method m { } }; role R3 does R1 does R2 { method m { } }, iiuc we'd like that to eliminate the methods from R1 and R2. | 20:29 | |
So it's not just as simple as a completely flat "and add these too" if we wnat this to work. | 20:30 | ||
If that can fail and we get a conflict when we compose R3 into a class, well, fine, but I suspect that's not what's wanted. | |||
pmichaud: Nice photo! | |||
20:31
aubreyja left
|
|||
masak | moritz_: I don't like BEGIN { @*INC.push: 'lib', '../lib' }; | 20:31 | |
moritz_: and with ufo, it's not needed. | |||
moritz_ | masak: feel free to remove | ||
masak removes | |||
20:32
ashleydev joined
|
|||
moritz_ | CHI versions 0.34 and 0.35 fail with the same error message | 20:32 | |
tylercurtis | masak: would you prefer a pull request or a patch? | 20:33 | |
masak | tylercurtis: you're saying you don't have commit access? | ||
:) | |||
moritz_ | this feels like it could be easy to fix... | 20:34 | |
masak | tylercurtis: what's your name on github? | ||
tylercurtis | masak: ekiru | ||
masak | tylercurtis: welcome aboard. | ||
tylercurtis: just push to poc-projects.list on the pls branch. | 20:35 | ||
tylercurtis | masak: done. | 20:36 | |
masak | tylercurtis: ...and you got the comma on the line before. :) tylercurtis++ | ||
json-- | |||
moritz_: rename complete. | 20:40 | ||
tylercurtis | masak: Does JSON support an extra comma? | 20:41 | |
moritz_ | no :( | ||
masak | hence the -- | ||
moritz_: could you also add yourself to AUTHORS in xml-writer? | |||
moritz_ | javascript does, but a brain-dead browser does not | ||
masak: yes... and rename it in hugme | 20:42 | ||
wait, the other way round :-) | |||
masak | ...and change the url in .git/config :) | ||
moritz_ | currently I don't have commit access | ||
masak | oh? | ||
moritz_ stupid | |||
ignore me | |||
masak does so | 20:43 | ||
moritz_ | lib/XML/Writer.pir | 2123 +++++++++++++++++++++++++++++++++++++++++ | ||
doen't look like you need to ship it | |||
lue | ohai o/ | 20:44 | |
moritz_ | oh, svg wasn't on hugme | ||
masak kills off the .pir file | 20:45 | ||
moritz_ faster | |||
masak | :) | ||
indeed. | |||
lue | rakudo: my $a = Buf.new('N', 'E', 'S', 0x1A); say $a | 20:46 | |
p6eval | rakudo 692aa1: ( no output ) | ||
masak | lue: Buf.new takes a list of integers. | ||
actually, right now it takes an array of integers. | 20:47 | ||
that's likely to change. | |||
tylercurtis | rakudo: my $a = Buf.new([1,2,3,4,5]); say $a | ||
p6eval | rakudo 692aa1: ( no output ) | ||
moritz_ | rakudo: $*OUT.write: Buf.new([:16<6d>, :16<c3>, :16<70>]) | 20:48 | |
masak | tylercurtis: locally, that says "Buf()<0x10c9161e0>" | ||
p6eval | rakudo 692aa1: ( no output ) | ||
jnthn | masak: Oh? | ||
masak: Relying on slurpy laziness in Buf? | |||
masak | jnthn: yes. pmichaud suggested it should be like it was from the beginning. | 20:49 | |
jnthn: hold on, I'll dig up the blog post. | |||
jnthn: use.perl.org/~masak/journal/40422 | |||
last paragraph. | |||
moritz_ | masak: I think allowing named arguments to XML::Writer.serialize was a bad idea | 20:50 | |
jnthn | oh | ||
masak | moritz_: ok. | ||
jnthn | Well consistency is a good point, but my point was also good. :-) | ||
moritz_ | masak: because now I want to subclass it, and find myself duplicating the arugment extraction logic | ||
jnthn | masak: Maybe you want an alternative constructor. | ||
masak | jnthn: pmichaud had a counter-point against yours. do read the logs. | 20:51 | |
20:51
patspam left
|
|||
masak | moritz_: sometimes I feel the whole way named arguments and pairs rub against each other is "wrong". but it's been a long time now since I wrote code that made me feel that. | 20:52 | |
jnthn | masak: OK, iirc, in encode you get a byte-buffer? | ||
masak | yes. | ||
jnthn | oh wtf | 20:53 | |
you're not doing at all what I thought | |||
masak | get a fresh bytebuffer, assign the string to it, and iterate over its bytes. | ||
jnthn | OK | ||
...yes, that's exactly what I wanted us to avoid. | |||
masak | ok. | ||
I haven't realized that till now. | 20:54 | ||
jnthn | ByteBuffer is capable of being index into positionally and keeps a reference to the original string. | ||
Meaning that .encode doesn't allocate a load of new storage | |||
If the Buf just references a ByteBuffer | |||
Yes that's not the _only_ case. | |||
masak | hm, that is indeed nicer. | 20:55 | |
jnthn | But I'd have thought it was a common enough one to make sure we avoid copying. | ||
masak | but it'll cease to work as soon as the Buf is treated as an array. | ||
yes, I agree that it's a common case, and worth optimizing for. | |||
jnthn | Oh | ||
has T @.contents; | 20:56 | ||
Hmm | |||
Ok, leave it as it is for now I guess | |||
This is going to be hard to get right until we have compact arrays. | |||
Or hard to get right and efficient. | |||
And working trumps fast and wrong. | |||
But just a heads up that we should re-visit this in the future to avoid so much copying. | 20:57 | ||
(Looking at it more, it's not quite trivial.) | |||
masak | aye. | 20:58 | |
jnthn | our multi sub infix:<eqv>(Buf $a, Buf $b) { return $a.contents ~~ $b.contents; | ||
} | |||
Naybe use eqv in there? | 20:59 | ||
masak | does it matter? | ||
moritz_ | seems more robust with eqv | ||
masak | oki, changing. | ||
moritz_ | if you have a Buf[Any], and one of the entries is a * | ||
20:59
kensanata left
|
|||
jnthn | moritz_: Right. | 20:59 | |
masak | good point. | ||
21:01
dju joined
21:02
timbunce left
|
|||
lue | rakudo: my $a = Buf.new([0x4E, 0x45, 0x53]); say $a.decode | 21:02 | |
p6eval | rakudo 692aa1: ( no output ) | 21:03 | |
21:03
dju left,
dju joined
|
|||
lue | > my $a = Buf.new([0x4E, 0x45, 0x53]); say $a.decode | 21:03 | |
NES | |||
masak | \o/ | 21:06 | |
that's about what the tests do, too. | |||
jnthn: did you find pmichaud's objection that speed might not be an issue after all for slurpies? | 21:07 | ||
21:08
timbunce joined
|
|||
moritz_ | github.com/moritz/svg | 21:11 | |
dalek | kudo: 7579f7a | masak++ | src/core/Buf.pm: [Buf] infix:<eqv> for Bufs now uses eqv internally |
||
jnthn | masak: In the long run maybe it won't be | 21:14 | |
The trouble is that | is not always too smart at the moment. | |||
But if you avoid that you're fine. | |||
masak | I see two use cases. | 21:15 | |
Buf.new(byte, byte, byte) | |||
and Str.encode($encoding) | |||
21:16
whiteknight joined
|
|||
masak | the latter might have to use | if we only allow the slurpy constructor. | 21:16 | |
21:16
tadzik joined
|
|||
moritz_ | why not allow both constructrs, as multis? | 21:16 | |
masak | moritz_: that's a possibility. | ||
moritz_: it falls, I believe, under pmichaud's "API based on Rakudo's current characteristics" | 21:17 | ||
which may or may not be considered a disadvantage. | |||
jnthn | masak: But if you have a slurpy constructor and you pass an array, it'll get flattened into the slurpy | ||
masak | oh. | ||
even if you provide both, as moritz_ suggests? | 21:18 | ||
jnthn | rakudo: sub foo(*@x) { say @x.elems }; my @a = 1,2,3; foo(@a); | ||
p6eval | rakudo 692aa1: OUTPUT«3» | ||
moritz_ | rakudo: multi f(@a) { }; multi f(*@a) { }; f(my @a = (1, 2, 3)) | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Redeclaration of symbol @a at line 20, near " = (1, 2, "» | ||
jnthn | huh | ||
moritz_ | doesn't look like a redeclaration to me | ||
rakudo: multi f(@a) { }; multi f(*@a) { }; f(my @x = (1, 2, 3)) | |||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Redeclaration of symbol @x at line 20, near " = (1, 2, "» | 21:19 | |
moritz_ | rakudo: multi f(@a) { }; multi f(*@a) { }; my @x = (1, 2, 3); f(@x) | ||
p6eval | rakudo 692aa1: ( no output ) | ||
jnthn | moritz_: You could do that | ||
er | |||
ingy | greetings | ||
jnthn | masak ^^ | ||
masak: But just the slurpy one and don't | the thing going in should be efficient today | |||
o/ ingy | 21:20 | ||
ingy | \o jnthn | ||
masak | moritz_: rakudobug? | ||
moritz_ | masak: yes | 21:21 | |
masak | jnthn: then it sounds to me I should change back to the just the slurpy. | ||
masak submits rakudobug | |||
jnthn | masak: Aye | 21:22 | |
masak: For consistency too | |||
masak: We can optimize further later. | 21:23 | ||
jnthn afk for a bit | |||
21:23
araujo joined
21:24
araujo left,
araujo joined
|
|||
sorear | When do the executable statements in the body of a class { } run? | 21:24 | |
moritz_ is pretty sure that's in S12 somewhere | |||
lue | any reason why Buf -> Str is decode(), and Str -> Buf is encode()? That seems backwards to me [ not that it matters at all, just wondering ] | ||
masak | rakudo: multi f(@a) { }; multi f(*@a) { }; my @x; f(@x = (1, 2, 3)) | 21:25 | |
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 20» | ||
masak | o.O | ||
moritz_ | rakudo: multi f(@a) { }; my @x; f(@x = (1, 2, 3)) | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 20» | 21:26 | |
moritz_ | std: multi f(@a) { }; my @x; f(@x = (1, 2, 3)) | ||
p6eval | std 31614: OUTPUT«ok 00:01 117m» | ||
masak | rakudo: multi f(*@a) { }; f(my @x = (1, 2, 3)) | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Redeclaration of symbol @x at line 20, near " = (1, 2, "» | ||
masak | rakudo: multi f(@a) { }; f(my @x = (1, 2, 3)) | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Redeclaration of symbol @x at line 20, near " = (1, 2, "» | ||
21:26
whiteknight left
21:27
takadonet joined
|
|||
takadonet | hey everyone | 21:27 | |
moritz_ | o/ | ||
rakudo: f(my @x = (1, 2, 3)) | |||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Redeclaration of symbol @x at line 20, near " = (1, 2, "» | ||
moritz_ | rakudo: f(my @x) | ||
p6eval | rakudo 692aa1: OUTPUT«Could not find sub &f in main program body at line 20:/tmp/Z7mIzm_qJb» | ||
masak | moritz_++ | 21:29 | |
so it has nothing to do with multis, only with the assignment in the argument list. | |||
rakudo: f(my $x = (1, 2, 3)) | 21:30 | ||
p6eval | rakudo 692aa1: OUTPUT«Could not find sub &f in main program body at line 20:/tmp/mFoG7yiTUW» | ||
moritz_ | list assignment :-) | ||
masak | rakudo: f(my %x = (1, 2, 3)) | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Redeclaration of symbol %x at line 20, near " = (1, 2, "» | ||
takadonet | for loop are not lazy yet correct? | ||
in conjunction with a gather/take | 21:31 | ||
moritz_ | they are, to some extend | ||
rakudo: for 1..* {.say; last } | |||
takadonet | i.e: my @matches = gather for $/<fasta> -> $m {take $m.ast;} | ||
p6eval | rakudo 692aa1: OUTPUT«1» | ||
21:32
silug left
|
|||
takadonet | could be something else then that is making it eager | 21:32 | |
moritz_ | takadonet: that' easier written as my @matches = $<fasta>.map: { *.ast } | ||
takadonet: and do use a current development version of rakudo - in the last release, array assignment was still eager | |||
takadonet | moritz_: I'm always using the newest development version! :) | 21:34 | |
moritz_ | takadonet: great :-) | ||
takadonet | moritz_: code fails if I changed to using a map :( | 21:35 | |
moritz_ | weird | 21:36 | |
takadonet | Really could be the way I written it | 21:37 | |
21:41
whiteknight joined
|
|||
masak goes home to sleep | 21:42 | ||
thought I would get some Yapsi runtime hacking done today, but there wasn't enough consequtive thinking time. | |||
ah well, maybe tomorrow. | |||
'night. | |||
lue | goodnight masak o/ | ||
21:42
masak left
|
|||
pmurias | moritz_: the CHI dependency is not esential | 21:46 | |
lue | rakudo: role B { has $.var = 3 }; class A does B { method z { say $.var;} }; A.z | ||
21:46
kloeri left
|
|||
p6eval | rakudo 692aa1: ( no output ) | 21:46 | |
sorear | lue: a byte sequence for text is useless except to store and transmit, so we call it encoded | 21:47 | |
decoding the bytes produces characters, which can be processed in many more ways | |||
21:47
kloeri joined
|
|||
pmurias | moritz_: any other solutions forthe CHI problem other than making Mildew stop using it? | 21:48 | |
lue | ah, ok. | ||
sorear | CHI? | ||
pmurias | sorear: i use it for caching the parse | 21:49 | |
sorear: it's a CPAN module | 21:50 | ||
moritz_: if you comment the dependency out in dist.ini mildew will work just fine (with the default frontend) | 21:51 | ||
21:52
mtk left,
kloeri left
|
|||
lue | for class A does B why can I not access variables in B through A? | 21:54 | |
(or, more accurately, attributes) | |||
21:56
takadonet left
|
|||
tylercurtis | rakudo: role B { has $.foo is rw; }; class A does B {}; my $a = A.new; A.foo = 'foo'; A.foo.say; | 21:56 | |
p6eval | rakudo 692aa1: OUTPUT«Type objects are abstract and have no attributes, but you tried to access $!foo in main program body at line 70» | ||
tylercurtis | rakudo: role B { has $.foo is rw; }; class A does B {}; my $a = A.new; $a.WHAT.say; $a.defined.say; | 21:57 | |
p6eval | rakudo 692aa1: OUTPUT«A()1» | ||
tylercurtis | Hmm... I don't know. | 21:58 | |
lue | rakudo: role B { has $.foo is rw = 3; }; class A does B { method z { say $.foo } }; A.z | ||
p6eval | rakudo 692aa1: ( no output ) | ||
21:59
kloeri joined
22:03
hsb joined
|
|||
lue | rakudo: role B { has $.foo is rw = 3; }; class A does B { method z { say B.foo } }; A.z | 22:04 | |
p6eval | rakudo 692aa1: ( no output ) | ||
lue | can Someone Who Knows Why™ explain why I'm not allowed to access B's attributes in A? | 22:09 | |
nothingmuch | Q/sb end | ||
jnthn | lue: you can if you use the right syntax ;-) | 22:10 | |
lue | I just found it. | 22:11 | |
jnthn | lue: When you compose a role into a class, the attrs are just as if you had declared them in the class | ||
So you can see $.foo in the method in the class too :-) | |||
s/see/use/ | |||
lue | rakudo: role B { has $.foo is rw = 3; }; class A does B { has B $.foo; method z { say $.foo } }; A.z | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Attribute '$!foo' already exists in the class, but a role also wishes to compose it» | ||
tylercurtis | rakudo: role B { has $.foo is rw; }; class A does B {}; my $a = A.new; A.foo = 'foo'; A$a.foo.say; | ||
p6eval | rakudo 692aa1: OUTPUT«===SORRY!===Confused at line 20, near "A$a.foo.sa"» | ||
tylercurtis | rakudo: role B { has $.foo is rw; }; class A does B {}; my $a = A.new; $a.foo = 'foo'; $a.foo.say; | 22:12 | |
lue | ...or not | ||
p6eval | rakudo 692aa1: OUTPUT«foo» | ||
jnthn | lue: You re-declared it | ||
See what tylercurtis++ did :-) | |||
lue | ah. What I want to do is write methods in class A that mess with attributes in role B, but I can't seem to do that. | 22:13 | |
jnthn | Sure you can | ||
lue: The thing is that by composing a role the attributes are in your class now | 22:14 | ||
lue: Thing of role composition like copying stuff from the role into your class. | |||
*Think | |||
tylercurtis | rakudo: role B {has $.foo is rw; }; class A does B { method double_foo { $.foo *= 2; } }; my $a = A.new(:foo(5)); $a.foo.say; $a.double_foo; $a.foo.say; | ||
p6eval | rakudo 692aa1: OUTPUT«510» | ||
lue | rakudo: role B { has $.foo = 3 }; class A does B { method zi { say $.foo } }; A.zi | 22:15 | |
p6eval | rakudo 692aa1: ( no output ) | ||
jnthn | A.new.zi | 22:16 | |
Otherwise the class has no instance attributes :-) | |||
rakudo: role B { has $.foo = 3 }; class A does B { method zi { say $.foo } }; A.new.zi | |||
p6eval | rakudo 692aa1: OUTPUT«3» | ||
lue | OK. What was messing me up was bad coding then :) | ||
22:18
kloeri left
|
|||
lue | .oO(probably the closest thing to a jumptable in P6 is given/when (unless there's magic I'm not aware of)...) |
22:18 | |
22:19
mtk joined
22:21
Sanitoeter joined
22:25
tadzik left
22:30
kloeri_ joined
|
|||
TimToady | given/when is designed to be optimizable to a jumptable if you have well-behaved values in the when bits | 22:37 | |
22:37
rv2733 left
|
|||
TimToady | that was the big reason for changing ~~ from symmetrical to asymmetrical | 22:37 | |
lue | I'll only need 256 when's, from 0 to 0xFF :) | 22:38 | |
TimToady | otoh, you can also use an array of functions | 22:39 | |
lue | rakudo: sub A { say 'a' }; sub B { say 'b' }; my @a = A(), B(); @a[1] | ||
p6eval | rakudo 692aa1: OUTPUT«ab» | ||
TimToady | I doubt anyone is going to do the jumptable optimization any time soon, since (afaik) it was *never* done in Perl 5 (unlike Perl 4) | ||
but maybe it'll be easier in 6 | 22:40 | ||
lue | I gave up Python whilst coding my NES emulator because I got to the opcodes and found Python doesn't come with switch statements. | ||
TimToady | since it's just a matter of running down the statements and seeing if they're all integer whens, or string whens | ||
lue | .oO(255 elseif's... *shudder*) |
22:41 | |
TimToady | in other words, Python's only way to do it didn't line up with your only way to do it. :) | ||
presumably P6 can also do it with multi opcode (42) {...} | 22:42 | ||
22:45
mtk left,
timbunce left
|
|||
lue | I grappled between P5 and 6 for an afternoon, looking for something better, and I went with 6 because the -> (as opposed to .) confused me greatly. The End :) | 22:46 | |
sorear | moritz_: do you know who changed p6eval to suppress error messages and why? | 22:47 | |
lue | I should do multi opcode. It's extermely lazy! (after coding 256 opcode() methods, of course) \o/ | 22:48 | |
jnthn | lue: Nah, pre-deref'd interpreter ftw. :-) | ||
(you take the array of instructions and build an array of sub references, then just go through that array). | |||
lue | rakudo: multi method op(1) { say 'do' }; multi method op(2) { say 're' }; my $a = 2; op($a) | 22:49 | |
p6eval | rakudo 692aa1: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceUseless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceCould not find sub &op in main program body at line | ||
..20:/tmp/85… | |||
lue | rakudo: multi sub op(1) { say 'do' }; multi sub op(2) { say 're' }; my $a = 2; op($a) | ||
p6eval | rakudo 7579f7: OUTPUT«re» | 22:50 | |
jnthn | :-) | ||
lue: also multi op(1) { say 'do' } | |||
lue: multi name is just like multi sub name | |||
but shorter | |||
:-) | |||
lue | I'm glad I dumped Python! \o\ /o/ | ||
rakudo $satisfiedcustomer++ | 22:51 | ||
jnthn | Yay, I has @nice-hotel booked for $vacation :-) | ||
Which ain't for a month and a half. Eh well. | 22:52 | ||
lue | how great is @_ ? | ||
jnthn | @_ ? | 22:54 | |
22:54
azert0x left
|
|||
tylercurtis | rakudo: say TimeMachine.new.travel(Date.today + 45).find(:person<jnthn>).WHERE | 22:54 | |
p6eval | rakudo 7579f7: OUTPUT«Could not find sub &TimeMachine in main program body at line 20:/tmp/v3NsTvtXeF» | 22:55 | |
lue | rakudo: enum Vacancy <Vacant Booked>; my @nice-hotel; @nice-hotel[208] = Booked; # hotel management made esay by P6! | ||
p6eval | rakudo 7579f7: ( no output ) | ||
lue | s/esay/easy/ | ||
rakudo: use TARDIS :ver<40TT>; # please oh please oh please... | 22:56 | ||
p6eval | rakudo 7579f7: OUTPUT«===SORRY!===Unable to find module 'TARDIS' in the @*INC directories.(@*INC contains: lib /home/p6eval/.perl6/lib /home/p6eval//p2/lib/parrot/2.5.0-devel/languages/perl6/lib .)» | ||
tylercurtis | lue: github.com/masak/tardis someday. | 22:57 | |
jnthn | tylercurtis: <Germany Austria Slovenia>.any :-) | 22:58 | |
arnsholt | std: given 5 -> $x { ... } | ||
p6eval | std 31614: OUTPUT«ok 00:01 113m» | ||
arnsholt rereads S04 | 22:59 | ||
tylercurtis | rakudo: given 5-> $x { say $x } | ||
sorear | lue: yer syntax is wrong anyway | ||
p6eval | rakudo 7579f7: OUTPUT«===SORRY!===Unsupported use of -> as postfix; in Perl 6 please use either . to call a method, or whitespace to delimit a pointy block at line 20, near " $x { say "» | ||
tylercurtis | rakudo: given 5 -> $x { say $x } | 23:00 | |
p6eval | rakudo 7579f7: OUTPUT«5» | ||
arnsholt | rakudo: given 5 -> $x { when 5 { say "da" } } | ||
lue | tylercurtis: that's a time-travelling debugger. | ||
p6eval | rakudo 7579f7: OUTPUT«Use of uninitialized value in numeric context» | ||
lue | (That reminds me, I need to finish my Time Traveller's Tense Handbook, so tardis can speak properly) | ||
arnsholt | Wha'? | ||
jnthn | arnsholt: Well, you bound it to $x rather than the defualt $_, and when goes looking at $_. :P | 23:01 | |
arnsholt | Oh, probably due to $_ being undef | ||
Yeah, what you said ^^ | |||
tylercurtis | lue: Do you have a tardis of your own you're working on? | ||
jnthn | I *think* Rakudo isn't meant to go binding it to both. | ||
lue | not yet, I was referring to masak's. | 23:02 | |
arnsholt | As far as I can make from S04 an pblock with given doesn't make a lot of sense, but STD appears to disagree | ||
lue | [you're welcome to give me a fully-equipped genetics labratory though. Then I can start on my TARDIS :)] | 23:03 | |
23:08
mtk0 joined
|
|||
sorear sighs. | 23:10 | ||
23:14
rokoteko joined
23:17
mtk0 left
23:18
mtk0 joined,
mtk0 left,
pmurias left
23:19
mtk joined
23:25
kloeri_ is now known as kloeri
|
|||
arnsholt | I'm thinking of having a whack at giving NQP given/when | 23:32 | |
But before I get too deep into this, does anyone in the know know if this likely to be a desired feature? | |||
tylercurtis would use it. | 23:33 | ||
arnsholt | Good that I'm not the only one, at least =) | ||
sorear | probably it would be best to implement it semi-syntactically | 23:37 | |
arnsholt | What do you mean? | ||
sorear | pmichaud wouldn't like adding ACCEPTS to Integer, so when 42 { should desugar to $_ == 42, not 42.ACCEPTS($_) | ||
arnsholt | Ah, right | 23:38 | |
NQP has ~~ though, so as a first approximation I think it should work | |||
sorear | I can't find anything in S12 or the S12 tests on when class Foo { say "hi" } prints | 23:52 | |
23:53
masonkramer joined
|
|||
sorear | BEGIN, ENTER, and DO are the main contenders in my mind | 23:53 | |
23:55
Psyche^ joined
23:58
envi^home joined
23:59
Psyche^ is now known as Patterner
|