Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-07-10

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:01 yahooooo joined #perl6
00:01 jferrero joined #perl6
00:07 araujo joined #perl6
00:08 Grrrr joined #perl6
00:09 nnunley joined #perl6
00:09 GeJ_ joined #perl6
00:09 ingyfoo joined #perl6
00:09 wolv joined #perl6
00:09 meppl good night
00:55 fullermd joined #perl6
00:55 pugs_svn r21292 | ruoso++ | [smop] changing lowlevel method to receive the responder, identifier and capture of the outer invocation as the arguments for the "call" method. After some sm0p language changes there are a few leaks in p6opaque.sm0p still to be identified.
01:28 armagad joined #perl6
01:41 armagad I have a n00bish unix question… When generating Makefile with .configure how do you tell which executable, of say flex to use, if one is in /usr/local and one is in /usr ?
01:44 Patterner $PATH
01:45 b_jonas armagad: try ./configure --help in case it has an option for that
01:45 armagad Yeah I switched it there and fixed one and broke another :(
01:45 b_jonas or try something like  ./configure --with-lex=/path/name or something
01:46 b_jonas or try ./configure LEX=/path/name
01:46 armagad WIll the --with-flex= trick work even if there is no --with-flex in the .configure --help?
01:46 b_jonas or try LEX=/path/name make
01:46 Patterner env PATH=/path/to/flex/directory:$PATH ./configure
01:46 b_jonas armagad: some options are not listed in --help
01:46 Patterner lots of possibilities...
01:46 armagad ah
01:46 b_jonas so it may or may not work
01:47 b_jonas there are lots of ./configure options so it's hard to tell
01:47 b_jonas if these fail, try to ask in ##workingset (preferred) or #gnu
01:47 Patterner mv /usr/local/bin/flex /usr/local/bin/NOflexINGALLOWED # if appropriately desperate
01:48 Patterner armagad: what exactly is the problem? wrong flex used?
01:48 Patterner or just curiosity?
01:50 armagad php is the problem
01:50 armagad or maybe Leopard
01:50 armagad I tried installing the old version of flex for php
01:51 b_jonas armagad: doesn't the source distrib include the flex output?
01:51 b_jonas or did you modify the input?
01:52 b_jonas most programs include flex outputs I think, to reduce dependency problems
01:52 armagad ld says there are duplicate symbols and it seems to be a problem that only mac people have
01:53 armagad I was just trying to regenerate those
01:53 b_jonas armagad: is it dupe symbols with yy_* or whatever flex' prefix is?
01:53 armagad Mostly just to learn also because the devs just marked the bugs as bogus
01:53 armagad Yeah
01:53 b_jonas what's the prefix btw?
01:54 armagad yy_ ?
01:54 b_jonas or what are some dupe symbols
01:54 armagad _yytext ?
01:54 b_jonas hmm
01:55 alester_ joined #perl6
01:55 b_jonas is it using more than one flex lexer?
01:59 armagad Doh. you just went over my head
02:00 b_jonas armagad: I mean, are there more than one .l files compiled to different .c/.cxx files each, with both linked to the same program?
02:01 meteorjay joined #perl6
02:02 armagad Basically I think I was looking for the solution to the general but super contrived situation where you have a ./configure that requires two specific versions of two different programs neither of which it has a --with for and neither of which are in the same path (breaking the $PATH fix)
02:03 Patterner If the configure requires that, it should have the options.
02:04 armagad Yeah maybe it is too contrived I will just remove the new version of flex
02:06 armagad b_jonas: there is a zend_ini_scanner.l and a zend_language_scanner.l and they both have respective .c files. I am not sure if that is a right answer
02:07 armagad joined #perl6
02:10 Patterner I compiled PHP 5.2.6 on my linux box without problems.
02:11 Patterner my flex is 2.5.35
02:11 armagad oh yeah I do think it is a Mac OS 10.5 issue
02:12 armagad I was trying from cvs
02:14 armagad Apple ships them with httpd and php preinstalled but no pear
02:16 b_jonas armagad: so you're trying on a mac?
02:16 armagad yeah
02:16 b_jonas and you can't reproduce it, right?
02:16 b_jonas that's pain
02:16 b_jonas are you a php maintainer or something?
02:16 armagad heck no
02:17 armagad I just wanted a php dev environment on my laptop
02:18 b_jonas but then why do you care about an error that you can't reproduce?
02:19 armagad I am producing the error
02:19 armagad I just want it to go away
02:23 b_jonas armagad: oh
02:23 b_jonas could you change the flex prefix with that flex option?
02:23 b_jonas that would need changing of the code
02:23 b_jonas but it should still be easy
02:24 armagad b_jonas:Oh. I did get rid of the flex problem
02:24 b_jonas oh, how?
02:24 b_jonas I'm interested
02:24 armagad It didn't help the duplicate symbol problem
02:25 armagad I don't think I will use it on anything else I just got rid of the new version
02:34 armagad joined #perl6
02:41 Alias_ joined #perl6
02:52 Auzon joined #perl6
03:08 Auzon joined #perl6
03:09 justatheory joined #perl6
03:12 simcop2387 joined #perl6
03:25 Kattana joined #perl6
03:29 charsbar joined #perl6
04:02 kattana_ joined #perl6
04:10 Yonderboy joined #perl6
04:15 ingyfoo hola
04:19 TimToady aloh
04:22 Yonderboy aloh
04:23 Yonderboy left #perl6
04:27 redicaps joined #perl6
04:29 smg joined #perl6
04:42 Gothmog_ joined #perl6
04:46 smg joined #perl6
04:53 kanru joined #perl6
04:59 ingy hi TimToady
05:08 ingy reading your recent commits to perl6
05:15 nothingmuch joined #perl6
05:21 c1sung joined #perl6
05:22 Psyche^ joined #perl6
05:42 ingy seen avar?
05:43 * ingy is sad that re::engine::TRE doesn't build on darwin
05:45 justatheory joined #perl6
06:16 redicaps left #perl6
06:27 ashizawa joined #perl6
06:33 agentzh joined #perl6
06:52 ingy anyone know how I can get a password reminder for pugs commit?
06:53 moritz_ ingy: I think I can send one via commitbit, just a sec
06:54 moritz_ ingy: sent (to your ttul.org address)
06:54 ingy thanks moritz_
06:58 b_jonas joined #perl6
06:58 moritz_ wow, pugs repo has 366 commiters, 246 of which have made at least one commit
07:02 bacek moritz_: I've made at least 10 :)
07:03 moritz_ bacek: 27, according to http://moritz.faui2k3.org/svn-search/search.pl?q=author%3Abacek;terse=1
07:03 lambdabot Title: Pugs SVN search, http://tinyurl.com/6x8x8c
07:03 bacek moritz_: wow...
07:05 jan_ joined #perl6
07:05 moritz_ and I made 651 - but many of them are just infrastructure (evalbot, irc logs)
07:05 b_jonas evalbot has to be a committer?
07:05 b_jonas not just a reader?
07:06 b_jonas I mean, isn't the repo public read-only
07:06 moritz_ b_jonas: no, I made commits to the evalbot source code, which is also in the pugs repo
07:06 b_jonas oh, I see
07:06 moritz_ which doesn't really qualify as Perl 6 hacking IMHO
07:06 b_jonas is that the pugs-only evalbot or the one that runs multiple p6 implementations?
07:07 bacek perl6: say 'Hello'
07:07 moritz_ the multi
07:07 p6eval elf 21292: OUTPUT[Hello␤]
07:07 p6eval ..pugs: OUTPUT[Hello␤]
07:07 p6eval ..rakudo 29221: OUTPUT[Hello␤]
07:07 moritz_ nqp: say("hi")
07:07 p6eval nqp: OUTPUT[hi␤]
07:07 moritz_ kp6: say "hi"
07:07 p6eval kp6 21292: OUTPUT[hi␤]
07:15 pugs_svn r21293 | ingy++ | Refactor the Makefile a bit. Made it nice and friendly.
07:15 pugs_svn r21293 | ingy++ |
07:15 pugs_svn r21293 | ingy++ | (I like refactoring Makefiles :)
07:15 pugs_svn r21293 | ingy++ |
07:15 pugs_svn r21293 | ingy++ | New make targets:
07:15 pugs_svn r21293 | ingy++ |
07:15 pugs_svn r21293 | ingy++ |    * make
07:15 pugs_svn r21293 | ingy++ |    * make all
07:15 pugs_svn r21293 | ingy++ |    * make check
07:15 pugs_svn r21293 | ingy++ |    * make try
07:15 pugs_svn r21293 | ingy++ |    * make try cat
07:15 pugs_svn r21293 | ingy++ |    * make clean
07:15 pugs_svn r21293 | ingy++ |    * make distclean
07:19 b_jonas hmm, no maintclean?
07:19 b_jonas moritz_, bacek: thx
07:21 kane_ joined #perl6
07:23 pugs_svn r21294 | ingy++ | Add a README to help people get started in src/perl6.
07:27 moritz_ I'm so screwed, on one of my boxes vim doesn't start anymore :/
07:28 bacek moritz_: how so???
07:28 moritz_ stopping gpm helped...
07:28 moritz_ bacek: strace showed it got stuck while opening /dev/gpmctl or so
07:29 b_jonas wow
07:29 bacek moritz_: are you using console???
07:29 b_jonas I've never seen gpm freeze
07:30 * ingy considers always booting his macbook in the console :)
07:30 b_jonas by the way, do you think it can considered a security bug that the xorg server can lock up completely if the font server it reads from is malicious?
07:31 b_jonas or is it just a feature
07:31 moritz_ bacek: ssh
07:31 bacek moritz_: ssh -Y
07:31 b_jonas ingy: you can boot os X to console-only? that's nice
07:31 moritz_ bacek: but I don't want to forward X stuff. It worked before
07:32 b_jonas I mean, usefully and easily
07:32 moritz_ b_jonas: yes, IMHO that's a security bug
07:32 b_jonas moritz_: even if it can't do anything worse than lock up indefinitely?
07:32 b_jonas I don't know for sure that it can't, but supposing it couldn't
07:32 b_jonas I know it can lock up
07:33 b_jonas (found out the wrong way)
07:33 moritz_ b_jonas: yes. Denial of Service is a security bug
07:33 ingy denial of X
07:33 b_jonas moritz_: sure, but you could say the font server has to be trusted that much
07:34 moritz_ b_jonas: aren't there ways to load non-trusted fonts as a user?
07:34 b_jonas also I think it can be killed if you tear down the network connection to it
07:34 b_jonas moritz_: yep, there are, but I don't know if that's with the font server or directly
07:34 * moritz_ isn't too familiar with X and fonts and all that nasty stuff
07:34 b_jonas you don't have to use the font server
07:34 jferrero joined #perl6
07:34 b_jonas plus, it's a different thing
07:34 b_jonas you can use multiple font servers if you want to load your own fonts
07:35 b_jonas you don't need to be able to safely load fonts to an existing font server as a user
07:36 b_jonas clarifying is, I think (but haven't tried) that you can make X resume if you tear the network connection to the font server by killing it or downing the network
07:38 moritz_ "mommy, you can't use the interent right now, I have to disconnect the switch..." ;-)
07:38 b_jonas moritz_: no, but disconnect with a packet filter
07:39 b_jonas also, if you connect to an untrusted xfs running on your own machine with local domain sockets so you can't do that and you don't have root rights, you're screwed
07:39 moritz_ assuming you have one installed at all
07:39 pmurias joined #perl6
07:40 moritz_ (paket filter, that is)
07:40 moritz_ I don't have them on my desktop machines
07:40 b_jonas yeah, if you don't, you'd have to attach a debugger to X and make read from the xfs return 0 to simulate a break
07:40 b_jonas I'm paranoid enough to run a packet filter on my desktop
07:40 felipe joined #perl6
07:40 moritz_ what does that buy you?
07:41 b_jonas also precompiled kernels that come with debian have iptables compiled as a module in them so you can install the iptables executable and set up a rule on the fly
07:41 b_jonas what buys me?
07:41 moritz_ the packet filter on a desktop
07:42 moritz_ I use debian, but usually my own kernels (weird hardware)
07:42 b_jonas moritz_: yeah, sure
07:42 b_jonas I dunno if you can compile the iptables module and load it on fly
07:43 b_jonas I compile my own kernel on the desktop too
07:43 moritz_ anyway, I have to go to the bakery to get some breakfast, bbl
07:43 b_jonas see you then
07:43 pmurias bacek: by you "run the console" you meant the virtual terminals?
07:44 pmurias * by "you are using the console???"
07:44 bacek pmurias: 'something that not xterm'
07:45 * bacek switched to gvim 2 years ago and happy with it.
07:46 pmurias my X setup at one time got confused with a virtual terminal ;)
08:12 iblechbot joined #perl6
08:34 meppl joined #perl6
09:42 wknight8111 joined #perl6
09:56 ben__ joined #perl6
10:06 icwiener joined #perl6
10:18 chris2 joined #perl6
10:22 meppl joined #perl6
10:39 agentzh left #perl6
10:43 Kattana joined #perl6
10:43 pbuetow joined #perl6
10:55 meppl joined #perl6
11:00 alanhaggai joined #perl6
11:20 agentzh joined #perl6
11:24 ruoso joined #perl6
11:29 bacek joined #perl6
11:51 barney joined #perl6
12:03 wknight8111 joined #perl6
12:08 wolverian joined #perl6
12:08 ingy joined #perl6
12:08 gbacon joined #perl6
12:08 Helios- joined #perl6
12:08 BinGOs joined #perl6
12:08 breinbaas joined #perl6
12:08 smtms joined #perl6
12:08 gugod joined #perl6
12:08 ilogger2 joined #perl6
13:07 cmarcelo joined #perl6
13:30 pmurias joined #perl6
13:30 pmurias ruoso: hi
13:31 pmurias do you think a Hash could serve as our root namespace for now?
13:35 pmurias moritz_: it would be usefull (a bit) if the log showed the time someone joined the channel
13:37 moritz_ pmurias: I'll look into it
13:39 jhorwitz joined #perl6
13:39 breinbaas joined #perl6
13:40 hercynium joined #perl6
13:43 pugs_svn r21295 | moritz++ | [irclog] show time for every event
13:43 moritz_ let's see if this works...
13:43 moritz_ no!
13:44 pugs_svn r21296 | moritz++ | [irclog] hopefully fixed previous commit
13:45 ruoso hi pmurias
13:45 ruoso pmurias, there's one thing I'm not sure about it...
13:45 ruoso is the namespace a plain or a deep hash?
13:45 ruoso I mean....
13:46 ruoso is the full name the key?
13:46 ruoso or a traversal is needed for every part of the name
13:46 pugs_svn r21297 | moritz++ | [irclog] right fix this time
13:46 ruoso if it's plain, I think a hash works just fine
13:47 pmurias ruoso: i'm not sure about it either
13:48 ruoso if it's not we probably want something more ellaborated like a tree walker or something...
13:49 pmurias we can always use nested hashes $Foo::Bar::baz would be $ROOT{'Foo'}{'Bar'}{'baz'}
13:49 ruoso TimToady, is the namespace in Perl 6 a plain "name" => [ Protoobject, Package ]? or is it a deep  "name" => [ Protoobject, Package, subnames ]?
13:49 ruoso pmurias, that is too much inefficient... because you will need a new hash for each step
13:51 * pmurias dosn't understand how a more complex data structure would help
13:51 ruoso because you would have a single "Tree" not a collection of independent Hashes
13:54 pmurias how is the hash function for each object in perl6 specified?
13:54 ruoso pmurias, hash function as in $something.hash that would try to coerce to hash?
13:55 pmurias no
13:55 pmurias the function which turn an object into an int to be used by hash to store it in the proper hash bucket
13:55 pmurias * turns
13:56 b_jonas pmurias: I don't know, but I'd guess there's a role that means an object can do that
13:56 b_jonas that would be nicest, probably roles work
13:56 moritz_ it's somewhere in the spec, we already had that discussion
13:56 ruoso pmurias, that is WHICH
13:57 ruoso WHICH returns something that can be compared by the implementation...
13:57 pmurias WHICH is the indentity value
13:57 b_jonas but WHICH gives something that can be compared exactly
13:58 b_jonas a hash function doesn't need to be injective
13:58 ruoso b_jonas, I don't follow... what do you mean?
13:58 pmurias which is a diffrent set of requirement to a hashing function
13:58 ruoso pmurias, not really
13:58 ruoso pmurias, it's *the* hashing function...
13:59 Auzon joined #perl6
13:59 ruoso but some hashes will use 'eqv' instead of '==='
14:00 b_jonas ruoso: you need something -- a hash function -- that can quickly put values to hash buckets, but doesn't necessarily distingush between each pair of different objects
14:00 moritz_ but for namespaces and packages you don't need to hash objects, right?
14:00 moritz_ it's enough to hash their names
14:00 b_jonas the hash implementation will need to call both that and the hash comparision (eqv) of keys
14:00 moritz_ variable names, I mean
14:00 ruoso moritz_, their names *are* objects
14:00 pmurias moritz_: yes
14:01 pmurias Str's
14:01 b_jonas moritz_: I guess that would be a different class behaiving as a hash
14:01 ruoso moritz_, not the variables...
14:01 ruoso moritz_, just the name of the package
14:01 ruoso the variable lookup happens inside the package
14:01 b_jonas the Ses define a role for hash-like even,
14:01 pmurias b_jonas: Ses?
14:01 b_jonas Synopses
14:01 b_jonas one of hte Synopses
14:02 moritz_ lol
14:02 b_jonas there's no WHOM introspection?
14:02 pmurias are we even sure Hash'es are speced to be hashes? ;)
14:02 moritz_ just 26k lines to search for ;)
14:02 b_jonas strange
14:02 moritz_ pmurias: only their interface ;)
14:03 b_jonas pmurias: I think %foo are specced to be string-keyed hashes by default
14:03 ruoso b_jonas, I would argue that you would make that on the WHICH value
14:03 moritz_ you can implement that internall with a balanced tree if you like
14:03 ruoso b_jonas, no... %foo supports object as keys
14:03 ruoso b_jonas, using WHICH as identity
14:03 b_jonas ruoso: it does, but not without declaring that way
14:04 ruoso b_jonas, declaring that way?
14:04 pmurias ruoso: you undestand how hashes are implemented internaly?
14:04 b_jonas that is, the default is a hash that wants only strings as keys
14:04 ruoso b_jonas, not in Perl 6
14:04 b_jonas but you can declare such a hash that accepts any objects
14:04 b_jonas what classes they actually use I don't know
14:04 b_jonas ruoso: ok, let me check that
14:04 ruoso pmurias, you mean the algorithms and such?
14:05 ruoso pmurias, sort of... I'm a social scientist, not a computers scientist ;)
14:05 PerlJam The standard Hash is just my Any %hash{Str};
14:05 PerlJam S09
14:06 moritz_ PerlJam: does that mean that $hash{$stuff} = 2; calls $stuff.Str?
14:07 PerlJam moritz_: um ... no.  It means that $stuff is evaluated in a string context
14:07 [particle] ~$stuff
14:07 ruoso PerlJam, which in the end means a call to $stuff.Str if (!$stuff.^does(Str))
14:07 pmurias ruoso: you need a function which maps your object to an int for hashes to work, the more evenly it works the faster they are
14:07 PerlJam If you want a hash that takes anything as keys, you'd declare it as  my %hash{Any}
14:07 PerlJam ruoso: if you say so. :)
14:08 pmurias if you had -> {1} as your hash function your hashes be equivalent to a linked list ;)
14:08 ruoso pmurias, I see...
14:08 b_jonas PerlJam: thanks
14:09 b_jonas does that mean it stringifies non-string keys on both set and get?
14:09 ruoso pmurias, that is not specced... but considering the nature of Perl 6, I would argue that you need to do that calculation with the return of WHICH
14:10 xinming joined #perl6
14:10 redicaps joined #perl6
14:10 b_jonas ruoso: I woudln't be so sure
14:10 b_jonas because the comparision of two elements can be faster if it's implemented directly instead of through WHICH
14:10 pmurias the only time i implemented a hash i used the builtin stl hashing function ;)
14:10 b_jonas and I think that might help a bit with some simpler classes like numerics
14:11 ruoso in fact... I think the implementation is free to require WHICH to return a native type
14:11 pmurias we can always use .Str
14:11 ruoso pmurias, I would argue .buf8
14:11 b_jonas does .Str make a copy of values that are already mutable strings?
14:12 ruoso b_jonas, .Str should return a copy, or something that behaves like a copy...
14:12 moritz_ are there mutable strings at all?
14:12 b_jonas how about special strings that are not just strings but subclassed or otherwise augmented
14:12 b_jonas ?
14:12 b_jonas rouso: where is .Str even defined in the synopses?
14:12 b_jonas moritz_: I think there are in perl6
14:12 b_jonas I think they're even the default
14:13 b_jonas though most often you might still be doing non-mutation operations on them
14:13 ruoso b_jonas, Str is immutable
14:13 pmurias WHICH is speced to make a bad hash function
14:13 b_jonas ruoso: I must be confusing something then
14:13 ruoso b_jonas, S02 (builtin data types)
14:14 pmurias ruoso: re social scientist, what degree did you take?
14:14 moritz_ http://perlcabal.org/syn/S02.html#Immutable_types
14:14 lambdabot Title: S02
14:14 ruoso pmurias, I actually didnt' finish yet...
14:14 ruoso pmurias, some credits still missing...
14:14 b_jonas straaange
14:14 ruoso pmurias, but I've already presented my final monographu
14:15 PerlJam Str is specced, but where is it written that .<typename> does a coercion?
14:15 pmurias ruoso: what were you studing?
14:15 PerlJam $foo.Int  $foo.Str  $foo.str  etc
14:15 b_jonas moritz_: but later in S02 it says Str can be mutable
14:16 ruoso pmurias, about bad hashes... you have to remember that you have polymorphic representations of the objects.... which means that if it's not WHICH, it's some other method that *every object* will need to implement (or inherit, of course)
14:16 b_jonas "This is assuming the string isn't modified in the meanwhile;"
14:16 ruoso pmurias, Debian's governance....
14:16 b_jonas "a StrPos is not a "marker" and is not required to follow changes to a mutable string."
14:16 moritz_ b_jonas: I guess that's a bit imprecise...
14:16 moritz_ b_jonas: a variable that holds a string can change
14:16 b_jonas moritz_: but didn't someone say on this channel that Str can be mutable?
14:17 b_jonas Str itself, not just the Scalar holding it
14:17 moritz_ dunno - why would it be tagged as "immutable" in the spec then?
14:17 PerlJam Str is immutable. no matter what anyone says on #perl6
14:17 PerlJam (unless that someone is TimToady ;-)
14:18 moritz_ nice to hear that from somebody on #perl6 ;-)
14:18 ruoso "changes to a mutable string" means "changes to a (something that is not the standard Str type, but answers true to .does(Str)"
14:19 moritz_ ruoso++ good explanation
14:19 ruoso remember that in Perl 6 there's no way to know what the Object really really is
14:19 ruoso the object can lie about itself if it wants to
14:19 moritz_ ruoso: not even with .WHAT and .HOW?
14:19 pmurias lunch&
14:19 ruoso .WHAT and .HOW are also implemented by the object
14:20 ruoso because of the different representations support
14:20 ruoso the interpreter cannot assume to know how to fetch that information
14:20 ruoso it must make a method call on the object to do it
14:20 b_jonas I'll try to search for that mutable Str issue
14:20 PerlJam b_jonas: mutable strings are called Buf  :-)
14:20 b_jonas I'd like to find out why I remember mutable strings
14:21 b_jonas PerlJam: no, it wasn't only bufs
14:21 b_jonas it might have been only bufs that are mutable by default though
14:21 ruoso PerlJam, Buf doesn't implement character properties and stuff like that...
14:22 ruoso but nothing stops someone from implementing StrBuf
14:22 ruoso the "builtin data types" are just the *built in*... they have nothing special besides being loaded in the Prelude
14:23 pmichaud fwiw, S12:1864 says that WHAT and HOW are actually macros, not methods.
14:23 pmichaud (Rakudo currently implements them as methods as a temporary workaround, yes.)
14:23 ruoso pmichaud, sorry... I didn't expressed correctly... I meant that there's no way of implementing them without method calls...
14:23 ruoso because the interpreter cannot assume the object's internal representation...
14:24 pmichaud I won't disagree with that (but I don't necessarily agree, either :-)
14:24 PerlJam pm: Have you thought about a career in politics?  ;)
14:24 pmichaud pj: yes, many times.
14:25 xinming joined #perl6
14:25 b_jonas otoh, mutable classes that implement a Str role (if there is such a role) would make sense
14:26 b_jonas seems like I misremembered
14:26 b_jonas couldn't find it in the log
14:26 PerlJam b_jonas: you can never trust your memory.  The brain lies to itself all the time.
14:26 b_jonas yeah
14:26 pmichaud internally Str can probably be mutable for efficiency reasons, as long as it appears to act immutable to the Perl 6 programmer
14:26 b_jonas oh sure
14:27 b_jonas just like in perl5
14:27 b_jonas Str has to have lots of magic in implementation
14:27 PerlJam no more magic than any other type
14:27 b_jonas it shall be one of the most complicated and most optimized classes
14:27 b_jonas I mean in implementation
14:27 b_jonas because perl 6 has to be good at string handling
14:28 ruoso b_jonas, and don't forget all that unicode thing...
14:28 b_jonas and there are lots of unicode and encoding semantics it has to optimize a great deal
14:28 b_jonas and copy-on write
14:28 pmichaud (and this is a big reason why PGE was written in PIR and not C :-)
14:28 b_jonas deciding when it has only one copy of the string so it can mutate in place in memory
14:29 b_jonas PIR and C are supposed to be easy to mixed anyways
14:41 pmurias b_jonas: mixing PIR with C is not easier than mixing any normal parrot language with C
14:41 iblechbot joined #perl6
14:42 b_jonas pmurias: but they're both quite easy, right?
14:42 b_jonas at least that's what they seemed to advocate about parrot a lot
14:44 rdice joined #perl6
14:44 ruoso b_jonas, one way or another you always need to implement type-mapping... there isn't much that can be done about it...
14:45 ruoso you can have some tools to make the type-mapping more abstract...
14:45 ruoso I was thinking about it...
14:46 pmurias b_jonas: i don't have much parrot experience (and not recently)
14:46 ruoso and if you have a global catalog for header files, which symbols they define, and which libraries implement them... you could have a single reusable repository of "type-mappers"...
14:47 ruoso and then you could transit between different C libraries and let this framework do the job...
14:47 ruoso but C is almost never declarative enough to allow much inference...
14:47 pmurias or you can just extend your set of types in the language, and not do any type-mapping
14:47 ruoso pmurias, how can you call a C library without type-mapping?
14:48 pmurias the same way a C compiler calls a C library
14:48 ruoso uh?
14:50 pmurias you use type-mapping for two reasons your language dosn't support some of the c types, or you don't like c types
14:50 ruoso pmurias, it's not your language that doens't support it... is your runtime that has some additional data in the object that should not be present in the C call
14:51 ruoso if the call only contains int as parameter, that's cool
14:51 icwiener_ joined #perl6
14:51 hercynium joined #perl6
14:52 pmurias ruoso: ints are no different from other types in that regard
14:52 ruoso if it contains a struct, you could even represent it as a hash...
14:52 Exodist joined #perl6
14:53 ruoso but building a struct from the header at runtime would require linking to libgcc
14:53 pmurias you need some minimal unwraping
14:53 ruoso pmurias, the point is that it ain't minimal at all... when you start to think about real use cases, you realise that it is specific to each C library
14:53 pmurias no
14:54 pmurias c has structs,number and pointers
14:54 pmurias * numbers
14:54 pmurias and function pointers
14:54 pmurias (did i forget anything) ;)
14:55 ruoso yes... void* ;)
14:55 ruoso which means you can't introspect at all
14:55 ruoso and then there are different conventions on malloc/free
14:55 pmurias the c guy can't too
14:55 ruoso some libraries returns objects that you must free()
14:56 ruoso other requires you to call a specific method to destroy it
14:56 ruoso pmurias, the c guy is reading the docs on how to use it...
14:56 ruoso and then there are object-oriented c implemtations...
14:56 ruoso like Glib
14:56 ruoso or even berkeley db
14:56 pmurias can't we borrow the c guys docs?
14:57 ruoso pmurias, the docs are not parseable
14:57 ruoso pmurias, you doesn't have much metadata to infer the type-mapping...
14:57 pmurias i agree with that
14:57 ruoso sometimes (as in SMOP), two structs are related (super-class and sub-class like)
14:58 pmurias but i don't have to do type mapping if i want to use a library the same way as i do in c
14:59 pmurias the fact that i'm using a civilized language dosn't mean i have to use my libraries in a civilized way
15:00 ruoso pmurias, still... how do you handle the different malloc/free conventions?
15:00 pmurias manualy ;)
15:00 moritz_ "how to write segfaulting perl 6 code"
15:01 ruoso heh... I really think it's worth writing a type mapping code for each library you want to use...
15:01 ben__ The first chunk of (incorrect) perl 6 code I ran after installing parrot caused a segfault :|
15:01 moritz_ ben__: sadly that's not too hard atm
15:01 moritz_ ben__: but it's improving
15:02 moritz_ .oO( because you get a "Null PCM access in type()" for every second type declaration )
15:02 ruoso pmurias, but you already have a way to wrap any library calling convetion more easily in Perl 6 than you had in Perl 5... because of the representation polymorphism...
15:02 ruoso you don't have to put stub methods and hold a int SV* for every pointer...
15:03 ruoso you can actually re-implement the method-dispatch for that object
15:07 Alias_ joined #perl6
15:09 rakudo_svn r29231 | jonathan++ | [rakudo] First crack at starting to get named enums in place. This sets up a role, a class, and puts instances of it (for the enum values) into the right places. It introduces an Enum base class for all enumerations also. This doesn't let us do a lot useful with them yet, but
15:09 rakudo_svn ..it's the first step. If this turns out to be a good base to build the rest on, what I'm checking in now will undoubtably get clean-up to eliminate a few bits of inline PIR; for now, it's just the easy way to have something to play with. Also contains a minor refactoring to extract from
15:09 rakudo_svn ..declare_attribute the code that makes an accessor, since enum_declarator also needed it.
15:12 sri_work joined #perl6
15:22 pmurias ruoso: some sort of exception mechanism would help in smop
15:22 pmurias instead of just printing an error message
15:24 pmurias maybe having a SMOP_THROW("...") placeholder would help
15:24 pmurias ?
15:24 pmurias s/would help/would be a good idea/
15:44 pmurias ruoso: we don't have an undef in smop yet? (i have to put something in newely create hash cells)
15:45 moritz_ pmurias: why?
15:45 moritz_ there's still the distinction between "exists" and "undef"
15:45 moritz_ s/undef/defined/
15:46 moritz_ usually you don't create a hash cell unless you have something to put into
15:47 pmurias moritz_: you have to create it to put something in it
15:48 moritz_ yes, but then you know at creation time what to put in
15:48 moritz_ and you don't have to worry about what it is
15:48 pmurias no
15:49 pmurias my $cell := $foo{'baz'};$cell = 1;
15:49 moritz_ so you need some kind of undef proxy object
15:49 moritz_ now I understand
15:50 moritz_ the same kind that you need for autovivification
15:50 pmurias i'm not doing autovivification
15:51 moritz_ the thing  inf $foo{'baz'}, isn't that just a scalar container?
15:52 pmurias yet
15:52 pmurias it's a proxy scalar container
15:53 pmurias in the autovification case, and a normal once the way i'm doing it initialy
16:15 justatheory joined #perl6
16:23 alester joined #perl6
16:30 pmurias ruoso: the tests should be numbered in the order features depend on each other or i the order they were added?
16:32 alanhaggai joined #perl6
16:47 Jamtech joined #perl6
16:48 casyn joined #perl6
16:57 ruoso pmurias, the exception mechanism still need some features in SLIME I think... but the bigger problem is that down this level, there isn't where to go in an exception...
16:57 ruoso pmurias, defined is just something that says true to ".defined"
16:57 ruoso pmurias, undef is just something that says false to that call
16:58 ruoso pmurias, autovivification is a very difficult issue in Perl 6, my advice is implement P5 like autovivification for now
16:59 ruoso pmurias, which means implementing a proxy scalar for each key
16:59 cjfields joined #perl6
17:01 pmurias ruoso: i don't understand the exception part
17:01 ruoso pmurias, there's an attribute of the frame which is "jail"
17:02 ruoso this attribute would contain the exception handler
17:02 ruoso but that will only be effective when more things are inside the interpreter...
17:02 ruoso we still have most of the code running as standard C calls...
17:02 ruoso this should change as we have more and more sm0p usage
17:03 ruoso and also, most of the code is not setting the "outer" attribute of the frame...
17:03 pmurias we can have a place holder SMOP_THROW(...)
17:03 pmurias which will throw an exception when they are implemented and print an error message for now
17:04 kanru joined #perl6
17:04 ruoso the point is that there isn't *the* exception handler in smop... there will be as many exception handlers as implemented
17:04 ruoso the interpreter doesn't need to care about it
17:06 wknight8111 joined #perl6
17:10 pmurias ruoso: any solution then?
17:10 alanhaggai_ joined #perl6
17:11 pmurias 12_opaque leakes memory, ok?
17:22 pmurias ruoso: i read the commit
17:23 pmurias the present and past tense of read being spelled identically in english is extremely annoying
17:24 moritz_ that's why the present is more accurately described as "I'm reading the commit" ;-)
17:26 apple-gunkies joined #perl6
17:27 cjfields joined #perl6
17:27 TimToady yes, to a native English speaker, "I read the commit" can only mean something like "I habitually read any commit"
17:27 TimToady "I read books" doesn't mean I'm reading books right now
17:29 TimToady (in both cases, pronounced "reed" rather than "red")
17:30 pmurias TimToady: "read the commit" is the sentence which annoys me
17:32 pmurias which as i understand can either order someone to read the commit or means i read the commit
17:32 TimToady well, that's just an amibiguity in writing, not in spoken speech
17:33 moritz_ we should phonetically annotate our IRC conversations ;)
17:34 TimToady and pragmatically, you'd usually get either "Read the commit, please." or "Already read it."
17:34 moritz_ if you're eloquent enough, yes. That's a bit tougher if English isn't your first language ;)
17:34 moritz_ s/first/native/
17:35 [particle] pragmatic instant messaging, now available in a chatroom near you
17:35 TimToady yes, the problem with human languages in general is that native speakers know where the holes are and aren't, and assume the hearer does too.
17:37 TimToady I hit this all the time in Japanese.  I'll look for a word for a long time before figuring out it's a proper noun.  This would be immediately obvious to a native speaker.
17:43 pmurias TimToady: what's the next thing you're hacking on now that STD.pm parses itself?
17:49 Eevee joined #perl6
18:12 TimToady pmurias: probably rewriting gimme5 as a STD emitter as a long-term goal.  Shorter term, writing {*} reductions to produce something more like an AST.
18:12 pmurias something like pixie? ;)
18:12 TimToady I'm also thinking about refactoring the top-level namespaces
18:13 TimToady so the grammar might end up being called STD::Perl, for instance
18:14 TimToady but I have to think about how languages get used from the user-point of view
18:14 TimToady "use Perl" can't mean both of "pull the Perl grammar into the current grammar" and "switch to language Perl for the rest of this scope"
18:15 TimToady and this is tied into to macros handle "is parsed" and such
18:15 TimToady s/macros/how macros/
18:16 pmurias what's the equivalent of make test for gimme5?
18:16 moritz_ test? ;-)
18:16 moritz_ what's that?
18:16 b_jonas wouldn't p6 still have the convention about lowercase pragmas?
18:17 moritz_ is a switch in laguage a pragma?
18:17 b_jonas well, most p5 Acme modules that change the language aren't lowercased
18:18 b_jonas nor is Switch
18:18 pmurias TimToady i fixed a bug with "\\" matching \\
18:18 moritz_ think of it as Acme::Perl6 then ;-)
18:19 TimToady I currently test by running a script call "trystd"  :)
18:19 Schwern joined #perl6
18:20 pmurias TimToady: you're testing this one then ;)
18:22 TimToady I think the user wants to be able to just say "use FooLang" since that's the common use case, and the grammar for FooLang should be in some other place
18:22 TimToady Grammar::FooLang maybe, but I rather like the idea that the standard Perl 6 definition would be in STD::Perl for psychological reasons
18:22 pmurias TimToady: it got fixed in svn HEAD, silly me
18:24 PerlJam TimToady: seems like another use/mention distinction (maybe that means another keyword :)
18:24 pmurias visiting a friend&
18:24 ruoso TimToady, there's always the dispatch code if you're out of tasks ;)
18:25 TimToady more like a distinction between the language and the grammar for the language
18:25 TimToady ruoso: that's not gonna happen any time soon...  :P
18:25 ruoso TimToady, in fact... it would be nice to have a Perl 6 implementation of the Perl 6 types...
18:26 ruoso even if nothing is able to run them right now...
18:26 TimToady maybe nothingmuch can run them  :)
18:27 nothingmuch nuffinvm
18:27 nothingmuch unfortunately my CPS evaluator has GC issues
18:28 nothingmuch unless ritalin is applied i lose old stack frames
18:28 TimToady seriously, I think nothingmuch would do a better job writing the fiddly bits of responder/dispatcher
18:29 TimToady just check every change into svn, and let it keep the stack frames for you :)
18:29 TimToady then write a program that randomly applies/unapplies the last 100 changes until you get a version that works. :)
18:29 ruoso TimToady, btw... speaking of old frames... did you have some time to take a look at the meta methods thingy?
18:30 TimToady which meta methods thingy?
18:31 ruoso TimToady, the problem of $foo.HOW.methods() with prototype-based OO
18:31 ruoso because some metaclasses might be shared by several objects
18:31 ruoso and you might need to call methods in the metaclass instance itself
18:31 ruoso that are not related to a single object
18:32 ruoso my proposed solution was to force the given object as first positional argument for the metamethods
18:32 ruoso and that $foo.^methods would actually be translateable to $foo.HOW.methods($foo)
18:32 hercynium joined #perl6
18:32 TimToady I thought I already told you that was my preference
18:33 ruoso does that mean it won't conflict with the current spec?
18:33 ruoso S12 states that $foo.HOW.methods() is the same as $foo.^methods()
18:33 TimToady the current spec is still an approximation of Truth  :)
18:33 b_jonas wait, isn't that meant to be (^$foo).methods ?
18:34 ruoso b_jonas, that's a sintatic variant
18:34 TimToady S12 is speaking from the user-point of view, not the implementor's point of view
18:34 b_jonas is it?
18:34 moritz_ isn't ^$foo the same as 0...($foo-1) ?
18:34 moritz_ erm, just two dots
18:34 b_jonas moritz_: yep
18:34 b_jonas or more precisely as 0..^$foo
18:34 ruoso TimToady, yes... and the user will expect $foo.HOW.methods() to have no positional arguments...
18:34 TimToady it's the "domain", which for types is the metaobject :)
18:35 b_jonas but only for numbers
18:35 Lorn joined #perl6
18:35 moritz_ b_jonas: so why should introspection be different for numbers than for other stuff?
18:36 ruoso TimToady, S12 explicitly says that $foo.HOW will hold a "implicit" relation to the object... and that you can my $b = $a.HOW; $b.methods() and still get the methods from $a...
18:37 b_jonas moritz_: actually ^ means not only introspection but like three different things
18:37 b_jonas depending on what $foo is
18:37 b_jonas S03 tells what exactly
18:37 moritz_ b_jonas: but surely not prefix:<^>?
18:37 b_jonas thoguh how I used it might have been wrong
18:37 b_jonas yes, prefix
18:37 b_jonas it's a multimethod probably
18:38 b_jonas or multi sub rather
18:38 rakudo_svn r29243 | pmichaud++ | [rakudo]: spectest-progress.csv update: 94 files, 1679 passing tests
18:38 b_jonas "The .^ operator calls a class metamethod; foo.^bar is short for foo.HOW.bar."
18:38 b_jonas for the infix syntax you mentioned
18:38 b_jonas but as for the prefix ^,
18:39 moritz_ ok, that makes sense
18:39 b_jonas "If applied to a type name, it indicates the metaclass instance instead, so ^Moose is short for HOW(Moose) or Moose.HOW. "
18:40 b_jonas so it won't work for any object as introspection
18:40 moritz_ ok
18:40 moritz_ thanks b_jonas
18:41 ruoso TimToady, should I consider that part of S12 as something that wasn't still rewritten?
18:42 TimToady I think we need to be clear which variants of HOW are macros that rewrite to an internal form that supplies $obj as the first arg
18:43 ruoso but that is not compatible with prototype-based OO
18:43 TimToady but I don't think people want to write $obj.^can($obj, "bark") all the time
18:43 ruoso I think the .^ operator can do it
18:43 TimToady maybe the .^ forms rewrite, and the .HOW doesn't
18:44 ruoso yes... that's my point...
18:44 TimToady but currently S12 is assuming the .HOW is also a rewrite
18:44 ruoso yes... but that rewrite is not ok for prototype-based OO
18:45 ruoso my $a = $foo.HOW(); $foo.some_metaclass_instance_general_method()
18:45 TimToady sec, work &
18:45 ruoso s/general/specific/
18:49 ruoso as a pratical example... let's consider a SOAP metaclass that store in the local object the WSDL for the service... you might want to say $foo.HOW().require_ssl = 1; and that would apply to every object that shares this metaclass instance...
18:50 ruoso (require_ssl is probably a bad example)
18:50 ruoso my $meta = StubType.HOW(); $meta.http_credentials = $http_digest_auth_data;
18:53 ruoso my $rpc = SOAP::MetaClass.new(wsdl => 'http://foo.com/wsdl'); my $port_type = $rpc.get_type('port_type_name');  $port_type.HOW === $rpc;
19:04 justatheory joined #perl6
19:06 justatheory joined #perl6
19:11 rakudo_svn r29246 | jonathan++ | [rakudo] Shuffle enums around a bit so that the role is named and the class anonymous. Get rid of Enum class since it's not spec'd and we can do find without it. Also make instances of the enum class act more value like, so you can say EnumMember to get the underlying value of
19:11 rakudo_svn ..EnumMember.
19:19 monomorph joined #perl6
19:19 monomorph left #perl6
19:23 pugs_svn r21298 | moritz++ | [spec] add a simple test that an Enum can act like a role
19:34 frobnitz joined #perl6
19:37 rakudo_svn r29248 | pmichaud++ | [rakudo]:  add 'polar' to Complex and Any (RT #56754, moritz++)
19:37 [particle] really? .polar in Any?
19:39 pmichaud my $x = '12';   say $x.polar;
19:40 [particle] yeah. i wouldn't expect that to work
19:40 pmichaud but it should.
19:40 [particle] can't find method 'polar' on Scalar $x
19:40 moritz_ [particle]: why not?
19:40 pmichaud $x isa Str
19:40 * PerlJam starts working on his patch for .tropical and .equatorial
19:40 [particle] oops, Str $x
19:40 pmichaud would you expect this to work?    my $x = 4;   say $x.polar;
19:41 [particle] no
19:41 pmichaud how about:   my $x = 4+0i;  say $x.polar;
19:41 [particle] yes
19:41 pmichaud interesting.
19:41 [particle] 4 is not a coordinate
19:42 pmichaud 4 is numerically the same as 4+0i, though.
19:42 pmichaud rakudo:   say 4 == 4+0i;
19:42 p6eval rakudo 29248: OUTPUT[1␤]
19:42 [particle] indeed, +(4+0i) == 4
19:42 [particle] but that numifying
19:42 [particle] not complexifying
19:43 moritz_ [particle]: every integer is also a complex number
19:43 [particle] every integer is also a power of pi
19:44 moritz_ that's why you can call .log on it
19:44 PerlJam [particle]: you would expect .polar to work on anything that does(Complex)  ?
19:44 [particle] perljam: yes
19:45 [particle] or anything that does the 'coordinate' role or whatever
19:45 PerlJam so, you just think that Any is too far up the food chain for .polar?
19:45 [particle] does say '4+0i'.polar work?
19:45 [particle] yes.
19:46 [particle] my Opposite $x = 'North'; say $x.polar
19:46 [particle] should i really be overriding Any.polar in the Opposite class def?
19:46 pmichaud my Opposite $x = 'North';   say $x.abs
19:47 moritz_ [particle]: why not?
19:47 [particle] method 'abs' not found for class 'Opposite'
19:47 newbsd joined #perl6
19:47 moritz_ overriding builtins is by no means evil in Perl 6
19:47 [particle] do we really need abs and polar in the core of perl 6?
19:47 pmichaud my Opposite $x = 'North';   say $x.join(';')
19:48 pmichaud particle:  they're in the test suite.
19:48 [particle] sure, and S29 is not yet approved
19:48 b_jonas [particle]: I'd like all of complex numbers considered just normal numbers in p6 core
19:48 [particle] so they're unofficially specced
19:48 b_jonas (or in most other languages anyway)
19:48 pmichaud particle:  au contraire
19:49 b_jonas and I'd also like them use the c99 operators and functions for calculation if available, for speed
19:49 newbsd left #perl6
19:49 pmichaud Functions.pod:29   says   "This document is now the official S29."
19:49 PerlJam d the connection]
19:49 PerlJam 19:32 < qweqwe> as you want me to do it
19:49 PerlJam oops
19:50 b_jonas (otherwise fall back to a slower implementation or the libstdc++ functions)
19:50 [particle] well, it seems here that i'm outnumbered, although that may be because my imaginary friends aren't on irc
19:50 pmichaud I'm only going by what I'm interpreting from TimToady's statements
19:50 [particle] i'm sure you listen to him more often than i do :)
19:50 b_jonas (the libgsl implementation of complex could be considered as a fallback as well, if it's already installed on the machine)
19:51 b_jonas but basically, it should be the fast complex functions in libgcc and libc
19:51 [particle] sure, but parrot can't rely on gsl 'cause it's not win-compat
19:51 [particle] and speed isn't the issue here, it's semantics
19:51 [particle] what does *.polar print?
19:52 pmichaud TimToady has already explicitly said that .grep, .join, .elems, etc are defined on Any
19:52 [particle] *say *.polar
19:52 pmichaud even though they aren't lists
19:52 [particle] that's kind of annoying, too.
19:52 PerlJam heh
19:52 [particle] Junction.grep doesn't work?
19:53 pmichaud and that  .eval works on Any as well, even if the invocant isn't a Str
19:53 pmichaud (yesterday's design meeting)
19:53 pmichaud so, I'm not advocating a position as much as I'm delivering a message.  :-)
19:53 [particle] does that belong on Any, or Object?
19:54 pmichaud afk for a bit
19:54 [particle] like, i could stick a bunch of plugin subs in a junction, then .eval them
19:56 b_jonas pmichaud: that sounds like that strange lisp eval :-)
19:58 pugs_svn r21299 | moritz++ | [spec] fixed role tests, jonathan++
20:00 moritz_ rakudo: enum Maybe <No Yes>; my $x = 42; $x does Maybe(Yes); say $x.Maybe; say $x.No; say $x.Yes;
20:00 p6eval rakudo 29248: OUTPUT[1␤0␤1␤]
20:03 TimToady [particle]: generally these things go into Any so that autothreading kicks in on non-Any
20:04 [particle] so, junctions contain Anys, and delegate the method to all members, in an autothreaded fashion?
20:06 TimToady that's precisely why Junction !~~ Any, so the decision to autothread falls out of mmd naturally
20:08 rakudo_svn r29251 | moritz++ | [rakudo] add first enum test to spectest_regression (+9 pass)
20:09 b_jonas seems strange
20:09 * b_jonas looks up the exact rules for ~~
20:10 donaldh joined #perl6
20:10 moritz_ in this case means "Junction is not of type Any"
20:10 [particle] ok, that ~~ sense
20:11 TimToady mmd does constraint checks via smartmatching, basically, and parameters by default have a type of Any
20:11 b_jonas yeah, but S03 says ~~ means type membership if the rhs is a type
20:12 b_jonas whereas don't you want to state that Junction is not a subclass of Any or however they say that with roles?
20:12 [particle] and everything but Object and Junction are of type Any
20:12 TimToady also spelled "does"
20:12 [particle] will does(*) mean does(Any) ?
20:12 b_jonas the Junction type itself is not a junction, so shouldn't it match Any?
20:13 TimToady I have no idea what does() will do with a *
20:13 TimToady well, actually, I do
20:13 TimToady Whatever is not the ancestor of normal types, though it's in Any
20:13 TimToady so does(*) is really does(Whatever)
20:13 pmichaud in the case of  Junction !~~ Any,   Junction is the proto-object for junctions
20:14 TimToady and hence generally false
20:14 pmichaud and that protoobject is not Any
20:14 moritz_ TimToady: but isn't that a bit inconsistent, since you expect when *  to be always true?
20:15 pmichaud when *   would be the same as     $_ ~~ *    (which is not the same as does(*) )
20:15 TimToady * is of type Whatever, but it probably isn't the protoobject
20:16 TimToady especially once you start getting values like *-1 floating around
20:16 moritz_ but when you smartmatch against $stuff, you don't smartmatch against $stuff's type
20:16 moritz_ ok, I read it again
20:16 pmichaud it depends on what $stuff is :-)
20:16 moritz_ forget my last comment
20:18 pmichaud TimToady: shall I go ahead and removes lines 213-214 from S12?  (method fall back to sub)
20:18 pmichaud *remove
20:18 TimToady actually, *-1 is probably of type Code:($) or some such
20:19 moritz_ btw can we do ranges with *-1?
20:19 TimToady pmichaud: go ahead
20:19 TimToady *-1 is just a number that is relative to something unspecified
20:19 moritz_ @list[1..*-2]
20:19 lambdabot Unknown command, try @list
20:20 * pmichaud feels like he's channeling Smeagol these days.
20:20 b_jonas I'll have to read S12 to get all that terminology about classes, roles, traits, proto-objects, metaclasses
20:20 moritz_ I fear S12 mostly assumes you know them already
20:20 * pmichaud wonders if Parrot ~~ "the One Ring"
20:21 b_jonas then S*
20:21 TimToady Nasty hobbitses ruin nice synopseses...
20:22 speckbot r14559 | pmichaud++ | S12:  Remove "method fall back to subroutine".
20:23 ruoso TimToady, sorry for being such a boring guy... but... could we clear the issue with the meta methods?
20:23 ruoso my proposal is:
20:23 TimToady moritz_: if .. is overloaded to map one Code:($) into another, then sure.
20:23 ruoso $foo.^meta() rewrites to $foo.HOW.meta($foo)
20:23 ruoso and $foo.HOW.methods require $foo as first positional argument, while $foo.^methods() doesn't
20:24 pmichaud b_jonas: the beginning of http://www.parrotblog.org/2008/05/p6object-perl-6-metaclasses-for-parrot.html tries to explain P6's metaobject model
20:24 lambdabot Title: Parrot: P6object: Perl 6 metaclasses for Parrot, http://tinyurl.com/5t5m6f
20:24 b_jonas pmichaud: I'm too tired to read such things now
20:24 TimToady ruoso: I'm fine with that
20:24 b_jonas it's probably only the terminology that's strange anyway
20:25 ruoso TimToady, nice. S12 needs to be updated then...
20:25 pmichaud b_jonas: probably, but the article tries to clear up the terminology
20:26 pmichaud or at least present a simpler way of looking at it
20:26 thepler S03 says "Two values are never equivalent unless they are of exactly the same type"
20:26 thepler ( PosInt.new(5) === Int.new(5) ) # true or false?
20:26 thepler does it depend on whether PosInt is a subset or a class?
20:27 ruoso thepler, "Any object type may pretend to be a value type by defining a .WHICH method which returns a value type that can be recursively compared using ==="
20:29 ruoso thepler, there isn't really a way to know the actual implemented type for an object
20:31 thepler ruoso, but something has to check that they're the same type, no?
20:31 TimToady subsets aren't types in that sense, so if PosInt is just a subset of Int, it's of type Int
20:31 TimToady PosInt is a constraint with a name
20:31 TimToady but values have to use storage types like Int
20:32 TimToady so the above is likely to be true
20:32 ruoso thepler, not really...  as long as the object complies to the API it advertises, it's ok
20:32 TimToady however, if you really want numeric equality, use ==   :P
20:33 thepler so if PosInt is a subset, then the expression is true
20:33 ruoso but Int doesn't assume a storage type...
20:33 TimToady ruoso: what would you propose about the ^Foo.method notation?
20:33 ruoso only "int" does...
20:33 ruoso TimToady, honestly... that notation always looked confusing to me...
20:33 thepler what if class PosInt is Int {...}?  Then Int and PosInt are different types and then the expression is false?
20:33 TimToady by storage type I just mean a type that an actual object my be
20:33 TimToady I don't just mean native type
20:34 TimToady *may be
20:34 rakudo_svn r29254 | jonathan++ | [rakudo] Implement the but operator. To get it resolving enums correctly, we also mark the enum anonymous class with the 'enum' property; we may find a better way later.
20:34 TimToady thepler: yes, it would be false in that case, so use ==  :)
20:34 ruoso TimToady, I think ^Foo is the same as Foo.HOW...
20:35 ruoso TimToady, which means that no first argument is prepended...
20:35 thepler TomToady: right-o.  just trying to understand the difference between types and classes
20:37 TimToady objects can really only be of class type.  containers can have subset constraints and role constraints
20:40 ruoso TimToady, but... if IntSubClass implements WHICH by returning an Int, $subint === $int could be true...
20:43 ruoso that's the "recursively" part of the spec... which means that the implementation will call WHICH until it has something it knows how to compare...
20:44 thepler ruoso, I think 2 values cannot be === unless they are in exactly same class
20:44 ruoso === calls WHICH on each side...
20:44 ruoso it depends on what return it gets...
20:44 thepler if they are, and that class implements .WHICH, then those values will be compared
20:45 ruoso thepler, everything must implement WHICH
20:45 ruoso thepler, the interpreter cannot assume to have a way to compare the objects...
20:45 ruoso thepler, the interpreter cannot assume to know how the object is implemented
20:45 ruoso not in terms of which methods it has
20:45 ruoso but how it's lowlevel is represented
20:45 thepler ruoso, right, everything must have a .WHICH
20:46 thepler but I would think that .WHICH isn't even called if the values are in different classes -- but I could very well be wrong
20:47 ruoso thepler, that's the point.... the interpreter cannot really check if they are of the same class...
20:47 ruoso the interpreter need to ask that to the object...
20:47 ruoso and the object can lie
20:48 ruoso (which is, actually, one of the most exciting features of Perl 6)
20:48 thepler $a.HOW === $b.HOW ??  (I'm guessing)
20:48 ruoso in prototype-based OO several objects of different types are going to share the metaclass
20:50 ruoso but this is how you are going to be able to use Glib as your object representation while still using the default Perl 6 metaclass...
20:59 rakudo_svn r29260 | jonathan++ | [rakudo] Make pseudo-functional variant of but operator work.
21:01 speckbot r14560 | larry++ | [S12] .HOW clarifications requested by ruoso++
21:01 thepler I was thinking about how to implement something like === and .WHICH with p5 + Moose
21:05 jferrero joined #perl6
21:12 cognominal_ joined #perl6
21:12 cognominal_ joined #perl6
21:15 jfredett_ joined #perl6
21:30 rakudo_svn r29262 | jonathan++ | [rakudo] Fix does (and thus but) to not lose an object's association with its proto.
21:41 justatheory joined #perl6
21:41 jfredett joined #perl6
21:58 pmurias thepler: you can implement WHICH with Scalar::Util::refaddr
22:04 thepler pmurias: right but... I'm thinking something like Foo->new->equals( Foo->new ) being true if an appropriate Foo::WHICH is written
22:06 pmurias what part do you have problems with?
22:13 thepler none really.  I think it's all doable.  can even use autobox so I can call ->equals and ->WHICH on anything I suppose
22:14 pmurias should it be indentical instead of equals?
22:14 pmurias * identical
22:15 thepler yeah, or maybe ->is_identical ?
22:15 thepler what's wrong with ->equals though?  already in use?
22:15 moritz_ wtf is -> anyway?
22:15 moritz_ method call in perl 6 is .
22:16 thepler moritz_, p5
22:16 * moritz_ checks which channel he's in
22:16 thepler I was thinking about writing something like p6 === and .WHICH but in p5 + Moose
22:17 moritz_ ah, I didn't follow all of this discussion, sorry
22:28 kattana_ joined #perl6
22:32 pmurias thepler: equals just felt wrong, equivalence and indentity are too different things
22:38 stevan_ thepler: equals wouldlikely clash
22:39 stevan_ Foo->meta->equvalent(Foo->new, Foo->new) would be safer
22:42 pmurias stevan_: equivalanet is what he does *not* want
22:42 pmurias * equivalence
22:42 pmurias === tests for indentity
22:42 stevan_ ok then s/equvalent/identity/
22:43 stevan_ the point was that if you stuff it in ->meta then you dont ahve to worry about local name clashes
22:43 stevan_ or if you stick with ->WHICH  then it is unlikely to clash
22:43 stevan_ but ->equals will class with tons of things
22:50 rakudo_svn r29263 | jonathan++ | [rakudo] Switch True and False over to being real values from the (now existing) bool enumeration, rather than instances of the Bool class.
22:50 pugs_svn r21300 | pmurias++ | [sm0p] added string literals "..."
22:51 pmurias moritz_: do you think it would make sense to have sm0p in the evalbot? ;)
22:51 moritz_ pmurias: what can you evaluated with it?
22:53 pmurias * what can you evaluate it with?
22:53 pmurias ?
22:54 rhr_ joined #perl6
22:54 pmurias moritz_: c code
22:54 pmurias i should go to sleep now, definitly
22:55 moritz_ @tell pmurias if you want to evaluate C code with evalbot + sm0p from IRC - forget it. There's not even a slight change you'll get it have ways secure
22:55 lambdabot Consider it noted.
22:57 pugs_svn r21301 | moritz++ | [irclog] try to restore some of the old layout
23:18 pugs_svn r21302 | moritz++ | [spec] three more tests for string concatenation (with empty strings)
23:33 ruoso joined #perl6

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

Perl 6 | Reference Documentation | Rakudo