Pugs t-shirts www.cafepress.com/pugscode | Pugs 6.2.9 released | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | www.geeksunite.net Set by stevan on 15 August 2005. |
|||
svnbot6 | r6279 | putter++ | talks/README: Added entry for Wellington.pm p6 intro. | 02:30 | |
r6279 | putter++ | docs/SEEALSO: now points out that talks/README contains links to online versions of talks. | |||
autrijus | wow. | 04:58 | |
gvanrossum is on our committer list. | |||
maybe I should ask him to add himself to AUTHORS. | 04:59 | ||
mugwump: your design is on www.cafepress.com/pugscode now :) | 05:37 | ||
& | |||
mugwump | heh, not offensive anymore huh? :) | 05:39 | |
dduncan | autrijus, didn't you add gvanrossum to the committer list yourself, during ingy's talk in OSCON, when he asked you to live on stage? | 05:40 | |
coral | heh | 05:42 | |
autrijus++ | |||
in the words of a former friend, omg | 06:17 | ||
cafepress has a mousepad. do they have plastic mousepads? | |||
xinming | ?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp $t; | 06:32 | |
evalbot6 | Error: Wrong number of invocant parameters: 0 actual, 1 expected in "&TMP::tmp" | ||
xinming | $handle.close | ||
close($handle) | |||
close $handle: | |||
close $handle | |||
But the from Synoposis, It is legal for my example. So Is Pugs wrong? | 06:33 | ||
while {tmp $t:;} works | |||
anyone here "alive" ? :-S | 06:35 | ||
Khisanth | isn't that an indirect invocation? I am quite sure that invovles a colon somewhere :) | 06:41 | |
jql | ?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp $t: | 06:43 | |
evalbot6 | perl 6 bool::true | ||
jql | there ya go | ||
you were right; it was the colon | |||
xinming | from Synoposis, It is legal for { tmp $t; } | 06:44 | |
jql | ?eval class TMP { has $.tmp;method tmp { "I declared, I instantiated, I invoked"}; }; my TMP $t .= new; tmp $t: | ||
evalbot6 | 'I declared, I instantiated, I invoked' | ||
xinming | ?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp $t | 06:45 | |
evalbot6 | Error: Wrong number of invocant parameters: 0 actual, 1 expected in "&TMP::tmp" | ||
xinming | see the $handle.close example. :-) | 06:46 | |
the last one is also in Synoposis | |||
jql | the @Larry have flip-flopped on the explicit invocation syntax | ||
masak | jql: in what way? | ||
xinming | jql: you mean, The last one is not valid while Larry changed his mind, right? | 06:47 | |
jql | well, you can make arguments for the mandatory colon for tmp $foo: arg1, arg2, arg3; vs. MMD on the whole function | ||
xinming | by the way, I sometimes wonder, Why the init Method will be named BUILD{ }, I think the init method use the class name might be better. :-) | ||
jql | xinming: how would you name the constructor of an anonymous class? >:) | 06:48 | |
xinming | jql: Yes, I know, what here we talk is without arguments | ||
jql: .... Ok, I understand. ;-) | 06:49 | ||
Indirect object notation now requires a colon after the invocant if there are any arguments. If there are no arguments and you omit the colon, the notation is parsed either as a named unary operator or a list operator with one argument. In any case, all of these come out to the same thing: | 06:50 | ||
jql | xinming: an indirect method call without a colon would actually be a multimethod call | 06:51 | |
?eval class TMP { has $.tmp;multi method tmp { "perl 6".say}; }; my TMP $t .= new; tmp $t # don't think this works yet | |||
evalbot6 | Error: Wrong number of invocant parameters: 0 actual, 1 expected in "&TMP::tmp" | ||
jql | yeah, don't think that can work. heh | ||
xinming | hmm,, How about Larry think about this. | 06:52 | |
does larry agree with the example above. ? | 06:53 | ||
jql | might as well ask the mailing-list. it might divert them from the latest MMD thread | ||
jql falls asleep | |||
xinming | jql: night | ||
putter | autrijus: re journal, you saw my earlier irc notes? "putter suggests we rotate the items every three months" is, well, not what I had in mind at all... ah well. | 07:04 | |
iblech: I notice the rules Parser/Prelude hook is getting in the way of PIL2JS. As rules are again stalled on "everything takes two orders of magnitude longer because pugs isn't quite working yet", and PIL2JS is part of the critical path on getting things working, please feel free to rip it out. Hmm, here's a patch... | 07:08 | ||
pasteling | "putter" at 66.30.119.55 pasted "a patch to pull the Parser/Prelude macro rules hook fyi." (344 lines, 13.1K) at sial.org/pbot/12492 | 07:09 | |
putter | fyi | 07:10 | |
good middle-of-the night all. | |||
autrijus | hm, I keep misinsg putter | 07:27 | |
autrijus updates journal to reflect putter's feedback | 07:28 | ||
done | 07:29 | ||
mm lwall gives justification for the y2k epoch | 07:30 | ||
<larry> But mostly because I'm a megalomaniac, and think I can change the world. | |||
autrijus ponders generating a -CPython for guido to play with | 07:41 | ||
jql offers autrijus a choice of pie... banana cream? key lime? | 07:42 | ||
hell, if larry can embarass the programming world into adding universal pcre integration, I think he can make his own epoch | 07:44 | ||
autrijus | well yeah, I hope so :) | 07:45 | |
hm, I wonder if I should blog about the guido incident today | |||
(openfoundry.org sent a newsletter to all users to announce the new, much improved site look implemented by gugod) | |||
and guido wrote back saying "but I'm not a user, why am I getting this" | 07:46 | ||
then we found out he is a pugs committer after all :) | |||
castaway1 grins | 07:49 | ||
mm, is it readable now? | |||
autrijus | the beta version will be up in 2 days | 07:50 | |
07:50
castaway1 is now known as castaway
|
|||
castaway | well thats an improvement, I can actually use it now ,) | 07:50 | |
autrijus | :D | 07:51 | |
castaway thinks public descs should be english tho (with an extra field for local names ,) | 07:53 | ||
autrijus | nodnod :) | ||
autrijus needs to run... still at $job | |||
castaway | have fun ,) | ||
Oh.. www.openfoundry != openfoundry.org (the first is still unusable) | 07:55 | ||
jql files the ICANN petition | 07:58 | ||
castaway | ? | 07:59 | |
nothingmuch | darn, someone kicked my box | 08:00 | |
nothingmuch thinks the builders may have actually bumped the power button | |||
castaway | wuzn't me | 08:02 | |
nothingmuch | do you have an alliby? | ||
castaway | depends, for when? :) | 08:03 | |
nothingmuch | today, in the morning I got a message saying "this box is going down, due to halt" | ||
which is what you get when you press the power button | 08:04 | ||
castaway | umm.. I was in bed? | ||
xinming | hmm, anyone here can tell me what the differences between {has $var;} and { my $var; } for a class | 08:56 | |
Aankhen`` | `has $var;` declares an instance variable. | 08:57 | |
`has $.var;`, rather. | |||
`my $var;` declares a class variable. | |||
?eval class Foo { my $bar = "bar (class)"; has $.bar = "bar (instance)"; }; (Foo.bar, Foo.new.bar) | 08:58 | ||
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
Aankhen`` | ?eval class Foo { my $bar = "bar (class)"; has $.bar = "bar (instance)"; }; (Foo.bar, Foo.new().bar) | ||
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
Aankhen`` | Bah. | ||
D'oh. | 08:59 | ||
My mistake. | |||
?eval class Foo { our $bar = "bar (class)"; has $.bar = "bar (instance)"; }; ($Foo::bar, Foo.new().bar) | |||
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
Aankhen`` | What the heck? | ||
?eval class Foo { our $bar = "bar (class)"; has $.bar = "bar (instance)"; }; $Foo::bar | |||
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
xinming | :-) | ||
Aankhen`` | ?eval class Foo { has $.bar = "abcd" } | 09:00 | |
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
Aankhen`` | Ah, that'd be the problem. | ||
Anyway. | |||
I made a mistake earlier. | |||
xinming | ?eval class TMP { has $.bar = "abc"; }; | ||
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
Aankhen`` | `my $var;` acts like a regular lexical variable, i.e. one that is limited in scope to the class in which it is declared. | ||
xinming | ?eval class TMP { has $.bar; }; | ||
evalbot6 | undef | ||
Aankhen`` | Or... wait... | ||
One sec. | |||
Aankhen`` tries to sort things out in his head. | 09:01 | ||
xinming | ?eval class TMP { has $.bar; my $.bar }; | ||
evalbot6 | undef | ||
xinming | ?eval class TMP { has $.bar =1; my $.bar; my $bar; }; | ||
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
xinming | ?eval class TMP { has $.bar; my $.bar; my $bar; }; | ||
Aankhen`` | `my $.foo` declares a private class variable, i.e. one that can only be accessed by it or its subclasses, or any classes it "trusts". | ||
evalbot6 | undef | ||
Aankhen`` | That sounds about right. | ||
xinming: `my $.foo` declares a private class variable, i.e. one that can only be accessed by it or its subclasses, or any classes it "trusts". | |||
xinming | hmm... how about the keyword has? | 09:02 | |
Aankhen`` | On the other hand, `has $.foo` declares a public instance variable. | ||
So if you have this: class Foo { has $.bar = "bar" } | |||
Then you can access $.bar as a property of a Foo object, rather than the class: my $foo = Foo.new(); $foo.bar | 09:03 | ||
xinming | ?eval class Foo { has $.bar = "bar" }; my Foo $v .= new; $v.bar.say; | ||
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
Aankhen`` | Initial values for attributes don't seem to be supported yet. | ||
xinming | for priviate variable, the has $:var form is used I think. :-S | 09:04 | |
hard to understand. T_T | |||
Aankhen`` | For instance variables, yes... | ||
I'm not really sure about the class variables thing. | |||
`has $:foo` declares a private instance variables. | |||
s/s\.$/./ | 09:05 | ||
xinming | ?eval class T { has $.new; }; my T $o .= new; | ||
evalbot6 | \undef | 09:06 | |
xinming | ?eval class T { has $.new; method tmp { 'pugs'.say }}; my T $o .= new; $o.tmp; | ||
evalbot6 | Error: No compatible subroutine found: "&tmp" | ||
Aankhen`` | I believe you need a better signature on that method. | 09:07 | |
?eval class T { has $.new; method tmp () { "pugs" } }; my T $o .= new; $o.tmp; | |||
evalbot6 | Error: No compatible subroutine found: "&tmp" | ||
Aankhen`` | ?eval class T { has $.new; method tmp () { "pugs" } }; my T $o .= new; $o.tmp | ||
evalbot6 | Error: No compatible subroutine found: "&tmp" | ||
xinming | Aankhen``: no, In fact, I think that's the problem for the member variable $t. :-) | ||
oops. | |||
$.new | |||
Aankhen`` | Yes... | ||
?eval class T { method tmp () { "pugs" } }; my T $o .= new; $o.tmp; | 09:08 | ||
evalbot6 | 'pugs' | ||
Aankhen`` wanders off. | 09:09 | ||
xinming | ?eval class T { has $.new; method tmp { 'pugs'.say }}; my T $o .= bless( {} ); | 09:13 | |
evalbot6 | Error: No compatible subroutine found: "&bless" | ||
xinming | ?eval class T { has $.new; method tmp { 'pugs'.say }}; my $o = T.bless( {} ); | ||
evalbot6 | Error: No compatible subroutine found: "&bless" | ||
xinming | oops. | ||
nothingmuch | god damnit! | 10:15 | |
nothingmuch just spent a day learning enough CSS to do what he wants | |||
castaway comforts nothingmuch | |||
nothingmuch | and when it finally works.... it doesn't under IE | ||
FUCK FUCK FUCK FUCK FUCK FUCK FUCK! | |||
castaway | IE-- | ||
nothingmuch | Microsoft probably owes the world 50% of it's lost man hours | 10:16 | |
the rest can be attributed to family emergencies, real hardware problems, drug abuse, and so forth | |||
ods15 | nothingmuch: if you're having that much trouble, you're probably doing something broken anyway | 10:17 | |
nothingmuch | ods15: "display: table-cell" | ||
it works perfect everywhere, very stable, very non quirky | |||
10:17
Aankh|Clone is now known as Aankhen``
|
|||
ods15 | css is kinda nice, but your page should look nice in links as well as other browsers | 10:17 | |
nothingmuch | except that it's completely unsupported on IE | ||
ods15 | what is that | ||
nothingmuch | well, it means that the items (divs, spans, etc) can be layed out like a table | 10:18 | |
even when they're not | |||
ods15 | then use tables... | ||
nothingmuch | ods15: please, don't just preach | ||
ods15 | ok, could you explain to me it then? | ||
nothingmuch | i don't do this because I think it's fun | ||
i did this because tables didn't give me enough control | 10:19 | ||
and the layout was completely unreadable | |||
ods15 | hmm | ||
nothingmuch | nevermind, i'll find a way to deal with it | ||
I could create images with GD | |||
and just display them inline | |||
=) | |||
ods15 | what are you trying to do? can you give me a screenshot of the page as it works in FF? | ||
Aankhen`` | odsl: The whole point of CSS is to seperate style (presentation) from structure (markup). This makes it /easier/ for text browsers to display the page. | ||
nothingmuch | ods15: i'll find something, i haven't exhausted my options yet | 10:20 | |
Aankhen`` | ods15, even. | ||
Aankhen`` curses Courier New. | |||
ods15 | Aankhen``: yeah, css IS good | ||
castaway | (except CSS is too complex for what it does, and has sucky support :) | ||
ods15 | but it shouldn't be your problem when designing a page... | ||
btw, my idea of a pretty page... kmenc15.sf.net/ | 10:21 | ||
castaway | thats not pretty, just plain ,) | ||
Aankhen`` | Indeed. | ||
ods15 | plain is pretty :) | ||
Aankhen`` | Nope. | ||
Plain is plain. | 10:22 | ||
Plain != pretty. | |||
Simple != pretty. | |||
ods15 | bs | ||
Aankhen`` | Truth. | ||
ods15 | bah | ||
Aankhen`` | That page looks like something out of 1996. | ||
ods15 | oh, what am i talking about, you're perl programmers, ofcourse you think big is beautiful... | ||
Aankhen`` | I never said big is beautiful. | 10:23 | |
nothingmuch | ods15: wtf? | ||
Aankhen`` | "Simple" and "pretty" are not mutually exclusive. | ||
However, they are not equivalent. | |||
ods15 | Aankhen``: ah, i misunderstood your "equations" | ||
nothingmuch | ods15: is C pretty? | ||
Aankhen`` | S'okay, I think they weren't very clear. | ||
ods15 | i thought you meant "simple can't possibly be pretty" | ||
nothingmuch | is it small? | ||
Aankhen`` | Nah. | 10:24 | |
I've seen plenty of simple sites that manage to look really good. | |||
ods15 | nothingmuch: C is slightly too big, but it's simpler and smaller than most. i think it's generally beautiful. | ||
nothingmuch | ods15: not the language, the programs written in it | ||
ods15 | what do you mean | 10:25 | |
nothingmuch | C as it's defined is elegant | ||
castaway | simple can be pretty, lack of colour whatsoever isnt (IMnsHO :) | ||
nothingmuch | it's very little that gives you very much | ||
ods15 | Aankhen``: i like sites which gives content... | ||
nothingmuch: yeah... | 10:26 | ||
nothingmuch | but C code usually isn't pretty or elegant | ||
Aankhen`` | ods15: I do too, but I don't call a site with minimum style and colour but lots of content pretty. | ||
nothingmuch | it's serious, but that's all i can think of | ||
wolverian | I think beaglewiki.org/ is rather pretty. | ||
Aankhen`` | nothingmuch: Could I see the page on which you're using `display: table-cell;`? | ||
ods15 checks | |||
nothingmuch | Aankhen``: no, sadly, it's internal company data | ||
Aankhen`` | wolverian: Yeah, that looks nice. | 10:27 | |
nothingmuch | and creating a mockup would take me quite a while, since the structure is pretty big | ||
Aankhen`` | wolverian: Also check out blog.codefront.net/. | ||
nothingmuch: OK, then I'll simply ask: are you sure you shouldn't just be using tables? | |||
ods15 | looks nice. wiki don't usually look very good in elinks/links :/ even wikipedia is kinda bad there.. | ||
nothingmuch | Aankhen``: if I use tables I have colspan on 80% of the cells, and rowspan on 20% of the cells | ||
wolverian | Aankhen``, that's nice, too. the a:hover colour is a bit bright, but then again, this LCD destroys colour pretty well. | 10:28 | |
Aankhen`` | nothingmuch: What sort of content are you marking up? | ||
nothingmuch | Aankhen``: an item in a database, and all it's complex relationship to 3 other tables | ||
as well as edit/delete buttons | |||
ods15 | nothingmuch: i haven't seen THAT many C programs, but i can say i've seen quite a few which were wonderfully designed (e.g. ffmpeg), and quite a few which have a wonderfully broken design... (mplayer) but it has more to do with planning ahead than the language... | ||
Aankhen`` | tables++ | ||
wolverian: Yeah, the hover colour is a bit bright, but what I like is the overall look. | 10:29 | ||
nothingmuch | ods15: i don' | ||
t mean in the big picture | |||
i mean the actual code | |||
there is too much micromanagement | |||
not enough intention | |||
ods15 | ah, that | ||
depends on your purposes.. | 10:30 | ||
nothingmuch | the code doesn't say what it wants to do, it says how to do it, and also what is needed to do it, and how to do that too | ||
Aankhen`` | wolverian: phoenity.com/firefox.html # seems fairly simple now, but it totally blew me away the first time I saw it. | ||
ods15 | and, it too depends on a good design | ||
wolverian | Aankhen``, heh, the backgrounds are neat. | ||
Aankhen``, but the title image doesn't have an alpha channel :/ | 10:31 | ||
ods15 | if you make good general purpose functions which do the tiny things, the big stuff can use them and not worry about small stuff | ||
nothingmuch | ods15: except when it needs to | ||
Aankhen`` | wolverian: mathibus.com/ # opinion? :-) | ||
nothingmuch | and then you get 10 variation s on a short name | ||
ods15 | ? | ||
nothingmuch | one for each different way on how memory is managed | 10:32 | |
on the return value | |||
or pass-a-pointer | |||
or what not | |||
and if you have the returns-a-mallocced-thing, you need to define a macro that allocates for that function | |||
or link it to something proper | |||
and if you pass a pointer, then you need to worry about memory anyway | |||
ods15 | well C's is most known for it's greatest advantage and disadvantage - it leaves memory management to the programmer | ||
nothingmuch | ods15: memory management is not the only thing | 10:33 | |
objective C is a superset of C, that gives OO | |||
it's memory management is also manual | |||
ods15 | OO is design, not language | ||
nothingmuch | but it's tucked away very nicelyu | 10:34 | |
Aankhen`` | ods15: Ever done Perl 5 OO? :-P | ||
nothingmuch | ods15: OO is the luggage that comes with the language | ||
you can't do OO proper in C | |||
ods15 | Aankhen``: nope.. but i've seen quite a bit of OO in C | ||
nothingmuch | you can pretend that you're doing it | ||
but it's not really it | |||
ods15 | no, you can REALLY do it | ||
nothingmuch | you can implement OO in C | ||
Aankhen`` | ods15: Try it sometime. | ||
ods15 | with structs and functions pointers | ||
nothingmuch | ods15: that's not OO, that's structs and function pointers | 10:35 | |
that, btw, is what objective C is | |||
structs and function pointers | |||
but with syntax and culture | |||
objective C used to be just preprocessed down to C | |||
and then compiled | |||
ods15 | no, it's OO. if you believe me, look at mplayer's vf layer... | ||
Aankhen`` | If you're happy and you know it, clap your hands! | 10:36 | |
ods15 | the entire vf stuff is very beautiful "OO" style | ||
nothingmuch | ods15: this argument is pointless | ||
my original premise is: | |||
C leaves you worrying about too much details all the time, when you should only really care about them when you care about them | |||
castaway | (so does assembler ,) | 10:37 | |
Aankhen`` | nothingmuch: BTW, I hate to digress, but as regards your earlier problem... :-P www.usability.com.au/resources/tables.cfm | ||
ods15 | which is ofcourse why it's only best suited in places where it's best suited... | ||
castaway | its best suited to writing compilers in ,) | ||
ods15 | there is no "perfect" language :) | ||
castaway: or any kind of intensive operations | 10:38 | ||
wolverian | Aankhen``, nice, although nothing special. I think the horizontal navigation menu should have a different background colour than the main text body. the 'recent comments' author links are too light. | ||
Aankhen``, otherwise I like it. | |||
simple and easy to read. | |||
and not ugly. | |||
castaway | ods15: throw more hardware at it ,) | ||
nothingmuch | ods15: uh, that's not what I mean | ||
ods15 | nothingmuch: ? | ||
Aankhen`` | wolverian++ | ||
nothingmuch | my claim wasn't that C is bad for everything | 10:39 | |
it was that most code is inelegant | |||
ods15 | ah | ||
nothingmuch | and this inelegance is the price you pay for control | ||
and sometimes, you pay for control in safety, and even performance | |||
ods15 | nothingmuch: ? | ||
you lost me on performance.. usually that is the reson you take control.. | 10:40 | ||
nothingmuch | ods15: what about copy on write? who the hell wants to really optimize every copying or non copying operation by hand? | ||
also, some languages are more optimizable than C, because the functions deal more with intention than with details, so the compiler can replace details with better ones | 10:41 | ||
ods15 scratches head | |||
what copy on write? | |||
i mean, what did you mean by what you said there | 10:42 | ||
nothingmuch | ods15: my $str = "Foo"; my $other = $str; # should this make a copy? | ||
ods15 | i know what cp[y on write is | ||
nothingmuch | in a higher level languaage the compiler can see what your usage pattern for a given string is | ||
if it determines that a given variable takes a substring | |||
ods15 | nothingmuch: hmm, what do you mean | ||
nothingmuch | and immutably manipulates it, until the substring is destroyed | 10:43 | |
even if the lexical scope of the code doesn't know if it's mutably or immutably manipulated | |||
ods15 | in perl, that code only copies on write? | ||
nothingmuch | ods15: no, perl doesn't have COW | ||
ods15: look at haskell's arrays | |||
in haskell most data structures are immutable | 10:44 | ||
but sometimes it makes sense for the immutable structures to really be implemented as mutable structures, because it's more efficient | |||
this is comparing apples and oranges, WRT to C | |||
ods15 | 13:40:26 <nothingmuch> ods15: what about copy on write? who the hell wants to really optimize every copying or non copying operation by hand? - you mean, a lazy C programmer would ALWAYS duplicate his stuff even when he doesn't need to, and in other languages this wouldn't happn? | ||
nothingmuch | ods15: the programmer, lazy or not lazy, should not need to worry about that | 10:45 | |
for example: | |||
ods15 | i don't think i've ever heard of something like that.. whenever making any kind of copy, you know beforehand if you need to modify it or not, and duplicate or point accordingly... | ||
nothingmuch | sub foo ($str) { my $sub = substr($str, <offset>, <length>); return $sub }; | ||
my $string = "moose"; | |||
my $other = foo($string); | 10:46 | ||
length($other); | |||
my $another = foo($string); | |||
castaway | but what if you dont know? :) | ||
nothingmuch | $other =~ tr/A-Z/a-z/; | ||
oops, the $other in the last one should be $another | |||
ods15 | nothingmuch: is this actually broken perl code you're giving me? should i run this code in perl? | 10:47 | |
nothingmuch | ods15: it's pseudo code | ||
ods15 | ah | ||
nothingmuch | foo() accepts a string | ||
and returns a part of it | |||
it doesn't know what happens to the part of it | |||
if the return value is modified, the original string should not be altered | |||
in C, how would you keep 'my $other = $string; length($other); # other is no longer used now' efficient? | 10:48 | ||
ods15 | in C i would have to copy no matter what due to null terminator | 10:49 | |
nothingmuch | ods15: that's besides the point | ||
ods15 | lol | ||
nothingmuch | assume the string is really a struct that has a pointer and some length | ||
ods15 | ok | ||
nothingmuch | anyway, in a language that doesn't specify it, you have several different solutions: | 10:50 | |
copy on write can make the substring share bytes with the original | |||
$other doesn't cause a copy | |||
but $another does | |||
furthermore, static code analysis can even avoid COW | |||
ods15 | heh | ||
nothingmuch | because a compiler could see that foo is used in a variable that gets changed, and that doesn't get changed | ||
and the compiler can augment the version in use | 10:51 | ||
ods15 | in places where efficiency REALLY matters, this kind of situation should never happen | ||
nothingmuch | ods15: why should it never happen | ||
ods15 | i agree, in this case C would be "slower" as you would have to always make a copy | ||
nothingmuch | ods15: no, C will probably be faster | ||
if you make two versions of 'foo' | 10:52 | ||
but then the programmer is slower | |||
so most people will just make a copy to stop worrying about it | |||
which is the correct way for most code | |||
but look at projects like psyco, which take high level code | |||
ods15 | actually, in C i wouldn't do this at all because there's no such thing as a "substr" function | ||
...due to the memory management.... | |||
nothingmuch | ods15: that's sooooo besides the point | ||
ods15 | no, it's not | ||
nothingmuch | ods15: it seems like you're trying to avoid dealing with the main issue | 10:53 | |
i'm giving you general examples | |||
that are supposed to convey a concept | |||
ods15 | nothingmuch: which don't apply when you take not of the "little" details | ||
nothingmuch | and C does have substr in the sense that perl's substr is implemented in C | ||
castaway sighs | |||
ods15 | 13:52:17 <nothingmuch> so most people will just make a copy to stop worrying about it - stop worrying about it? they still need to free() it!! | ||
nothingmuch | ods15: nevermind | ||
oids | |||
ods15: see? that's why C sucks for stuff that shouldn't care about it | |||
ods15 | lazy.. programmers.. | 10:54 | |
nothingmuch | ods15: yes, programmers should be lazy | ||
my time is more expensive than my compiler/processor | |||
ods15 | and use high level language :) | ||
nothingmuch | much more expensive | ||
ods15: for 90% of the code yes | |||
ods15 | i forgot your point | ||
something about C programs | 10:55 | ||
nothingmuch | my point was that C is about micromanagement | ||
ods15 | yes, it is | ||
i agree | |||
nothingmuch | and that's why programs written in it are inelegant in my opinion - they don't concern themselves with what result the program is trying to achieve | ||
they are concerned with tiny issues that come up on the way to that result | 10:56 | ||
ods15 | ah. well. depending on the purpose, this could be unavoidable... (you're obviously not suggesting that mplayer and linux should be re-written in perl) | ||
nothingmuch | ods15: no, i'm not, but mplayer's command line argument processing code doesn't really need to perform well, does it? | 10:57 | |
castaway | (the right language for the job) | ||
ods15 | nothingmuch: ah, yes, you could say for example, the entire high level management SHOULD be written in something else | ||
but unfortunately, once you pick a language, you should STICK to that language.. any other solution is almost always less elegant, not more | 10:58 | ||
all of mplayer's high level management is totally awful, and it being C is not the only cause, but defenetaly a cause.. sadly, there is no better solution. oh well | 11:00 | ||
oh, 2pm... bbl, patrol | 11:01 | ||
castaway | patrol? | 11:02 | |
ods15 | nothingmuch: what;s the word in english? | 11:11 | |
castaway | patrol sonuds english :9 | ||
theorbtwo | Patrol: An orginized, regular, search, in order to catch things that shouldn't be there, but are. | 11:12 | |
ods15 | yeah that's about it | 11:17 | |
army thing | |||
i need to go around the base | |||
nothingmuch returns | 12:02 | ||
nothingmuch leaves once more | |||
castaway | ah, around the base.. and what do you do the rest of the time? :) | ||
ods15 | chat with you guys | 12:06 | |
castaway | nice job | ||
ods15 | yeah. army. sure is hard :( | ||
theorbtwo | US army? | 12:09 | |
castaway | he's in .il | 12:10 | |
theorbtwo | Ah. | ||
Odin- | So, a former terrorist group. | 12:18 | |
castaway | ? | ||
Odin- | The IDF was formed from hebrew terrorist groups. | ||
... not an unusual way for a national army to form, I might note. | 12:19 | ||
castaway nods | |||
ods15 | nod | ||
well, it wasn | |||
err | |||
well, it wasn't really terrorists.. | |||
Odin- | You can argue that their cause was just, but that's irrelevant. ;) | ||
ods15 | afaik they didn't do any kind of innocent people killing, atleast not intentionally | ||
Odin-: actually i consider terrorism by killing innocent irrelavent people | 12:20 | ||
killing non-innocent people is still just as bad imo, but it's not "terrorism" | |||
Odin- | By that definition, the U.S. Army is the single largest terrorist organisation today. | 12:21 | |
*shrug* | |||
ods15 | (e.g., all the armies in the world as far as i am concered are totally as bad as terrorism...) | ||
hmm.. u.s. army kills innocent people?... | |||
Odin- notes that 'terrorist' is what people-in-power call others doing the same thing as themselves. | |||
ods15: Sure. It's called "collateral damage". | 12:22 | ||
ods15 | heh | ||
i actually consider all people innocent... | |||
Odin- may sound rabidly anti-military, but that's not really it. | 12:23 | ||
castaway | even the ones that are trying to kill you? | ||
Odin- | I just don't believe there's any nobility attached. ;) | ||
ods15 | there are very few people which really want to kill, they are call psychopaths... the rest do it in self defense or forced to by circumstances.. | ||
as for the psycopaths, they are innocent too, because it's not their fault their mind is broken | 12:24 | ||
stupidity is not controllable... | |||
Odin- | An interesting viewpoint. | ||
theorbtwo | Don't confuse psychopathy with stupidity. | ||
castaway | breed it out ,) | ||
ods15 | theorbtwo: hmm, good point | ||
Odin- | And one that really easily makes status quo justifiable. ;) | ||
ods15 | but both are mental diseases though? | 12:25 | |
as in, uncontrollable? | |||
theorbtwo | Sure. | ||
Odin- | castaway: Psychopathy isn't an inheritable disease. | ||
castaway | I mean the stupidity | ||
Odin- | Well, that isn't, either. | ||
castaway | and as for the other, Im not so sure thats true | ||
theorbtwo | But a stupid person probably won't be very good at killing you. The psychpaths, however, will likely be /very/ good, at least at some things. | ||
Odin- | I've never come across a person that's "incurably stupid". | ||
castaway: There are genetic factors which influence it, sure. | 12:26 | ||
ods15 | Odin-: go work at some tech support company, you'll see what it means :) | ||
Odin- | castaway: Just like, say, depression. | ||
ods15: Heh. :> | |||
theorbtwo | 'Ignorant' ne 'stupid'. | ||
Odin- | ods15: Dunno. I think that's arrogance speaking. ;) | ||
ods15 | theorbtwo: religious leaders are not psychopaths, they are stupid | 12:27 | |
and they kill thousands | |||
theorbtwo | nothingmuch, I'd tend to think that they are more likely psycopaths then stupid. Or neither. | ||
ods15 | ods15? | ||
theorbtwo | I don't think stupid people are very good at becomming religious leaders. | ||
ods15 | W bush :P though he's not a religious leader... | 12:28 | |
and tbh i'm not sure if he's stupid, never really checked | |||
theorbtwo | GW Bush isn't stupid (though he tries to appear so). OTOH, he quite possibly is a psychopath. | ||
Odin- | I wouldn't say 'stupid'. | ||
I'd say "narrowly focused". | |||
ods15 | childish? | 12:29 | |
Odin- | Which is pretty much what psychopathy is... | ||
theorbtwo | Psychopathy, as I understand it, is not having a normal motoviational structure, or an intuitive understanding of psychology. | 12:30 | |
They can /learn/ psychology quite effectively, but to them it's xenospsychology -- they don't learn about themselves as they learn about other people, or vice-versa. | |||
ods15 | theorbtwo: hmm, ok, what about the nazis?.. hitler was NOT stupid, but his "fan club" i believe mostly were | 12:31 | |
he rised to power by stupidity | |||
Odin- | I dunno. | ||
I think it was the other way around. | |||
theorbtwo | Stupid people are very easy to manipulate by those who learn phychology, yes. | ||
Odin- | Hitler was nuts, his "inner ring" was relatively sane, although utterly unreal. | ||
ods15 | Odin-: nah, hitler was not stupid, at all | ||
castaway | he was a psycho .. (meglomaniac?) | 12:32 | |
ods15 | (stupid is not capable of mathematical/logic thinking...) | ||
Odin- | ods15: I didn't say 'stupid'. But people like Gƶring, Himmler most certainly weren't, either. | ||
ods15 | theorbtwo: btw, you said, ignorance != stupidity... elaborate? | ||
himmler? | |||
Odin- | ods15: Ignorance is a lack of knowledge. | 12:33 | |
castaway | not knowing something yet is not the same as not being able to comprehend it | ||
Odin- | Stupidity is inability to know. | ||
(Roughly speaking.) | |||
ods15 | Odin-: ah, well, the people who call tech support are not JUST ignorant, they really are TRUELY stupid | ||
(i don't mean all..) | |||
castaway | no, I think mostly they're ignorant | ||
Odin- | ods15: Not at all. You just try to start at the wrong point. ;) | ||
ods15 | Odin-: no, they refuse to do anything, using wizards scares them, they do not understand that cutting the power in the room causes the pc to shut down | 12:34 | |
that is not ignorance | |||
most are ignorant, yes. but some are truely stupid | |||
Odin- | Maybe some. But they're rare. ;> | 12:35 | |
ods15 | not according to the stories my sister has told me.. (adsl tech) | ||
Odin- | Most of the "horror stories" I've heard are not stupidity. | ||
And, yeah, re: the power ... no, that's not "stupidity". It's a failure of understanding; i.e., ignorance. | 12:36 | ||
ods15 | Odin-: umm, isn't FAILURE of understanding stupidity? | 12:37 | |
castaway | no, inability is stupidity | ||
Odin- | ods15: No. Inability to understand. | ||
ods15 | ignorance i thought was that you simply have never learned | ||
but failure of learning would then be stupidity? | |||
Odin- | ods15: Not at all. That could be the result of a myriad different things. | 12:38 | |
ods15 | (not understanding that 2+2+2 is 2*3, after you've been explained, is stupidity.. not knowing it BEFORE you've been explained, is ignorance.. right?) | ||
theorbtwo | Correct, ods15. | ||
Odin- | ods15: Hm. Yes. | 12:39 | |
ods15 | then.. failure of understandg is stupidity?... | ||
Odin- | But do keep in mind that not understanding it after one round of explaining it doesn't mean someone is stupid. | ||
ods15 | Odin-: well, stupid is not black and white | ||
it grows "gradually" | |||
Odin- | ods15: Neither is arrogance. ;) | ||
Which, frankly, is an all too common taint on intelligence. | 12:40 | ||
ods15 | if you're reffering to me you'll have to explain to me where i've been arrogant.. i (think i) generally try not be... | ||
dbrock | tech support customers' failure of understanding is the same as tech support's failure of explaining | 12:41 | |
ods15 | that's a good point.. heh | 12:42 | |
nothingmuch | theorbtwo: huh? | ||
ods15 | but i think fortunately most of tech support is just as stupid as teir customers, which makes the communication easier :) | ||
Odin- | ods15: Well, I think you have a skewed viewpoint. I know I do. The fact that someone takes much longer to realise something than you, or even an average person, doesn't mean the person is stupid. Especially when there are unstated assumptions of knowledge, which often happens... | ||
dbrock | the failure might be due to the customer's stupidity and ignorance, or it might be due to tech support's incompetence, or any combination thereof :-) | ||
Odin- | ods15: And you wondered where arrogance was to be found? ;> | 12:43 | |
dbrock: Indeed. :) | |||
ods15 | Odin-: well, i never mentioned myself.. | ||
theorbtwo | orafu, in many cases, the falure of documentation -- often including the complete absence of any documentation. | ||
nm: What are you "huh"ing, in purticular? | |||
dbrock | ods15: good point :-) | ||
theorbtwo wonders who he meant when he said "orafu". | 12:44 | ||
ods15 | but, even though it doesn't mean the person is stupid, it does SOMEWHAT (in most cases) mean the person is stupidER (which could still be very intelligent, just not AS) | ||
Odin- | ods15: Which brings the latter point to focus. Often, when knowledgeable people are trying to explain something, they make unstated assumptions of a person's knowledge, which is by no means certain. | ||
AS? | |||
ods15 | the other person | ||
Odin- | Ah. | 12:45 | |
Yeah, sure. | |||
But in those cases I think "stupid" is a bad word to use. ;) | |||
ods15 | and that's what i meant by "gradually" | ||
yes, lack of a better word :) | |||
theorbtwo | For example: "Of course your computer is off, if your power failed!" | ||
ods15 | i'll say the cliche - everything is relative, nobody is stupid or smart :) | ||
theorbtwo | 1) They realize their power has failed, and not that the computer and light bulb both happened to die at the same time. | 12:46 | |
2) They know that the computer is an electrical device, and not mechanical. | |||
ods15 | they already know that electricty runs many appliances in the house | ||
theorbtwo | 3) They know that it doesn't work on batteries (many electronic devices do). | ||
ods15 | and they are unable to draw conclusions, that is stupidity | ||
theorbtwo | They do? | ||
ods15 | tv, refrigirator... | 12:47 | |
theorbtwo | That's another assumption. | ||
Perhaps they haven't tried to use the TV or refrigerator during a power failure. | |||
ods15 | wait, so the statement you said just now are assumptions? | ||
theorbtwo | Power failures of more then a few seconds aren't that common in much of the US anymore, for example. | ||
ods15 | i see | ||
yes, i guess they are assumptions... but in this example, these assumptions are safe?... | 12:48 | ||
castaway looks back in after answering the phone and is completely lost | |||
Aankhen`` | I always thought stupidity is the frequent (or perhaps regular?) inability to arrive at the correct conclusion despite having, and being aware of, all the necessary information. | ||
theorbtwo | If you've never used a 3.5in floppy, then it's perfectly reasonable to assume that it's a card reader. | ||
ods15 | Aankhen``: yeah, that's a pretty good definition.. stupidity comes in many forms | 12:49 | |
theorbtwo | Yep, Aankhen, and one tech support call isn't enough to know if they do it frequently, and have all the neccessary information. | ||
theorbtwo thinks it's a very good definition. | |||
ods15 | mostly all forms of stupidity involve inability to reach/understand a conclusion | ||
theorbtwo: the assumptions you mentioned are practically safe assumptions | 12:51 | ||
theorbtwo | The other day I saw a series of photos of stupid things people do to their computers and send them in for repair. | ||
Aankhen`` | [18:17:54] <theorbtwo> Power failures of more then a few seconds aren't that common in much of the US anymore, for example. # lucky dawgs. | ||
ods15 | also, even if they are assumptions, all of those assumptions are actually conclusions themselves, which should've been reached, if the person isn't stupid | 12:52 | |
Aankhen`` | Yup. | ||
theorbtwo | One was of credit cards stuck in a 3.5" floppy drive, with the caption "no, it's not a card reader". | 12:53 | |
Aankhen`` | Hrm. | ||
ods15: Actually, I'm not so sure... | |||
ods15 | theorbtwo: hehe | ||
theorbtwo | If you've never seen a 3.5" floppy, and nobody told you otherwise, thinking it's a card reader isn't that crazy. | ||
Aankhen`` | Everyone exhibits the inability to reach the conclusion once in a while. | ||
It might be that you reached all the necessary conclusions except one. | |||
ods15 | Aankhen``: i agree... | 12:54 | |
theorbtwo | Computers these days don't come with manuals. At best, they have an icon on the desktop, which hopefully you figure out to double-click on, and how to use. | ||
Aankhen`` | theorbtwo: They do if they're assembled. :-D | ||
ods15 | hehe | ||
castaway | with real "user" manuals? I dont believe you | ||
theorbtwo | Aankhen: I haven't seen a computer that came with a manual that laid everything you need to know out in a long time. | ||
Aankhen`` | castaway: 'Twas said in jest. :-P You do get the manuals for the individual parts, though. ;-) | ||
theorbtwo: Have they stopped bundling manuals with branded computers? | 12:55 | ||
I know my mother's laptop came with one. | |||
theorbtwo | I think so, Aankhen. | ||
A useful one? | |||
ods15 | Aankhen``: one on how to browse the web? | ||
Aankhen`` | I dunno, never read it. | ||
castaway | one that explained double click, and F1 and .. ? | ||
(and start to shutdown :) | |||
Aankhen`` | It had online (as in, "on computer", not "on Web") help, so I browsed that a bit. | 12:56 | |
Come to think of it, though, it wasn't really a good idea for newbies. | |||
theorbtwo | Most likely, it doesn't tell you how to use a computer, only how to use the bits of that computer that vary from a bog-standard computer. | ||
Aankhen`` | (i.e. the answer to castaway's question is yes) | ||
s/yes/no/ even. -_- | |||
theorbtwo: Spot on. | |||
castaway | Which is no help whatsoever to people who have never used one | 12:57 | |
Aankhen`` | Yeah. | ||
castaway | Its like giving someone a car without them haven taken lessons .. what do all the knobs and buttons and levers do? | ||
theorbtwo | Thank god it's so hard to get a computer to run over people. | ||
castaway | indeed.. easy to get it to spam people tho | 12:58 | |
Aankhen`` | castaway: Yeah, with a manual that shows you how the CD player is different from others. | ||
castaway thinks the "computer driving licence" idea is still a good one | |||
Aankhen`` | Or how the six-speed manual transmission can be switched to a four-speed automatic transmission. | ||
12:58
autark is now known as jp-autark
|
|||
Aankhen`` | Mmm, I don't really care about a computer driving license... | 12:58 | |
I do care about a "computer instruction license" though. | 12:59 | ||
castaway | whichever you call it | ||
Aankhen`` | Almost all instructors I have ever met have been completely clueless. | ||
castaway | but just better manuals would help a lot... they'd just have to be huge | ||
theorbtwo | I've never met a computer instructor other then myself and the guy I worked with (who did most of the instruction). | ||
Aankhen`` | My pet peeve is Web development. | 13:00 | |
castaway | whats that got to do with users? :) | ||
Aankhen`` | "Every Tom, Dick and Harry can build a Website these days..." Heck no, they can't. They can mash together a bunch of angle brackets and letters. They can't build Websites. | 13:01 | |
Oh, nothing, I just wanted to hijack the converstion. :-D | |||
theorbtwo | Lots of users try to do web development these days. | ||
nothingmuch | colspan-- | ||
theorbtwo | However, thank the many gods, they don't really mess up other people. | ||
Aankhen`` | theorbtwo: Could you elaborate on "users"? | ||
theorbtwo | People without the ability to read and understand w3 specs, or even realize that such specs exist. | 13:02 | |
Aankhen`` | Ah, those people. | ||
theorbtwo | s/w3/w3c/ | ||
Aankhen`` | Actually, every one of them does mess up other people, since pretty much everyone starts out by copying other people's code. | ||
castaway | what annoys me (more) is that some then think they know something, and write "HowTos" for others, which spreads the crap | 13:03 | |
theorbtwo | They don't mess up other people in the same way that not being firewalled does, or driving like you have no idea that there are such things as road laws. | ||
castaway | (I little bit of knowledge can be a dangerous thing) | ||
Aankhen`` | theorbtwo: Ah, that's true. | ||
castaway | s/I/A/ | ||
Aankhen`` | castaway: Aye aye! | ||
castaway ponders 'net "pollution" laws ,9 | 13:04 | ||
Aankhen`` | LMAO. | ||
castaway++ | |||
theorbtwo | I'm very glad that new installs of winxp now come with the firewall enabled by default. | ||
castaway | lets spin off a separate network for professionals and leave these people to their junk.. (wait, wasnt that how the internet started.. ?) | ||
Aankhen`` | Heh. | ||
theorbtwo | The thing is that I'm /very/ reticent to get the law any more involved in the internet then it already is. | ||
castaway didnt really mean a governmental law | 13:05 | ||
theorbtwo | What did you mean, then? | ||
theorbtwo ponders ISPs giving "good netizen" discounts. | 13:06 | ||
Aankhen`` | Another spec, like WCAG. ;-) | ||
castaway | some sort of self preservation / higher echelon / test .. | ||
Aankhen`` | OK, I'm off. | 13:07 | |
Gonna go watch Madagascar. | |||
Later. | |||
castaway | have fun | ||
Aankhen`` | Thanks. :-) | ||
theorbtwo | Later, Aankhen -- nice chattering with you. | ||
Aankhen`` | BBL. & | ||
autrijus | rehi! | 13:28 | |
nothingmuch | hola | 13:32 | |
autrijus | heya nothingmuch. what's up? | 13:33 | |
QtPlatypus | autrijus: Would it be approprate to place the GC API documentation I've been discussing on p6l in the Pugs documentation tree? And if so where whould be most approprate? | 13:36 | |
autrijus | docs/notes/ is the default stash area. | ||
QtPlatypus | Thanks. | ||
autrijus | np :) | 13:37 | |
autrijus is, sadly, deep in $job $deadline foo | |||
castaway | ick, deadlines | ||
autrijus | right. I love the sound of them whooshing by | ||
no such luxury this time though, it seems :) | |||
kolibrie | I work better without deadlines | 13:41 | |
autrijus | me too :) | 13:42 | |
stevan | $deadlines-- | 13:43 | |
stevan has several $deadlines all one after the other | |||
castaway | don't we all? just these pesky customers that need them | ||
Limbic_Region | um - are underscores supposed to work as comma like breaks in numbers as in p5? | ||
autrijus | Limbic_Region: I have no idea. so I presume "default yes" | ||
Limbic_Region | if so - then there is a parse bug | 13:44 | |
autrijus | nod | ||
Limbic_Region | ?eval for 1 .. 1000 { } 'foo' | ||
evalbot6 | 'foo' | ||
Limbic_Region | ?eval for 1 .. 1_000 { } 'foo' | ||
evalbot6 | Error: No compatible subroutine found: "&_000" | ||
autrijus | tests welcome | ||
Limbic_Region | yeah yeah yeah | 13:45 | |
Limbic_Region was actually looking into an apparent rand() bug | |||
autrijus | :) | ||
Limbic_Region | I will see what I can do - time permitting | 13:46 | |
autrijus | the fix belong on src/Pugs/Parser/Number.hs line 89 | ||
somewhat tricky though, as 1__2 is legal but 1__2_ is not | |||
hrm, wait, it is legal | 13:48 | ||
castaway | (careful with "as comma", thats a dot over here :) | ||
autrijus | even 1_______._______ is legal | ||
craziness. | |||
castaway | fugly ,) | 13:49 | |
autrijus | indeed | ||
PerlJam | What's crazy is that 1_____._____3 == 1.3 | ||
castaway | which evaluates to 1 ? | 13:50 | |
that too | |||
autrijus | ok, fixed. | 13:51 | |
committing | |||
theorbtwo | Eh, it's just s/_//g, AFAIK. What's so complicated | crazy about that? | 13:56 | |
QtPlatypus | theorbtwo: Its not the stripping, its the parsing of numbers. | 13:57 | |
autrijus | also, _1 does not work | ||
but 0x_1 does | |||
(which I got wrong, so still fixing) | 13:58 | ||
hm | 13:59 | ||
0x | |||
works | |||
as "0" | |||
even more craziness. | |||
castaway boggles :) | 14:00 | ||
autrijus | I give up full emulation for now :) | 14:01 | |
autrijus checks in the common case | |||
Limbic_Region | sorry - had $work | 14:03 | |
so now that it is fixed, I will write a test if/when I get a chance | |||
but now I have a question about rand() | |||
how large a sample, statistically speaking, should I need to see if there is a flaw when choosing 1 .. 10 randomly | 14:04 | ||
theorbtwo | Hm? Are you implementing your own RNG, or just using Haskell's? | ||
autrijus | theorbtwo: I'm using System.Random | ||
?eval rand(2) | |||
evalbot6 | 1.7793987013351635 | 14:05 | |
autrijus | ?eval rand(2) | ||
evalbot6 | 0.9534177356291138 | ||
theorbtwo | In that case 1) You shouldn't need to do /too/ much testing of that. 2) Doing good testing of it is hard. | 14:08 | |
Start with a chi-squared test. | |||
Limbic_Region | ok - it looks like the anomoly is going away with a large enough sample size | 14:09 | |
svnbot6 | r6280 | autrijus++ | * Allow underlines inbetween digits: 0xFF_FF etc. | ||
r6280 | autrijus++ | * Trailing underline works too. | |||
r6280 | autrijus++ | * Leading underline currently unsupported; Perl5's "0x__" | |||
r6280 | autrijus++ | and "0x" are not yet available. | |||
Limbic_Region | what I was seeing with a smaller sample size was the equivalent of flipping a coin and getting heads 8 times in a row | 14:10 | |
QtPlatypus | Limbic_Region: That is possable. Even a ballence coin will do that. | 14:12 | |
Limbic_Region | out of curiosity - does p5 have tests specifically designed for parse errors? Such as the 1_000 vs 1000 thing? | ||
QtPlatypus - I know, which is why I was asking how large a sample was needed to even out the distribution before you could say statistically the coin was fixed | 14:13 | ||
Limbic_Region left his statistics books at home (or in Maine come to think of it) | |||
theorbtwo | There's no such thing as "statistically certian" -- the sample size depends on how sure you want to be. | 14:14 | |
...and my web browser is being obnixious again. | |||
Limbic_Region | theorbtwo - you are mixing theory and practicality - when you start applying the results of the statistical analysis to the real world you can be certain that there is a flaw | 14:16 | |
because you don't get an infinite number of flips | |||
PerlJam | Limbic_Region: um ... where's the parse error in 1_000 vs 1000 ? | ||
QtPlatypus | Limbic_Region: Hold on I have a copy of the art of computer programing, it has a chaper on this. | ||
Limbic_Region | PerlJam - it was just fixed | ||
see 6280 | |||
autrijus stops checking pugs store report every half hour ;) | |||
PerlJam | oh, I see what you're saying (just looked at this window and took your query out of context) | 14:17 | |
Limbic_Region | autrijus - you haven't written a WWW::Mechanize script to do that for you | ||
autrijus | ...it's always $0.00, not particuarly exciting | ||
Limbic_Region: that's a good idea. | |||
Limbic_Region hates coding anything web related but thanks petdance and others for nifty tools like WWW::Mechanize | 14:18 | ||
theorbtwo does some googling, finds that he's forgotten an awful lot of stats. | 14:19 | ||
QtPlatypus find the bit that he was looking for | |||
theorbtwo | L~R: Re mixing theory and practicality, I don't think I am. | 14:20 | |
QtPlatypus | Knuth suggest 1000 as a minim for a computer chi-square test | 14:21 | |
Limbic_Region | *shrug* | ||
theorbtwo | If you tell me you want to be 99% certian that your coin is fair, I can tell you that you should flip it N times. | ||
If you tell me you want to be 100% certian, I can tell you that you should go home. | 14:22 | ||
Limbic_Region | I guess I am not being clear | 14:23 | |
there either is or isn't a flaw | |||
the statistics can't prove that there is or isn't with 100% certainty | 14:24 | ||
but in the real world, you can find out for sure | |||
the statistics just give you an idea of weather or not to bother looking | |||
QtPlatypus | Limbic_Region: Its a algorthimic RPG. By some definitions its inherently flawed. | ||
theorbtwo | In the real world you can't find out anything for sure -- you can just be reasonably certian. | 14:25 | |
You can even be unreasonably certian. | |||
Limbic_Region | a set of crap die is either loaded or not | ||
theorbtwo | I'm not even certian there's a real world at all. | ||
Limbic_Region | well, neither am I | 14:26 | |
theorbtwo | Intentionally loaded is easy to find out. | ||
Limbic_Region | exactly | ||
anyway - I have to wander off for $work | |||
theorbtwo | A flaw in the dice that makes them not quite fair is a lot harder. | ||
I once had a dice that wasn't fair from a manufacturing error. | 14:27 | ||
QtPlatypus nods "How much do these dice differ from a set of perfect dice" | |||
theorbtwo: How did you discover that? | |||
theorbtwo | Qt: Rolled it a fair number of times, noted occourances. | 14:28 | |
Also, examined the dice, noticed one of the sides wasn't flat. | |||
QtPlatypus nods. | |||
Then started using it to cheat at RPGs? | 14:29 | ||
:D | |||
theorbtwo | Thought about it, Qt. | 14:32 | |
I don't remember if it was a d6 or a d10. | |||
In any case, I find roll-every-3-seconds RPGs annoying. | |||
fglock_ | stevan: ping | 14:33 | |
autrijus: ping | 14:35 | ||
autrijus | fglock_: pong | 14:37 | |
fglock_ | the Scalar object is a kind of proxy to it's Value? Such as $x++ calls increment on it's value | 14:38 | |
autrijus | hm, a value never has state, so that's not quite that | ||
$x++ calls increment on the scalar, which FETCH its value, remember that value, do something magically incrementing, store it back, returns the rememberd value. | 14:39 | ||
fglock_ | but I can't implement every possible method on Scalar, so I was thinking of something like an autoload | 14:40 | |
I implemented $value.increment as a function that returns a new value | 14:41 | ||
autrijus | that is fine | 14:42 | |
Limbic_Region | pardon my ignorance and my intrusion and interest in premature optimizations but ... | 14:43 | |
will prefix increments be more efficient than postfix as in C and p5 ? | |||
and if so, will the optimizer silently convert postfix to prefix when/where possible? | 14:44 | ||
fglock_ | Limbic_Region: I don't think it is possible to see any difference at this point | 14:45 | |
because of the object overhead | |||
autrijus: so a Scalar has to respond to map, grep, join, increment, decrement ... - it depends on what is stored inside it | 14:47 | ||
autrijus | fglock_: aye | ||
fglock_ | is there a 'default' method in the metamodel, that could be used to dispatch unimplemented methods? | 14:51 | |
autrijus | yes, see AUTO* | 14:52 | |
AUTOMETH is probably what you're looking for. | 14:53 | ||
Limbic_Region is finishing up a test for _ in numbers but I have this vague recollection that _ wasn't the only separator that could be used? | 14:56 | ||
autrijus | it probably is | 14:57 | |
fglock_ | is a Scalar more or less like a "rw" Reference? | ||
autrijus | fglock_: a scalar is exactly a rw reference. a tieable scalar is something more. | 14:58 | |
(a tieable scalar is a rw reference that can optionally hold an associated object) | |||
fglock_ | but references should not auto-deref, otherwise they would be just like the value they point to | 15:03 | |
autrijus | fglock_: right, but scalar automagically deref when a value is demanded | 15:04 | |
i.e. it delegates FETCH and method calls transparently. | |||
it's also very confusing. | |||
(but it seems all languages derived from C shares this confusion) | 15:05 | ||
fglock_ | and a Reference doesn't do that, right? | ||
autrijus | a refernce does that if it's pointing to a non-scalar container. | ||
but does not do that if it's pointing to a scalar container. | |||
a scalar container points to values; reference points to containers. | |||
so they are also differently typed. | 15:06 | ||
fglock_ | so "\1" is the same as "1", because a reference to a value is flattened? | 15:07 | |
autrijus | no. | 15:08 | |
\1 first creates a constant scalar container | |||
holding the value 1 | |||
and then create a reference | |||
pointing to that container | |||
it's now pinting to a scalar container | |||
so is _not_ flattened. | |||
fglock_ | ok | 15:09 | |
thanks autrijus - I'm going for lunch now & | 15:10 | ||
autrijus | np :) | ||
Khisanth | hmm | 15:14 | |
autrijus: if you have $foo = \1; and $bar = \1; will they both be refering to the same scalar? | |||
autrijus | Khisanth: the answer is "we make no guarantee" :) | 15:15 | |
consequently, "1 =:= 1" is either ill-timed, or undefined. | 15:16 | ||
PerlJam | "ill-timed"? I like that :) | 15:17 | |
autrijus | er. ill-typed. | ||
thinko. | |||
theorbtwo | I think implementation-dependent is the best way to handle it. | 15:20 | |
That, or false. | |||
autrijus | *nod* | ||
theorbtwo | 0 but true =:= 0 must be false. | ||
autrijus | sure, that's w/o doubt. | ||
"0 but true" is not a intrinsic anyway. | |||
it's a fully boxed Int object | |||
Limbic_Region | autrijus - underbars are allowed in any kind of number (hex, binary, floating point, etc) - does your fix work in all those cases? | 15:21 | |
theorbtwo | Hm, I assumed 0 was an Int, not an int, but come to think of it there's no reason for it to be. | ||
autrijus | Limbic_Region: yes, but not 0x_ | 15:23 | |
Limbic_Region: pugs consider 0x to be prefix | |||
but perl5 considers it part of number | |||
Limbic_Region | ok - waiting for Pugs to finish compiling so I can verify all the tests I have currently pass | 15:25 | |
3.14_15_926 will parse just fine where as 3._1415 will fail correct? | 15:26 | ||
?eval for 1 .. 1_0 { } 'foo' | 15:27 | ||
evalbot6 | 'foo' | ||
Limbic_Region | ?eval for 1 .. 3.14_15 { } 'foo' | 15:28 | |
evalbot6 | Error: No compatible subroutine found: "&_15" | ||
Limbic_Region | autrijus - looks like it needs some work | ||
?eval my $foo = 3.14 + 3.1_4; $foo | 15:29 | ||
evalbot6 | Error: unexpected "_" expecting digit, exponent, term postfix, operator, ">>+|<<", ">>+^<<", ">>~|<<", ">>~^<<", ">>?|<<", ">>+<<", ">>-<<", ">>~<<", "\187+|\171", "\187+^\171", "\187~|\171", "\187~^\171", "\187?|\171", "\187+\171", "\187-\171", "\187~\171", "+|", "+^", "~|", "~^", "?|", "+", "-", "~", ";" or end of input | ||
ods15 | ugh | ||
theorbtwo | Is evalbot running an up-to-date version? | 15:30 | |
Limbic_Region | well - it croaked before on 1 .. 1_0 so I think so | ||
?eval my $foo = 10 + 1_000; $foo | 15:31 | ||
evalbot6 | \1010 | ||
theorbtwo | OK then. | ||
ods15 | hmm, didn't know there's an eval bot here | ||
what happens if i do '?eval exit()' ? | |||
Limbic_Region | TIAS | 15:32 | |
?eval exit() | |||
evalbot6 | Error: No compatible subroutine found: "&exit" | ||
ods15 | i'm guessing that means "try it and see" | ||
Limbic_Region | yep | ||
ods15 | ?eval exec "nil" | ||
evalbot6 | Error: No compatible subroutine found: "&exec" | ||
ods15 | ?eval system "ls" | ||
evalbot6 | Error: No compatible subroutine found: "&system" | ||
ods15 | ?eval $$ | ||
evalbot6 | Error: unexpected "$" expecting "::" | ||
Limbic_Region | ods15 - it isn't a "safe" bot | ||
err - it is a "safe" bot | 15:33 | ||
ods15 | hehe | ||
?eval 3+5 | |||
evalbot6 | 8 | ||
ods15 | ?eval fork | ||
evalbot6 | Error: No compatible subroutine found: "&fork" | ||
ods15 | cool | ||
Limbic_Region | ods15 - the source code is available in the distribution | 15:34 | |
if you would like to find some flaws in it - please look there | |||
ods15 | nah, maybe later. and what distrobution? | ||
autrijus | ods15: svn.openfoundry.org/pugs is the svn repo | 15:35 | |
ods15 | hmm, what's pugs.. | 15:36 | |
sounds like "perl bugs" | |||
PerlJam boogles that anyone would be here and not know what pugs is | |||
Limbic_Region | autrijus - I am going to check in the test for the numbers and underscores with pugs breaking - hope that is ok | ||
QtPlatypus | pugs -> perl6 users golfing systems. | ||
(Please remove the extra s's) | 15:37 | ||
ods15 | PerlJam: for a while, i thought pugs was a perl6 bug tracking system | ||
Limbic_Region | well - that is as soon as pugs is finished compiling | ||
theorbtwo | ods15: Pugs is an implementation of perl6. | ||
autrijus | Limbic_Region: fixed, committing | ||
ods15 | i know that now :P | ||
i'm just goofing | |||
bug for quite a while i was here i didn't know that | 15:38 | ||
anyway bbl | |||
QtPlatypus thinks its a pun on hugs, a hascal implimentation. | |||
autrijus | s/hascal/haskell/ but yes. | ||
I didn't know what pugs are when I came up with the name. | 15:39 | ||
Limbic_Region | autrijus - alright - test will be comitted sometime later today then as I need to do $work now and another rebuild will take forever | ||
autrijus | I had to google it ;) | ||
Limbic_Region: "make unoptimised" | |||
Limbic_Region: but thanks! | |||
svnbot6 | r6281 | autrijus++ | * recognize underscores in fractional part, too. | 16:16 | |
r6281 | autrijus++ | Limbic_Region++ for reporting this. | |||
r6282 | autrijus++ | * cosmetic cleanup to STATUS | |||
kgftr|konobi | thegestalt.org/simon/perl/wholecpan.html - Autrijus is 1 module off 100!!! | 16:33 | |
Aankhen`` | Just a note: I'm going out of town on Friday, will be back around the beginning of next month. | 16:34 | |
autrijus | kgftr|konobi: it depends on how you count :) | ||
fglock | re metamodel1: is there a simple way to obtain the class and class name of an object? | 16:35 | |
svnbot6 | r6283 | fglock++ | * perl5/ runtime: updated TODO; tests | ||
r6284 | fglock++ | * perl5/ runtime: renamed directories | |||
autrijus | fglock: .ref perhaps? stevan had not implemented it iirc | 16:36 | |
Aankhen`` | Is AUTOMETH like AUTOLOAD? | ||
autrijus | .ref is the class, and .ref.name would be name (iirc, not 100% sure) | ||
fglock | I'm implementing .ref :) | ||
autrijus | Aankhen``: yes, but only for methods | ||
Aankhen`` | I figured that part out all by myself. ;-) | ||
What I didn't figure out, though, was whether it should be declared as a sub or a method. | 16:37 | ||
PerlJam | Isn't AUTOMETH mostly for introducing method names and AUTOMETHDEF for actually introducing the method | ||
? | |||
PerlJam has hazy memory | |||
autrijus | PerlJam is correct. | 16:43 | |
Aankhen`` | So how does it work? | ||
(in other words: example? :-D) | |||
autrijus | Aankhen``: S10 :) | ||
and A12 iirc. | 16:44 | ||
A12 is like Finnegan's Wake -- _everything_ is in it | |||
Aankhen`` | Heh. | 16:45 | |
I hope A12 gives actual examples. | |||
Apparently not. :-( | 16:46 | ||
PerlJam | A12 is like a dream of what could be. Only the dream needs to be specced. | 16:47 | |
autrijus | guido mailed back saying that he appreciates the pugs project, but alas, he does not have time to participate. | 16:49 | |
oh well, one less entry in AUTHORS :) | |||
PerlJam | er, what exactly would he have done? | ||
autrijus | PerlJam: I don't know, perl6->python backend perhaps? | 16:50 | |
...or the other way around | |||
PerlJam | yeah, that sounds slightly better. | ||
I can't really imagine the first one. | |||
autrijus | mm? python bytecode is not unlike parrot bytecode. | 16:52 | |
so it's actually the easier one | |||
Aankhen`` | QtPlatypus++ # GC API | 17:02 | |
svnbot6 | r6285 | fglock++ | * perl5/ object .id() works | ||
fglock | I found out how to get the Class from the object, now I need to get the MetaClass from the Class... | 17:06 | |
found it: ::dispatch( ::meta( $p->ref ), 'name' ) | 17:10 | ||
autrijus | ooh there are helicopters from helsinki to talinn | 17:18 | |
regular commuting 'copters | |||
wolverian | one just went down a week ago or so. | ||
autrijus | er. | 17:19 | |
not very encouraging | |||
wolverian | passengers and two pilots died. | ||
no, not very. :) | |||
autrijus reconsiders | |||
wolverian | but then again, they haven't had problems before, and they've flown for quite a while now. | ||
the fast ships are nice, too, as long as the wind doesn't make the sea too choppy. | 17:20 | ||
fglock | can I get a Class from a MetaClass? | ||
autrijus | fglock: well, they should be the same thing when you are working on the backend | 17:32 | |
svnbot6 | r6286 | autrijus++ | * Single-argument calls with object as the argument should | 17:33 | |
r6286 | autrijus++ | dispatch to method: | |||
r6286 | autrijus++ | close $fh # same as $fh.close | |||
r6286 | autrijus++ | Reported by Yiyi Hu. | |||
r6287 | fglock++ | * perl5/ - added 'Ref' class skeleton. | |||
r6287 | fglock++ | will need more info on the MetaModel to make this work | |||
autrijus | fglock: consult stevan for more information :) | ||
(as I need to sleep now, sadly) | |||
fglock | autrijus: I tried calling metaclass->new, but it doesn't return an instance | ||
autrijus | $ALL_CLASSES{$name} ? | 17:35 | |
you can get name from metaclass surely? | |||
or identifier | |||
fglock | yes, name works | ||
autrijus | cool | 17:36 | |
fglock | $Perl6::Class::ALL_CLASSES{$name} seems to work | 17:39 | |
yes it does :) | 17:40 | ||
autrijus | :)) | ||
fglock++ # rock on! | |||
no journal today, too tired... /me waves & | |||
fglock | good night | ||
Aankhen`` | Nite autrijus. | ||
Supaplex | speaking of which, $fh.close, fh.close and fh.close() are identical, are they not? I know .js handles foo and foo() differently. foo() calls the method, and foo returns the source for that method. | 18:13 | |
svnbot6 | r6288 | fglock++ | * perl5/ Value - code cleanup | ||
wolverian | fh.close? what's fh? | 18:19 | |
Qiang | file handler | 18:22 | |
wolverian | fh.close in perl6 is the same as fh().close() | ||
I'm not sure if that was what Supaplex asked, though :) | |||
kolibrie | I'm looking at WWW-Kontent, but get a pugs parse error when trying to make_root | 18:26 | |
unexpected "{" | |||
expecting trait, ";" or end of input | |||
at ./WWW/Kontent/Store.pm line 188, column 30 | |||
which is this line: | |||
class WWW::Kontent::Revision { | |||
any ideas? | |||
fglock | I've seen this many times - it means there is an error _anywhere_ in the class | 18:27 | |
kolibrie | oh joy! | ||
fglock | the best way to find out is to diff with a working version | 18:28 | |
kolibrie | well, it parsed with an older pugs, but had a runtime error, so I updated my pugs | ||
svnbot6 | r6289 | Limbic_Region++ | Added tests for parsing numbers with underscore | 19:06 | |
autrijus | fglock:, kolibrie | ||
try taking off the "try" | |||
in Parser.hsline 301 | |||
that may give much more accurate error messages. | |||
(it makes the class pasing rule non-backtrack) | |||
I don't know whether that will cause more problems elsewhere though. try different tries :) | 19:07 | ||
autrijus goes back to sleep & | |||
kolibrie | ok | ||
thanks for the hint autrijus | |||
autrijus | np :) | ||
19:19
spinclad is now known as spinclad__
19:20
spinclad__ is now known as spinclad___
|
|||
kolibrie | ah, error is now: | 19:21 | |
unexpected "f" | |||
expecting digit, "_", exponent, term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or "}" | |||
at ./WWW/Kontent/Store.pm line 205, column 71 | |||
which is this line: | 19:22 | ||
method driver(Request $r) returns Void { ._fill_revclass(); $._revclass.driver_($r) } | |||
19:22
spinclad___ is now known as spinclad
|
|||
kolibrie | so the ._fill_revclass() is not understood | 19:22 | |
any ideas? | 19:23 | ||
theorbtwo | Hm, get rid of that leading _, and see if it still parses? | 19:25 | |
It's possible that it's thinking that should be a number, like ._3, meaning .3 -- autrijus was just working on that earlier today. | |||
kolibrie tries | 19:26 | ||
autrijus | right, exactly. | ||
sigh. | |||
fixing. | 19:27 | ||
kolibrie | yep, seems to be true, parses fine without the _ | 19:28 | |
autrijus | fixed. committing | ||
kolibrie | autrijus++ # fixing bugs while sleeping | 19:29 | |
autrijus | that seems to be my specialty | ||
theorbtwo should remember not to use aut's name while he is (theoretically) sleeping. | 19:34 | ||
kolibrie waits for aut's commit to be available | 19:37 | ||
autrijus | it's ambiguous. | 19:39 | |
say 1.__e4 | |||
in p5 it's clearly 10000 | |||
I have _no_ idea about p6. | |||
thoughts? | |||
kolibrie also has _no_ idea | 19:40 | ||
autrijus | maybe disallowing underscores in fractional parts? | ||
I think that's sanest. | |||
theorbtwo | Or disallowing underscores just before or after the . in floating-point numbers. | 19:41 | |
autrijus | before is fine. | ||
1.e__4 | |||
is 10000 in perl5. | 19:42 | ||
I'm pretty sure we want it to be a method call in p6. | |||
0x1.fe_ff_ff_f9 | |||
;) | |||
theorbtwo | I think so too... and that wouldn't be under my rule. | ||
autrijus | so I think disallow is safer now. | ||
theorbtwo | That looks like a number to me. | ||
0x1.fe_ff... that is. | |||
autrijus | but isn't it a method called fe_ff_ff_f9? | 19:43 | |
theorbtwo | That'd be a really silly name for a method. | ||
autrijus | 0xFF.dead; | ||
0xFF.add; | |||
theorbtwo | Point. | ||
kolibrie | yep, must be a method | ||
theorbtwo | It doesn't come up for anything but hex, so it's not that important to me. | 19:44 | |
autrijus | 1.44_44_12 | ||
theorbtwo | Hex fractions don't seem that useful. | ||
autrijus | is a number clearly | ||
theorbtwo | Can't be a method -- method names can't begin with digits. | ||
autrijus | 1.e10 | ||
is again ambiguous. | |||
and it doesn't even involve underscore. | |||
theorbtwo | Method. If you want number, write 1e10 with the same meaning. | ||
autrijus | ok. so if it can be a method | 19:45 | |
it is a method | |||
integral | almost need a numeric quote operator with delimiters, q:number"1.e10" | ||
autrijus | does that sound okay? | ||
theorbtwo | I think so, yeah. | ||
kolibrie | if ambiguous, choose method over number, sounds good | 19:46 | |
autrijus | r6290. enjoy | 19:50 | |
it passes parsing_numbers.t | 19:51 | ||
more tests welcome there. | |||
& | |||
kolibrie | thank you | 19:53 | |
svnbot6 | r6290 | autrijus++ | * Disallow underscore and 'e' after dots, as that conflicts with method | ||
r6290 | autrijus++ | name resolution. Reported by kolibrie. | |||
r6290 | autrijus++ | 1.e10 # method call | |||
r6290 | autrijus++ | 1._10 # ditto | |||
spinclad | the longest-possible-token rule, common among languages, would want those to be numbers. | 19:59 | |
don't know if perl*, and perl6 in particular, has that rule, though. | 20:00 | ||
Limbic_Region | autrijus - according to perldata underscores are only allowed between digits | 20:02 | |
for p5 anyway | |||
sorry it took so long to commit - $work has been busy | |||
spinclad | 0x1.e10 is ambiguous three ways -- is that e a digit, exponent mark, or alpha? | ||
Limbic_Region | and besides - I am officially not working on Pugs anymore | ||
;-) | |||
20:05
Aankh|Clone is now known as Aankhen``
|
|||
xinming | hmm... $obj.update; without any arguments, Can it be written in this form, `update $obj;` | 20:05 | |
Limbic_Region | yucky poo poo | 20:06 | |
Aankhen`` | ?eval any<a b c d> eq "a" | 20:07 | |
evalbot6 | bool::false | ||
Aankhen`` | ?eval "a" eq any(<a b c d>) | ||
evalbot6 | bool::false | ||
Aankhen`` | Hmm. | ||
xinming | hmm... In Synoposis said it's valid. But in Pugs, It won't allow you to use this. | ||
which one should I follow please? | |||
I've send this question to mailing list. But it doesn't seem that anyone who cared about my question. | 20:08 | ||
iblech | Hi :) | ||
Aankhen`` | Hi iblech. :-) | ||
xinming | iblech: hi | ||
iblech | ?eval ?(any<a b c d> eq "a") | ||
evalbot6 | bool::false | ||
iblech | Hrm | ||
Aankhen`` | iblech: Should that work? | ||
(I would have thought it should) | |||
iblech | It should | ||
Aankhen`` | OK. | ||
Limbic_Region | it has in the past IIRC | ||
iblech | ?eval ?(any("a", "b", "c", "d") eq "a") | ||
evalbot6 | bool::true | ||
iblech | ?eval ("a", "b", "c", "d") | 20:09 | |
evalbot6 | ('a', 'b', 'c', 'd') | ||
iblech | ?eval <a b c d> | ||
evalbot6 | ('a', 'b', 'c', 'd') | ||
iblech | ?eval <a b c d>[0] eq "a" | ||
Limbic_Region | ?eval any('a', 'b', 'c') eq 'a' | ||
evalbot6 | bool::true | ||
bool::false | |||
Aankhen`` | It's not urgent... I'm converting some of my "hobby" modules to Perl 6, and a lot of other stuff doesn't work yet anyway. | ||
?eval sub foo (*&cb, *@params) { &cb.(*@params) } | 20:10 | ||
evalbot6 | undef | ||
Aankhen`` | ?eval sub foo (*&cb, *@params) { &cb.(*@params) }; foo({ @_ }, "a", "b") | ||
evalbot6 | Error: Undeclared variable: "@_" | ||
Aankhen`` | ?eval sub foo (*&cb, *@params) { &cb.(*@params) }; foo(sub { @_ }, "a", "b") | ||
evalbot6 | ['a', 'b'] | ||
Aankhen`` | Kewl. | ||
?eval sub foo (*&cb, *@params --> List) { &cb.(*@params) }; foo(sub { @_ }, "a", "b") | |||
evalbot6 | ['a', 'b'] | ||
Aankhen`` | ?eval sub foo (*&cb, *@params --> List) { &cb.(*@params) }; foo("a", "b"):sub { @_ } | 20:11 | |
evalbot6 | Error: Undeclared variable: "@_" | ||
Aankhen`` | ?eval sub foo (*&cb, *@params --> List) { &cb.(*@params) }; foo("a", "b"):(sub { @_ }) | ||
xinming | ?eval ('a'|'b'|'c') eq 'a' | ||
?eval 'a'|'b'|'c' eq 'a' | |||
evalbot6 | Error: unexpected ":" expecting word character, block construct, term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input | ||
bool::false | |||
iblech | Hm, I think a slurpy code parameter makes the sub accept a adverbial block | ||
Aankhen`` | Um, sorry for the spam. I'll go back to the interactive shell. | ||
iblech: Not a sub, then? | |||
iblech | xinming: Because of a bug in evalbot/.perl/whatever, you probably need to ?(...) your expressions | 20:12 | |
Aankhen`` | OK. | ||
iblech | I mean, foo(@params):{...} would then work, probably | ||
But I'm not the adverbial modifiers expert, we should better ask putter :) | 20:13 | ||
Aankhen`` | Heh, check this out: pugs> sub foo (*&cb, *@params) { "abcd" }; foo():{ @_ } <== <a b c d> | ||
(undef, undef, undef, undef, undef) | |||
spinclad | (re: number formats) perldata doesn't make clear whether hex numbers can have a fractional part or exponent; i would guess yes based on orthogonality, no based on ambiguity. | 20:14 | |
xinming | ?eval ?('a'|'b'|'c' eq 'a') | ||
neither worked. T_T | |||
evalbot6 | bool::true | ||
xinming | iblech: can `$obj.update;` be written in this form: `update $obj;` ? | ||
Aankhen`` | xinming: update $obj:; | ||
# perhaps that might work? | |||
iblech | xinming: Yep, I think. It's a special case. If you've got more than one argument, you need the colon, though | 20:15 | |
i.e. update $obj will work, but update $obj, $foo won't. To make it work, you'd have to write update $obj: $foo | |||
svnbot6 | r6291 | iblech++ | * t/syntax/parsing_numbers.t: Added tests for 1.e23 etc. | ||
r6291 | iblech++ | * Usual svn props. | |||
xinming | Aankhen``: I know that works. But I wonder if the example I give is also valid. | 20:16 | |
with `:`, It will work, how about without `:`? | |||
Aankhen`` | xinming: iblech just gave you the answer, didn't he? :-) | ||
xinming | iblech: hmm, So, This might be a really "small" bug in pugs. | 20:17 | |
:-) | |||
?eval 3+5 | |||
evalbot6 | 8 | ||
xinming | oops, It seems that the bot ignored me. :-S | ||
or autrijus is tuning his bog. | |||
bot. | 20:18 | ||
s/bog/bot/ | |||
iblech | I've thought autrijus fixed the bug? | ||
?eval class A { method b () { "c" } }; b A.new | 20:19 | ||
evalbot6 | 'c' | ||
iblech | :) | ||
?eval class A { method b () { "c" } }; b A.new: | |||
evalbot6 | 'c' | ||
xinming | ?eval class T { method update { 'updated'.say; } }; my T $o .= new; update $o; | 20:20 | |
evalbot6 | updated bool::true | ||
xinming | Yes,It's fixed. :-) | ||
after reading more Synoposis, I found now, the keyword package has 3 usages. one is for acting as a 'signature' for perl 5, another is for using tie, and last is used for user defined libs, Is my opinion right? | 20:27 | ||
svnbot6 | r6292 | iblech++ | * t/syntax/parsing_numbers.t: Added link to p6l post. | ||
r6292 | iblech++ | * PIL2JS: PIL::PExp wasn't calling the ->as_js of the expr it contains, | |||
r6292 | iblech++ | resulting in nothing working. Fixed. | |||
iblech | xinming: For tie, you need classes, not packages. | ||
But the rest is ok, I think. | |||
(And note that the difference between package and module is very blurred.) | 20:28 | ||
xinming | ?eval given '3' { when 1 { 1 }; when 3 { 3 };} | ||
evalbot6 | 3 | ||
xinming is still wondering if the keyword package will be obsolete after perl 6 rules the world. | 20:33 | ||
?eval class C { has $.a = 1; }; | 20:35 | ||
I think autrijus is compiling the new version of pugs. :-) | |||
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
iblech | has with assignment doesn't parse, known bug. | 20:37 | |
Already tested for in t/oo/attributes/class.t, I think | 20:38 | ||
xinming | ?eval class C { has $.a; has $.b; }; my C $o .= new; $o{'a'} = 1; $o.keys; | 20:41 | |
evalbot6 | Error: Not a keyed reference: VObject (MkObject {objType = (mkType "C"), objAttrs = <ref>, objOpaque = Nothing, objId = 52}) | 20:42 | |
iblech | spinclad: Luke replied to my post on p6l WRT the ambiguity of parsing numbers -- want to reply with your "but it against the longest-token rule"? | ||
$o.keys should definitely not work, unless C isa Hash. | |||
But I did read something in one of the apocalypses that $o<a> should work | 20:43 | ||
Not sure, though | |||
Want to ask p6l? :) | |||
spinclad | sure | ||
iblech | Great :) | 20:44 | |
xinming | iblech: in fact, I wonder if that the object is still a blessed reference :-) | 20:46 | |
blessed anonymous reference. | |||
iblech | It is blessed, but (by default) it's not a hashref, but a P6Opaque | 20:47 | |
P6Opaque is like a hashref, only that it has got compile-time typo checks and a much more compact storage and much more :) | |||
xinming | hmm. wish the class is a blessed hashref, then, some perl 5 codes might be easier to migerate to perl 6 | 20:52 | |
?eval class C { has $.a; has $.b; }; my $t = C.bless({'a' => 1 }); $t.keys; | |||
evalbot6 | Error: No compatible subroutine found: "&bless" | ||
xinming | ?eval class C { has $.a; has $.b; }; my $class = "C"; my $t = $class.bless({'a' => 1 }); $t.keys; | 20:54 | |
evalbot6 | Error: No compatible subroutine found: "&bless" | ||
iblech | This will probably work eventually. | ||
xinming | iblech: will the $object be a hashref always by default in perl 6? | 20:56 | |
iblech | No. But you can use .bless to override that default | 20:57 | |
Because with hashrefs, it's not possibly to do compile-type typo checks and have a much more compact storage etc. :) | |||
xinming | so my $c = $class.bless; will do what I want, without specify the bless({}); ? | 20:59 | |
iblech | No, you do need the {} | ||
Sorry if I was unclear | |||
xinming | iblech: well, It's Ok if your unclear, I must thank you for your patient. :-) | 21:03 | |
svnbot6 | r6293 | iblech++ | * t/syntax/parsing_numbers.t: Added Luke's response. | ||
r6293 | iblech++ | * PIL2JS: Probably restored to fully working :) | |||
r6293 | iblech++ | * PIL::PStmt, PIL::PPos, and PIL::PExp all bubble up the ->{CC} to their | |||
r6293 | iblech++ | inner objects -- i.e. PIL::PApp will get the ->{CC} even if it's packed in | |||
r6293 | iblech++ | a PIL::PExp. | |||
r6293 | iblech++ | * PIL::PVal, PIL::Params, PIL::Subs: Misc. smaller fixes. | |||
iblech | np :) | ||
Aankhen`` goes to sleep. | 21:04 | ||
iblech | Night Aankhen`` :) | ||
Aankhen`` | ?eval sub foo (*%_) { %_ }; my $bar = "_"; foo($bar => "bar") | ||
evalbot6 | {('bar' => undef)} | 21:05 | |
iblech | Oh and we'll miss you :( | ||
Aankhen`` | I'll miss you guys too! | ||
Anyway. | |||
Must sleep. | |||
G'night. | |||
xinming | ?eval class C { has $.a; my $.a; }; | 21:07 | |
evalbot6 | undef | ||
xinming | ?eval class C { my $.a; has $.a; }; | ||
evalbot6 | undef | ||
iblech | my $.foo and our $.foo are not yet implemented (IIRC), you'll have to wait for the new PIL runcore which uses the metamodel | 21:08 | |
fglock | I'm trying to understand what's the point of having References, is everything is auto-dereferenced | ||
iblech | Not all things auto-dereference anymore, only refs to aggregates | 21:09 | |
I.e. (\3).isa(Ref) is true, but (\@array).isa(Ref) and ([1,2,3]).isa(Ref) are false | |||
xinming | hmm, which will be used for accessor method? | ||
iblech | fglock: See www.nntp.perl.org/group/perl.perl6....uage/22532 | 21:10 | |
xinming: Dunno. Probably it's an error to declare two "$.a"s | |||
xinming | iblech: hmm. In fact, I wonder something what from larry thought. :-) | 21:11 | |
fglock | in order to "deref one level" the dereference will have to be done by the compiler - the object doesn't know which level it is, right? | 21:13 | |
xinming | iblech: hmm, One is public attribute, another is the class attribute, I think they can have the same name in the class. though, don't know how larry thinks of this. | 21:14 | |
iblech | fglock: I'm not sure I've understood you right, but yes, the object does not never which level it is | 21:15 | |
And BTW, if you want to turn an autodereffing ref into a non-autodereffing ref, you've to use tied: $arrayref.isa(Ref) is false, but tied($arrayref).isa(Ref) is true | |||
(But "tied" is the wrong name for this operation, as tied operates on containers, not values. I've asked Larry about this, but the topic got warnocked.) | 21:16 | ||
xinming: Ask p6l :) | |||
fglock | I mean, \\3 dereferences to \3, which doesn't dereference | 21:17 | |
iblech | No \\3 does not autoderef | ||
Only refs to aggregates autoderef | |||
And \3 is not an aggregate, so \\3 won't autoderef | 21:18 | ||
But I may be wrong of course -- you might want to ask p6l to be certain :) | |||
fglock | [[ 1,2,3 ]] dereferences to [ 1,2,3 ], which doesn't dereference to Array | ||
iblech | No, [[ 1,2,3 ]] derefs to ([1,2,3]) | 21:19 | |
And this is simply an Array containing one elem | |||
fglock | I need to write tests for Ref and Scalar - this will help | 21:24 | |
xinming | iblech: what does p6l mean pleaes? | 21:25 | |
iblech | xinming: Oh, p6l is short for perl6-language, the mailinglist on which Perl 6's design is discussed | ||
xinming: See dev.perl.org/perl6/lists/ | |||
(Similarily, p6c is perl6-compiler and p6i is perl6-internals.) | 21:26 | ||
fglock: Yep -- before implementing autoderef in PIL2JS, I wrote t/var/autoderef.t | |||
fglock: You might be able to port some of autoderef.t to Perl 5 | 21:27 | ||
xinming | iblech: thanks | 21:28 | |
iblech | xinming: Sure, np | 21:29 | |
xinming | ?eval my $var = 1; ('a' => $var) = "value"; | 21:30 | |
what does this mean really. | |||
evalbot6 | ('a' => \'value') | ||
iblech | This is a special case -- if you assign something to a pair value (not a container holding a pair!), then the pair's .value will be modified | 21:32 | |
I.e. $var is "value" after the assignment | |||
xinming | ?eval my $var = 1; ( $var => 'a' ) = "value" ; | 21:33 | |
evalbot6 | Error: Can't modify constant item: VStr "a" | ||
iblech | Oh and while we're at it, if you use :=, you're allowed to put the usual subroutine signature syntax in the left hand side | ||
I.e. | |||
(*$first_thing, *@remaining_things) := foo() | |||
xinming | ?eval my $var = 1; ( $var => 'a' ) := "value" ; | 21:35 | |
evalbot6 | Error: Cannot bind this as lhs: Pos (MkPos "<eval>" 1 16 1 28) (App (Var "&infix:=>") Nothing [Var "$var",Cxt (CxtItem (mkType "Str")) (Val (VStr "a"))]) | ||
iblech | This is another special case, allowing things like | 21:36 | |
(foo => $foo, bar => $bar) := (bar => calc_bar(), foo => calc_foo()) | |||
but it isn't implemented yet | |||
(BTW, allowed things like (+$foo, ?$bar) := baz() aren't even parsed currently.) | 21:38 | ||
IIRC S06 has got more details | 21:39 | ||
fglock | I'm reading autoderef.t - yes it helps :) | 21:40 | |
iblech | Great :) | 21:42 | |
svnbot6 | r6294 | iblech++ | * STATUS: Noted that I'm currently converting PIL2JS to use -CPerl5. | 21:45 | |
r6294 | iblech++ | * PIL2JS: More fixes in PIL::Subs, PIL::PApp, and Prelude::JS::Operators; | |||
r6294 | iblech++ | thanks to -CPerl5 for allowing a *much* faster edit/compile/test cycle. :) | |||
iblech | Ok, need to sleep now. | 21:46 | |
Night all :) | |||
spinclad | i've sent the p6l thread my longest-token-rule note, but it hasn't shown up yet; i suppose it's waiting to be vetted as non-spam? | ||
fglock | spinclad: maybe - my mails take a day to show | 21:47 | |
svnbot6 | r6295 | fglock++ | * perl5/ 'Ref' works (but hacky) | 22:34 |