svn switch --relocate svn.openfoundry.org/pugs svn.pugscode.org/pugs/ | run.pugscode.org | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com Set by avar on 16 November 2006. |
|||
00:09
xpika joined
00:15
nekokak_ joined
00:26
nekokak joined
00:27
buetow joined
00:35
frederico joined
00:45
nekokak joined
00:58
lyokato joined
01:00
xpika left
01:01
weinig is now known as weinig|bbl
01:02
macroron joined
01:08
Debolaz2 is now known as Debolaz
01:51
marmic joined
02:08
Pomin joined
02:24
cj joined
02:41
dmq joined
02:45
buubot joined
02:55
araujo joined
02:56
nipotaway is now known as nipotan
03:15
nipra joined
03:41
kisu joined
04:30
kisu left
06:10
nipra joined
06:13
kanru joined
06:14
BooK_ joined
06:19
dolmans joined
06:21
dolmans joined
06:57
RHainsworth joined
07:57
nipra joined
08:09
mjk joined
08:31
iblechbot joined
09:33
RHainsworth joined
09:39
pnu joined
09:41
stef__ joined
09:44
stef__ joined
10:01
b_jonas joined
10:07
dduncan left,
chris2 joined
10:13
elmex joined
11:08
StStealth joined
|
|||
StStealth | hello | 11:09 | |
mj41 | hi - Sorry, the pugs server is not running. feather.perl6.nl:8080/cgi-bin/runpugs2?ia=0 :-( | ||
lambdabot | Title: Run Perl 6 Now -- in your browser! | ||
mj41 | is there something like ...runpugs2?ia=0&version=devel ? .. or only possibility is "Development version" radio button? | 11:13 | |
?ia=0&reldev=1 is my solution .. open_source++ | 11:15 | ||
lambdabot | Unknown command, try @list | ||
StStealth | hi | 11:16 | |
can i talk with somebody in private about perl? | |||
integral notes that this channel's primarily about Perl 6, development and use | 11:17 | ||
11:21
kanru joined
|
|||
StStealth | hey | 11:23 | |
11:24
BooK joined
|
|||
b_jonas | StStealth: please come back to #perl. we have changed BingOS' mind about your ban. | 11:24 | |
If you do, I'll explain the obfu you posted. | 11:25 | ||
11:37
VanilleBert joined
11:54
nipotan is now known as nipotaway
12:13
marmic joined
12:17
ofer1 joined
12:31
lisppaste3 joined
12:44
buetow joined
12:54
weinig|bbl is now known as weinig
12:55
nipra joined
13:43
cj_ joined
13:50
stef_ left,
cognominal joined
13:54
b_jonas joined
14:07
StStealth joined
14:20
xinming joined
14:29
xinming joined
|
|||
xinming | hello, Has Audreyt ever been here? | 14:30 | |
[particle] | seen audreyt? | 14:31 | |
jabbot | [particle]: audreyt was seen 1 hours 33 minutes 42 seconds ago | ||
xinming | Oh, Ok, then, I don't think her connection had been cut. >_< | 14:32 | |
nothingmuch | that doesn't seem veryh accurate | 14:35 | |
@seen audreyt | |||
lambdabot | audreyt is in #perl6, #ghc and #haskell. I last heard audreyt speak 1h 17s ago. | ||
nothingmuch | it's not in my log | ||
baaaah | |||
oh, that's in #haskell | 14:36 | ||
14:37
prism joined
|
|||
xinming | hmm, BTW, Is there a way to come here use Proxy using irssi? | 14:38 | |
14:40
vel joined
14:42
bonesss joined
14:43
dakkar joined
14:45
andara joined
15:00
fglock joined,
nipra joined
15:03
RHainsworth joined
15:09
Jedai joined
|
|||
fglock | nothingmuch: I'm implementing a MO emitter for mp6, based on t/si.t | 15:13 | |
a couple questions - how do you extend a class? and how do you create class variables (with accessors) | 15:14 | ||
nothingmuch | class variables are not supported by my impl (yet) | ||
and you extend a class by making another class that lists the base class (by value) in the superclasses | |||
array | |||
fglock | can you add methods to an existing class? | 15:15 | |
nothingmuch | yes, just modify the collection and rregenerate the responder interface | ||
b_jonas | this sounds like ruby :) | 15:16 | |
nothingmuch | it could be ;-) | ||
fglock | ok. normal subroutines just go into a plain "package", right? | 15:17 | |
nothingmuch | right... a compilation unit with a package should probably consist of an OO style responder interface + normal subs | 15:18 | |
where normal subs are encapsulated by some other technique | |||
fglock | I could use this to implement class vars too | 15:19 | |
nothingmuch | and if methods are addressible as normal subs fully qualified then there is some overlap, I assume | ||
it's cleaner if you just tell me how you want them done and I will add the functionality to the metaclass | |||
should it be like an implicit singleton with it's own layout? | |||
perhaps closures installed as methods is better | |||
*shrug* | 15:20 | ||
b_jonas | jsut take care that the class methods etc can be inherited | ||
nothingmuch | they already are | ||
but actually, true perl 6 doesn't make a distinction between class and instance methods | |||
since it's a prototypes-on-crack oo system | |||
b_jonas | um | 15:21 | |
fglock | I'm not sure what's the difference between accessors and methods | ||
nothingmuch | none | ||
b_jonas | you mean methods are really just functions with the self object in a special argument slot? | ||
nothingmuch | accessors are autogenerated methods... they are derived from attributes | ||
b_jonas: not precisely | |||
it's more that a class is an instance of itself when used for class methods | 15:22 | ||
it's just all null | |||
b_jonas | WHAT? | ||
a class in an instance of itself? | |||
nothingmuch | fglock: actually, we could make these simply be shared attributes | ||
b_jonas | just like in perl5? | ||
I can't belive that | |||
nothingmuch | b_jonas: no | ||
in perl 5 there is no "class" | |||
it's just a string | |||
in perl 6 it's a prototype object | |||
my Dog $fido; # the prototype ::Dog is in $fido, and it's 'but undef' | |||
fglock | nothingmuch: that's ok | 15:23 | |
nothingmuch | $fido.=new; # calls .new on the ::Dog prototype | ||
fglock: kludge it for now | |||
SI and MI are just demos | |||
fglock | when you say "$base_box" - is it a prototype object? | ||
nothingmuch | we need a real prototype based meta model that simply follows the same API | ||
no | |||
remember that MO in perl 5 models perl 5 OO | |||
but not quite | 15:24 | ||
$base_box is a meta class value (opaque) in a box tied to the class responder interface (as opposed to the instance one) | |||
b_jonas | but "true perl 6 doesn't make a distinction between class and instance methods" sounds scary | ||
nothingmuch | b_jonas: i think so too | ||
b_jonas: duke it out with TimToady and audreyt ;-) | |||
b_jonas | and perl5like | ||
nothingmuch | that's not necessarily bad | 15:25 | |
fglock: don't fret over too many details for now, we'll work out the important bits when it's time | |||
a true prototype based system overlayed on top of perl 5 will be useful, but call site semantics are vague for that | |||
and i don't have the brain time shares to do that right now | 15:26 | ||
fglock | k | ||
15:26
penk joined
|
|||
nothingmuch | i suppose $Fully::Qualified::Package::PROTO is a good enough "class invocant" | 15:26 | |
so perl 6's Fully::Qualified.new becomes $Fully::Qualified::PROTO->new | |||
fglock | so it's ok if I just create methods for class vars | ||
nothingmuch | yes, i suppose | 15:27 | |
are you using Class::MI? | |||
fglock | not yet | ||
nothingmuch | so what are you using? | ||
b_jonas | you know what I'd like? I'd like class methods, class vars, and class constants such that all of them inherit from the parent classes but can also be overridden | 15:28 | |
fglock | MO::Compile::Class::SI | ||
nothingmuch | use Class::MI, it's almost identical | ||
fglock | ok | ||
nothingmuch | they are separated just for the sake of example | ||
MI introduces the concept of an MRO without interfering with the other bits | |||
15:28
xinming joined
|
|||
nothingmuch | but it's a half assed implementation | 15:28 | |
b_jonas | c++ lacks those, specifically, you can't override non-function members in subclasses | ||
nothingmuch | b_jonas: even things pretending to be instance/class vars are really method calls in perl 6 | 15:29 | |
b_jonas | I can sort of understand that but in a dynamic language those would make sense | ||
nothingmuch | $.x = "bah"; # method call on the accessor | ||
so your wish is essentially granted | |||
b_jonas | sure | ||
but will that work on _class_ members | |||
not instance members? | |||
nothingmuch | yes | ||
because there are no class members | 15:30 | ||
fglock | the plan is to emit a working mp6 that use no p5-style classes, and the write "mp6mo" using it | ||
b_jonas | huh? | ||
nothingmuch | they are just instance members in the proto ;-P | ||
fglock: sounds good | |||
b_jonas goes to read S12 | 15:31 | ||
fglock | mp6mo will then have inheritance and roles | ||
nothingmuch | fglock: cool | ||
fglock | while plain mp6 stays simple forever :) | 15:32 | |
15:32
nipra joined
|
|||
fglock | nothingmuch: do you plan to publish MO to cpan? | 15:33 | |
nothingmuch | not in it's current form | 15:34 | |
it should go into Moose at some point | |||
right now the metaclasses themselves are a little too experimental and they're implemented slightly sloppily | 15:35 | ||
(notice the huge MO::Compile::Class role which shouldn't even be a role ;-) | |||
svnbot6 | r14939 | fglock++ | mp6 - Added "Perl5-MO" emitter | 15:41 | |
fglock | actually, mp6 should generate code like ' ::MO::Compile::Method::Simple( name => ..., definition => ... ) ' - which would then be compiled either to p5 or parrot | 15:45 | |
so that it needs no change in the p5 emitter :) | 15:46 | ||
nothingmuch | i think you should write your own MO::Compile::Method::Simple | ||
or at least your own compiled method object | 15:47 | ||
fglock | it's just an ast transformation, instead | ||
nothingmuch | simple is essentially a proxy, but some method objects want to specialize on the target class | ||
the "simple" definition is just a wrapper for a closure | |||
fglock | nothingmuch: I need to understand it better | ||
nothingmuch | in MO there is a very very strong separation between definitional layers | 15:48 | |
where objects represent OO bits | |||
for example Method::Simple is a name and a definition | |||
the definition is not a part of the method and can be anything | |||
typically it's just a closure | |||
Method::Accessor, on the other hand creaates a definition on the fly | |||
don't constrain yourself to all that I implemented | 15:49 | ||
the whole system was designed to make custom components easy, and you are probably the #1 person to use that ;-) | |||
gaal mooses | |||
nothingmuch | yo moose | ||
gaal | yoses | 15:50 | |
nothingmuch | moses | ||
fglock | mmooses (mini-moose) | ||
nothingmuch | meta mooses are more mooseful than mini mooses | 15:51 | |
mini mooses sounds like mini buses (in the hebrew/german pronounciation) | |||
which are quite lame | |||
15:52
Southen joined
|
|||
fglock | anyway, since MO::Compile::Method::Simple is a lib, it can be implemented in either language | 15:52 | |
and mp6mo doesn't need a single line of p5 | |||
nothingmuch | si | ||
fwiw, see if the abstract roles are more useful for you | 15:53 | ||
MO::Compile::Method vs. MO::Compile::Method::Simple | |||
i should document it ore throughly | |||
after dinner perhaps | |||
fglock | yes, please :) | 15:54 | |
nothingmuch | ;-) | ||
i will try to make a sort of summary of who is who in MO land | |||
fglock | an example is ok | ||
nothingmuch | an example of what? | ||
fglock | I usually look for files in t/ for usage examples | 15:55 | |
they are better than pod sometimes | |||
nothingmuch | yes, but that says nothing of the intent | 15:56 | |
15:57
andara left
|
|||
fglock | moving mo-ification to a precompiler is cool | 15:58 | |
pre-emitter, that is | 15:59 | ||
nothingmuch | should be =) | ||
& | 16:00 | ||
see you later | |||
fglock | thanks! | ||
b_jonas | "Class attributes are declared with either my or our. The only difference from ordinary my or our variables is that an accessor is generated according to the secondary sigil" | ||
nothingmuch | b_jonas: that's make belief | 16:01 | |
it looks that way | |||
but I think that it's really an instance variable on the proto | |||
gaal notices that cpants' favico image is an upside-down lambda. scary! | 16:02 | ||
nothingmuch | i think I heard audrey mentioning that | ||
but... bah! gotta go | |||
b_jonas | bye | 16:03 | |
you know what I don't like in this? | |||
I don't want a language that just DWIM. I'd like a language of which I can understand how it works. | |||
But from reading the perl6 S's, I don't get the feeling that the language is understandable. | 16:04 | ||
16:08
xinming joined
|
|||
gaal | b_jonas: it's not a small language, sure, but it is more predictable and in some ways more simple than perl 5. | 16:08 | |
b_jonas | yeah perl5 is complicated in this manner as well, that's true | 16:09 | |
gaal | also there are areas that aren't finished yet in specwork. what are you wondering about especially? | ||
ah, I see you've been talking with nothingmuch about MO stuff | |||
b_jonas | the object orientation (S12) | 16:10 | |
it's better when the core language is smaller and the big things are in the standard libraries | |||
gaal | I don't think I'll be able to help you with crystallization of your understaning of particulars there | ||
but it may be helpful to point out two motivations Perl 6 has here. | 16:11 | ||
b_jonas | I'll just read the S completely | ||
fglock | OO will end up being a library, in mp6 - 'class' will be a macro | ||
gaal | the first is to normalize the mainstream stuff that almost all p5 OOP is doing ad-hocily in the same way | 16:12 | |
b_jonas | gaal: yes, that makes sense | ||
gaal | the second is to leave enough power to do waaaay smarter things without resorting to crazy low-level hacks | ||
b_jonas | I really have no idea how I want OO to work in a high-level language | 16:13 | |
fglock | the problem is to find out what 'core language' means in perl6 - if you move OO and regexes out of it | ||
b_jonas | I just can't imagine any good scheme for it | ||
gaal | p6 does (or will have) in fact a relatively simple underlying calculus | ||
relative here meaning compared to "the perl you know", not to, say, lisp. | 16:14 | ||
b_jonas | you know what scared me in particular? | ||
"Method calls on mutable scalars always go to the object contained in the scalar (autoboxing value types as necessary):" | |||
why do we have to have this perl5 everything-is-an-lvalue madness in perl6? | |||
gaal | is that a performance worry? | ||
b_jonas | no | 16:15 | |
ont performance | |||
gaal | so explain your worry please | 16:16 | |
b_jonas | well, in perl5 we have the scalars so that we can pass things by reference with easy (almost transparent) syntax | 16:17 | |
it usually works well, but it occasionally causes troubles | |||
when you don't know what's by reference and what's by value | |||
like you have to know that = copies the contents of a scalar and so on | 16:18 | ||
I don't know how you can both have references and have clean semantics | 16:19 | ||
so I don't know how this can be avoided | |||
but it's still ugly | |||
gaal | well, you don't have references at all in p6 :) | ||
b_jonas | sure, but you still have these scalars | ||
gaal | you don't have to | ||
dmq | er, what? no references in p6? | 16:20 | |
gaal | you can bind directly w/o a container | ||
$x := gimme_something | |||
b_jonas | how does that work? | 16:21 | |
dmq | i thought it was more that all arrays and hashes are references always. | ||
gaal | dmq: svn.pugscode.org/pugs/docs/Perl6/FAQ/Capture.pod | ||
b_jonas | some languages don't have implicit references at all, like ruby, sml, ... | 16:22 | |
in these, you can't take a reference of an arbitary objects | |||
you can only pass those things by reference which are in special containers | |||
c/c++ isn't like that. I always hated that. In c, you can take the address of any variable. | 16:23 | ||
gaal | "my $x" does by default create a Scalar container in which you can put stuff | ||
b_jonas | but at least, I understand its semantics (I think) | ||
gaal | on which you can do "=" | ||
"=" is a macro that works on mutable containers | |||
but if you bind to an object directly, you don't have that layer | 16:24 | ||
so $x := moose(); $x = elk() is simply an error | |||
b_jonas | I see | ||
dmq | hmm. | ||
b_jonas | so a $variable can contain anything, not just a scalar? | ||
gaal | (unless the class of the object returned by moose is some container that responds to =) | ||
b_jonas | and a hash slice or a substr returns such an object which responds to =? | 16:25 | |
gaal | hmm I don't know well enough to say. perhaps it depends on context. | 16:26 | |
b_jonas | oh well never mind that last thing | ||
so if you say my @foo, then similarly a new array gets created | |||
gaal | exactly. | 16:27 | |
the sigils are a hint | |||
in that regard. | |||
b_jonas | but you can bind any object to an @var too | ||
gaal | but you could also do $x := @y | ||
16:27
xinming joined
|
|||
gaal | precisely | 16:27 | |
b_jonas | So the silgils don't mean much. I see. | 16:28 | |
gaal | they aren't a guarantee, that's right. but they are an important convention. | ||
not that there are many characters left :) but presumably you should be able to add your own sigils for your own crazy types. | 16:29 | ||
b_jonas | heh! | ||
[particle] | there are plenty of unused unicode symbols available for sigils | 16:30 | |
b_jonas | thanks for the explanation. | ||
gaal | yes, I was sorta joking :) | ||
dmq beats particle to death with a ligature | |||
gaal | is it the "aieee" ligature? | ||
dmq | richtig | ||
ive come to the conclusion that utf8 is the devils work. | 16:31 | ||
[particle] pops another quarter into #perl6 | |||
dmq | or rather, that unicode is the devils work. | ||
gaal | why? it's a very nice hack with excellent transition-fu | ||
ah | |||
b_jonas | and then, when you pass a value to a function like foo($bar), you pass the Scalar as a value if $bar is bound to one, or pass a value if not | 16:32 | |
except for the method invocant, where, according to the paragraph I quoted, the contents of the scalar is passed | |||
16:33
cognominal joined
|
|||
dmq | combining characters are evil. | 16:33 | |
im just bitter, ive recently been looking into how to do char class set operations, and unicode really makes things tricky. | 16:35 | ||
dmq idly wonders how PGE handles unicode char classes internally | 16:36 | ||
16:36
wilx` is now known as wilx
|
|||
[particle] points to icu | 16:36 | ||
dmq | icu? | 16:37 | |
dakkar | ibm's code | 16:38 | |
[particle] | icu is International Components for Unicode or www-306.ibm.com/software/globalizat.../index.jsp | ||
lambdabot | Title: IBM Globalization - ICU | ||
gaal | b_jonas: I believe that depends on whether the arg is ro, rw, copy | ||
16:39
turrepurre joined
|
|||
fglock | [particle]: I've got some of mp6-parrot implemented, thanks for your help a few weeks ago | 16:42 | |
[particle] | excellent | ||
16:43
xinming joined
16:47
Schwern joined
|
|||
allbery_b | <dmq> or rather, that unicode is the devils work. | 16:50 | |
oh, far worse: it's a committee's work :> | |||
dmq | particle: interesting, ICU seems to have done something that ive been thinking about recently. thats really cool. | 16:51 | |
stef__ | we know better, we used a cabal for Perl 6 | ||
dmq | using tries as a base building block for unicode char class. | ||
16:51
stef__ is now known as cognominal_
|
|||
[particle] | dmq: eventually parrot would like it's own unicode lib, so we're not reliant on icu and it's c++ compiler requirement | 16:52 | |
dmq | hmm. | 16:53 | |
svnbot6 | r14940 | fglock++ | mp6 - added MiniPerl6::AST::CompUnit - this will allow to easily override | ||
r14940 | fglock++ | the AST generation for classes | |||
[particle] | any thoughts you may have on a unicode library impl would be most welcome | ||
dmq | utf8 or non? | ||
that makes a big difference. | |||
dakkar | dmq: ?? | ||
utf8 - codepoint array is a rather easy part of the handling... | 16:54 | ||
dmq | what encoding you choose makes a big difference to how much of pita using unicode is. :-) | ||
dakkar | oh, I was thinking from the pov of the library | ||
[particle] | parrot currently supports multiple encodings (utf8&16, ucs2, fixed8) | ||
dakkar | the library should always use uint32 as codepoint type; or at least appear to do so | 16:55 | |
[particle] | i think that's fair... natively use uint32 and translate as required | ||
dmq | im curious about your codepoint array comment. it seems to me that it can be quite a bit of work to maintain. | 16:56 | |
dakkar | dmq: my punctuation was off | ||
16:57
kanru joined
|
|||
dakkar | I meant: converting between utf8 and an array of codepoints is easier than the rest of the things you have to do with the characters/codepoints | 16:57 | |
dmq | in perl5's trie implementation/aho-corasick i use a circular cache of codepoints that is as long as the longest possible match. | ||
er, wait maybe we arent using codepoint the same way. im using it wrong. never mind me. | 16:58 | ||
dakkar | ehrm... I'm using the Unicode definition. a cedpoint is a 32-bit number that identifies a character | ||
s/cedp/codep/ | 16:59 | ||
dmq | yes, right, sorry, my mistake. | ||
i was thinking of the problem of knowing how many bytes == how many chars. | 17:01 | ||
17:01
Schwern joined
|
|||
dakkar | dmq: yes, that's tricky in perl5, since the internal representation in variable-length | 17:01 | |
that's why I said that the library should at least appear to use uint32 as internal representation | 17:02 | ||
dmq | yeah, but with unicode that can happen any time. | ||
given combining characters and especially given case folding rules. | |||
dakkar | ehrm... utf8 is not unicode | ||
oh, yes | |||
dmq | which is why i think unicode is illegal. | ||
er, evil | 17:03 | ||
should be illegal. | |||
:-) | |||
dakkar | at level 1, 1 codepoint == 1 character | ||
at higher abstraction levels it gets tricky again | |||
I especially like the "language-dependent interpretation" level | |||
dmq | which is that? | ||
dakkar | the one that says "if a speaker of the X language thinks of this sequence as 1 character, it *is* 1 character" | 17:04 | |
dmq | right. ok. yeah. | ||
dakkar | interesting to implement for languages with lots of diacriticals (sp?) and/or ligatures | ||
dmq | actually, you know, that reminds me of the line ending issue. | ||
dakkar | and of course sounds ill-defined (I haven't actually read the full unicode spec, yet) for character unused in that language... | 17:05 | |
dmq | \R => (?>\r?\n?) | 17:06 | |
dakkar | I'm thinking forward to all the times I'll have to redefine that... | 17:07 | |
dmq | why? | ||
\R is actually supposed to be: (?>[\u000A\u000B\u000C\u000D\u0085\u2028\u2029] | \u000D\u000A) | 17:08 | ||
dakkar | for example, all the times I get data files from crazy people that use \r as part of the value, and \n as terminator... | ||
dmq | then dont use \R | 17:09 | |
:-) | |||
whats the problem? | |||
dakkar | mostly, the source of my data ;-) | ||
these days I have lots of "local $/=..." | |||
svnbot6 | r14941 | fglock++ | mp6 - added MiniPerl6::AST::CompUnit to the builder script | 17:14 | |
17:14
penk left,
xinming joined
|
|||
dmq nods | 17:16 | ||
17:19
neonse joined
17:21
ludan joined
17:22
Dr_Pi joined
17:28
xinming_ joined
|
|||
Dr_Pi | My EDGE connection is working! Hurrah! | 17:31 | |
17:31
hexmode joined
17:38
xinming_ joined
17:47
xinming joined
18:13
BooK_ joined
18:20
Limbic_Region joined
|
|||
Teratogen | so, when is Perl 6 gonna be released you guys? | 18:30 | |
=D | |||
[particle] | by christmas | ||
:P | |||
diotalevi | ?eval 0|1 | 18:32 | |
18:32
evalbot_r14933 is now known as evalbot_r14941
|
|||
evalbot_r14941 | (0 | 1) | 18:32 | |
diotalevi | ?eval substr('...', 0|1, 0,1) | 18:33 | |
evalbot_r14941 | (#<Scalar::Proxy:0xb7aa82cc> | #<Scalar::Proxy:0xb7adaa70>) | ||
diotalevi | Uh, what? | ||
So are those just further delayed computations? | |||
18:38
foo\ joined
|
|||
jrockway | no, they're junctions | 18:45 | |
18:46
polettix joined
|
|||
jrockway | ?eval if(5 > (1|3|5|7)) { say "5 is greater than 1 or 3 or 5 or 7" } | 18:46 | |
evalbot_r14941 | OUTPUT[5 is greater than 1 or 3 or 5 or 7ā¤] Bool::True | ||
jrockway | oh, are you talking about the Scalar::Proxy business? | 18:47 | |
b_jonas | perl6 junctions will autothread on functions that don't expect a junction (according to the declaration) | 18:49 | |
so would it not make sense to have neutral junctions that have this autothreading behaiviour but no special meaning in boolean context | 18:50 | ||
? | |||
diotalevi | jrockway: yes, the Scalar::Proxy thing. Is that just substr('...',0,0,1)|substr('...',1,0,1)? When does the substr() happen? Has it happened yet? | 18:51 | |
18:51
penk joined
|
|||
diotalevi | Or if the if() statement you just said didn't have IO in it would perl use the if() as a choicepoint and possibly backtrack over it? | 18:53 | |
diotalevi has a prolog bent this morning. | 18:54 | ||
b_jonas | lol | 18:55 | |
that's not how junctions work but you can define an amb function that works like that in terms of call/cc, provided there are no side-effects | 18:56 | ||
jrockway | i'm not actually sure what happens with the substr example | ||
i don't see why it's not computed immediately | |||
diotalevi | You wouldn't want it computed immediately if one of the values was a large enough junction. Anything larger than fits in memory at once will do. | 18:58 | |
b_jonas | ah cool, p6 has the cool 'def initialize @someattr, @otherattr; end;' shorthand that was intentionally omitted from ruby | 18:59 | |
jrockway | why did ruby omit that | ||
b_jonas | prolly same reason as ++ and --: matz found it "unclean" and omitted it | 19:01 | |
only the community won't admit this easily and whenever someone asks about ++ they start saying some stupid reasons | 19:02 | ||
ayrnieu | b_jonas - he omitted them as operators, but not otherwise | ||
b_jonas | like how numerics are immutable | ||
yes, there's += 1 | |||
ayrnieu | no, I mean .succ and .prev | ||
b_jonas | there's no prev | 19:03 | |
ayrnieu | IIRC, .succ is even similarly magical. | ||
b_jonas | succ is for ranges | ||
yes, though as methods are virtual, that doesn't count as magic in ruby | |||
ayrnieu | indeed? Nevermind then. | ||
19:08
pbuetow joined
|
|||
jrockway | the key to a successful programming language is to avoid telling people what to think | 19:11 | |
b_jonas | this inplace mutator thingy will make the one-arg open possible | ||
jrockway | when people are used to "++" and you tell them they suck for using it, they're going to find another programming language | ||
b_jonas | $*ARGV >>.= open; | ||
and your ARGV is now a list of handles, not strings | |||
I guess that wouldn't actually work | 19:12 | ||
but still | |||
jrockway | ?eval "filename".open | ||
gaal | it's @*ARGS, but otherwise I don't see why it shouldn't work. | ||
evalbot_r14941 | Error: Unsafe function 'Pugs::Internals::openFile' called under safe mode | ||
jrockway | i guess it would work | ||
b_jonas | hmm | 19:13 | |
gaal | there's a question about whether foo.arity1func should in general work | ||
I don't remember how and if it was resolved | |||
b_jonas | well S12 says it does | ||
gaal | ah good then. :) | ||
so there you go | |||
b_jonas | even for non-arity1 functions | ||
jrockway | i'm not sure why "foo".open is a good idea | 19:14 | |
"foo" can't be opened, it's a string | |||
b_jonas | are there := mutators btw, like .:= or +:= ? | ||
gaal | uh, how is $foo different, jrockway? | ||
jrockway | it's not | 19:15 | |
i don't see a problem with $filehandle = open($filename) | |||
unless you are worried about namespace pollution or something | |||
b_jonas | well I'm not sure I like this method->function dispatching but I'm sure it's damn convenient syntax | ||
gaal | yeah | ||
b_jonas | it eliminates lots of parenthesis | ||
diotalevi | Is there a separate class for filenames? | ||
b_jonas | as for namespace pollution, that's why method is the default | 19:16 | |
jrockway | that sounds like something java would do | ||
b_jonas | jrockway: lol | ||
diotalevi | $foo.open(...) would make sense if $foo were of that filename class. | ||
jrockway | filehandle = new Filename("foo").open | ||
yeah | |||
gaal | jrockway: oh, you mean "this method->function dispatching" is what you don't like | ||
jrockway | i wouldn't say dislike | ||
i guess it's ok | |||
gaal | yeah well the thing is that File::open is a multi and is in scope | 19:17 | |
jrockway | of course, what if Str has an "open" method | ||
then you have to do File::open("string") anyway | |||
gaal | indeed | ||
b_jonas | no, you wouldn't | ||
open("string") | 19:18 | ||
would still call the global open function | |||
not the method | |||
gaal | it's not a global function | ||
well, it is now | |||
b_jonas | if it's not, how would it work? | ||
gaal | oh wait, ESC2dd | ||
19:19
iblechbot joined
|
|||
b_jonas | vi notation lol | 19:19 | |
gaal | it's not global in the sense that it's in *. It's in File:: | ||
but it is defined in the Prelude, and has 'is builtin' | |||
b_jonas | but isn't it exported as a global? | ||
jrockway | either way, i know what you mean | ||
b_jonas | "is builtin"? | ||
gaal | which kinda makes it visible in every package. | ||
b_jonas | I see | 19:20 | |
gaal | it's a pugs thing, not S* Perl 6 (I think). | ||
jrockway | when you say $object.foo, if !$object.can('foo') then foo($object) instead | ||
gaal | yes. | ||
which is not insane. | 19:21 | ||
b_jonas | which means care should be taken not to add methods to standard classes that might shadow functions people are likely to call this way | 19:22 | |
gaal | which is the opposite of the p5 situation, in which $x->$y was safe from the case where a new builtin was added to the language. | 19:23 | |
so, the moral is, avoid method call syntax when you mean function call. | 19:24 | ||
b_jonas | yes, although very few new builtins were added to perl starting from 5.4 | ||
5.5 I mean | |||
gaal | there was a 5.5? | ||
b_jonas | 5.005 | 19:25 | |
gaal | yeah. | ||
19:26
cognominal joined
|
|||
b_jonas | hmm | 19:34 | |
S12 also says that function calls with a single parameter like 'foo $bar' default to a method call | |||
that's strange | |||
also 'foo($bar)' | |||
now this is wierd | 19:35 | ||
that means you can't call a simple named function reliable with that easy syntax | 19:36 | ||
that's really wierd | |||
19:58
rindolf joined
|
|||
rindolf | Hi all. | 19:58 | |
19:58
hexmode joined
20:00
theorbtwo joined
20:04
Schwern joined
20:07
Dr_Pi joined
|
|||
TimToady | b_jonas: you have apparently found a fossil in S12. we recently fixed those semantics by introducing "is export" on methods that also want to be callable as functions, but apparently we didn't fix that spot in S12. | 20:24 | |
I agree that it violates Least Surprise. | 20:25 | ||
rindolf | Hi TimToady | ||
TimToady | hi | ||
b_jonas | really? | ||
it says 19 Dec 2006 | 20:26 | ||
last modified I mean | |||
hi | |||
TimToady | we probably decided it here and I just forgot to update; this was actually 2 or 3 months ago. | ||
b_jonas | oh | ||
rindolf | TimToady: so your first programming language was BASIC? | 20:27 | |
TimToady | does it show? :) | ||
rindolf | TimToady: don't know. | 20:31 | |
TimToady: it was mine too. | |||
b_jonas | mine as well (I used logo before but not really programming) | 20:32 | |
20:33
vel joined
|
|||
TimToady | b_jonas: if you look for "is export" elsewhere in S12 you'll see we did revise how close() works. I'll fix the part you noticed. | 20:33 | |
b_jonas | thanks | 20:34 | |
TimToady | fixed | 20:35 | |
20:36
vel joined
20:48
lovecoder joined
20:52
lovecoder left
20:59
luqui joined
|
|||
luqui | TimToady, ping | 21:01 | |
TimToady | luqui: pong | 21:20 | |
luqui | why are submethods special? | ||
oh | 21:21 | ||
TimToady | in general, or in this case? | ||
luqui | huge snowstorm coming, need to go shopping | ||
from your most recent commit | |||
luqui & | |||
mj41 | TimToady: You forgot "of $handle" in "A method call first considers ...." sentence. | 21:23 | |
r13503 to r13505 wiki diff ... perl6.cz/w/index.php?title=Synopses...oldid=3182 | 21:26 | ||
lambdabot | Title: Synopses/S12 - perl6.cz, tinyurl.com/yynhyp | ||
buubot | xrl.us/t2y4 | ||
lambdabot | Title: Synopses/S12 - perl6.cz | ||
b_jonas | wow, it's funny how these interact | ||
TimToady | mj41: fixed, thanks. | 21:32 | |
gaal | hopefully they didn't; each ignored the other but responded to the original long url | ||
gaal dislikes url shorteners | |||
but loves \bot's title magic | 21:33 | ||
b_jonas | but wasn't the second reply of \bot for buubot's shortening? | 21:34 | |
TimToady: also, the Introspection section says about WHAT and co: | 21:35 | ||
"None of these methods takes arguments, so they may also be used as named unary operators" | |||
you may want to change this as well | |||
good night everyone now | 21:38 | ||
21:39
Dr_Pi_ joined
21:49
nipra joined
22:04
Aankhen`` joined
|
|||
gaal | if it was, where was its reply to the original url? | 22:07 | |
22:07
autark joined
|
|||
TreyHarris | perlbot: nopaste | 22:36 | |
perlbot | Paste your code at sial.org/pbot/perl and #perl will be able to view it | ||
lambdabot | Title: sial.org Pastebot - pasteling | ||
22:43
TreyHarris is now known as Trey,
Trey is now known as TreyHarris
22:51
bonesss joined,
TimToady joined
23:10
diotalevi left
23:13
Psyche^ joined,
Psyche^ is now known as Patterner
23:18
Schwern joined
23:29
penk joined
23:33
prism joined
23:38
beppu_ joined
23:42
weinig is now known as weinig|bbl
23:50
Aankhen`` joined
|