Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2006-12-28

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

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

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

Perl 6 | Reference Documentation | Rakudo