[perl #48260] [TODO] [C] [core] Write function documentation
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48260] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48260 There are MANY functions within the Parrot repository which as yet aren't documented. These need to be documented, please! Each needs an appropriate description of what the function does, and the meaning of any arguments.
[perl #48264] [TODO] [C] [core] Write file-level documentation
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48264] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48264 Many files in the Parrot repository are lacking descriptions within the pod DESCRIPTION section. This needs to be done. An appropriate description of what the given file does is all that is necessary.
[perl #48266] [TODO] [C] Write file-level documentation
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48266] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48266 This transaction appears to have no content
[perl #48266] [TODO] [C] Write file-level documentation
Apologies for the extra email! This was an abortive attempt to Ctrl-C out of a command line RT session. Closing ticket.
What is the origin of the nickname, Texas quotes?
From S02: The double angles may be written either with French quotes, «$foo @bar[]»||, or with Texas quotes, $foo @bar[],|| as the ASCII workaround. I'm curious about the naming of Texas quotes. My guess is that the name is inspired by the existence of a town called Paris, Texas. That city's name might remind you of France, but isn't the real thing. Similarly, Texas Quotes|| might remind you of «French Quotes», but they're not quite as elegant. Have I got that right? =thom Happiness lies in being privileged to work hard for long hours in doing whatever you think is worth doing. --Dr. Jubal Harshaw in /To Sail Beyond the Sunset/, by Robert A. Heinlein
[OT][SPAM] Re: Pair notation for number radix
This is another great example of why I love this list. :o] I live in GA, so far out in the boonies that I can't get cable or broadband at *all* except for by satellite. I've stopped trying to explain what I do, because I start saying things like this, and they glaze and visibly regret it, lol Now I just tell them my official job title is computer monkey. That works pretty well. :) But so that this post isn't (hopefully) entirely hot air, How does this sort of adverbial typecasting relate back to compile time typing? The old my Dog $spot thing? There seems to be a significant relationship, but I can't wrap my head around where the underlying mechanics might be usefully applied. goes off to reread the synopses/exegeses et alii --- Ryan Richter [EMAIL PROTECTED] wrote: On Tue, Dec 04, 2007 at 07:39:16AM -0800, Larry Wall wrote: On Sun, Oct 07, 2007 at 03:01:06PM -0600, David Green wrote: What happened to the suggestion of using ` to designate units? It's kinda caught between two other notions. On the one hand, we're trying to reserve ` for user definition, in part because it's so difficult to tell from ' in many fonts so we're avoiding it for standard usage. On the other hand, it's not clear that units aren't generally just simple multiplication by a scaling factor: 1*in, where 1*in == 2.54*cm, for instance. Units could also be viewed as type conversion, which would give us kg(1) and 1.kg as conversion forms in current Perl 6. Since 1.kg is essentially using the units as a postfix, presumably the 1kg form could also work on literals, just as we currently allow 1i to convert 1 to i via the postfix:i operator. (And I suppose there's a sense in which 10e-2 is specifying the scaling factor of the left side explicitly.) In any case, though, if we treated them as type names rather than just methods, we'd probably want to require predeclaration of unit names since a type name like kg or in or fortnight could easily collide with a user-defined routine. Or maybe they still want some special sigil-ish mark to stay in their own namespace. Dunno. I don't think we have to solve that for 6.0.0 in any case, especially if we require predeclaration of which unit names are wanted, in which case there might just be a units pragma that can pull in selections of the predefined units: use units :cgs, :nasa, μfortnight gibibyte; my newton $thrust = 42.lbf; But with a sigilish mark we could just pull in all the units from /usr/share/units.dat, I suppose. I don't know if I ever mentioned it on the mailing list, but a while back I did some work on a units module that uses units.dat (examples/rules/unitsdat-grammar.pm in the pugs repo). I think that a simple postfix syntax (e.g.) doesn't give you the ability to specify the kind of composite units that are common in scientific applications where units are heavily used (e.g. Gauss per square root Hertz). Those kind of units also rule out simple type-based units, e.g. having roles for length, mass, etc. - you can't do a role to the -7/3 power. I settled on a syntax that allows a mini-language similar to units(1): 9.8.:asm / s ** 2 $field_noise.:asgauss / sqrt(Hz) But someone may be able to come up with something better. My implementation does unit type-checking at runtime, but compile-time checking would be much nicer where possible. It would also be cool to be able to define roles that can represent themselves in several different units: role Photon does NumUnit { ??? } my Photon $p .=new( energy = 42.:aseV ); say energy is $p.:aszJ zeptojoules; say wavelength is $p.:asangstrom â«; say frequency is $p.:asTHz THz; -ryan Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
Re: What is the origin of the nickname, Texas quotes?
On Thu, Dec 06, 2007 at 09:36:36AM -0700, Thom Boyer wrote: From S02: The double angles may be written either with French quotes, «$foo @bar[]»||, or with Texas quotes, $foo @bar[],|| as the ASCII workaround. I'm curious about the naming of Texas quotes. My guess is that the name is inspired by the existence of a town called Paris, Texas. That city's name might remind you of France, but isn't the real thing. Similarly, Texas Quotes|| might remind you of «French Quotes», but they're not quite as elegant. Have I got that right? Good guess, but no. It comes from the fact that Texas always bragged about how they were the largest state in the union, and had the biggest everything, including ten-gallon hats. That was before we added Alaska. Now if they pull that stunt we offer to carve Alaska up into 4 states, in which case Texas would be the 5th largest. But Texans still like to think big, and we love 'em all to pieces for it. Especially Patrick these days... :) Larry
[perl #48270] [PCT] missing class in parseactions should give error
# New Ticket Created by Jerry Gay # Please include the string: [perl #48270] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48270 if the class set on the 'parseactions' attribute on a PCT::HLLCompiler is not found, there should be a descriptive error message, rather than the cryptic and incorrect get_string() not implemented in class 'ResizableStringArray' that's exists now. brrr. ~jerry
Re: Standards bearers (was Re: xml and perl 6)
On Mon, Dec 03, 2007 at 12:09:48PM +, Smylers wrote: : This isn't something which needs to influence language design -- in the : sense that it doesn't need to be sorted before the design can be final : and Perl 6 released. Well, and to the extent that it needs to influence language design, it already has. Much of S11 (http://perlcabal.org/syn/S11.html#Versioning) is about that. Larry
[perl #48272] [TODO] [C] Stop exporting Parrot_signbit()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48272] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48272 In config/gen/platform/*/math.c there is the todo item: Parrot_signbit is exported because PerlNum.set_number_native() uses it. XXX: This is probably not a good reason. So, stop exporting it and find a better way to have the same functionality.
[perl #48274] [TODO] [C] Stop ignoring the known errors in Parrot_dlopen()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48274] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48274 In config/gen/platform/darwin/dl.c:Parrot_dlopen() there is the todo item: /* XXX for now, ignore all the known errors */ We need to handle these errors, and so this needs to be implemented.
[perl #48276] [TODO] [C] Warn when failure occurs in Parrot_setenv()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48276] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48276 In config/gen/platform/win32/env.c:Parrot_setenv() there is the todo item: /* TODO: Shouldn't we tell anyone that we failed? */ Add an appropriate warning/error message about failure in the noted locations.
[perl #48278] [TODO] [C] Should we call GetLastError for failure messages in .../win32/exec.c?
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48278] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48278 In config/gen/platform/win32/exec.c there are two todo items which say: /* XXX njs Should call GetLastError for failure message? */ So, at this point in the code, should GetLastError be called for the failure message?
[perl #48280] [TODO] [C] Check for a sub with more up-to-date unit-type lookup
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48280] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48280 In compilers/imcc/cfg.c:find_basic_blocks() there is the todo item: /* XXX FIXME: Now the way to check for a sub is unit-type */ Convert the code in these locations to use the more up-to-date method of checking for a sub; namely a unit-type lookup/call/thingy.
[perl #48282] [TODO] [C] Check that invoke is ok near the set_addr instruction in bb_findadd_edge()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48282] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48282 In compilers/imcc/cfg.c:bb_findadd_edge() there is the todo item: /* XXX is probably only ok, if the invoke is near the * set_addr ins */ Check whether or not the code following this comment is ok, and in which situations. Also, what does ok mean in this context? And is there a good feeling for what near is with respect to the invoke operation? Anyway, this issue needs to be investigated and corrected if necessary.
[perl #48284] [TODO] [C] Life_range variable will never get used; so, it can be removed
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48284] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48284 In compilers/imcc/cfg.c:propagate_need() there is the todo item: l = r-life_info[bb-index]; /* XXX Will never get used */ So why is this code there? There is also a commented out line which reads: /* l-last_ins = bb-end; XXX:leo why? */ Why? I don't know either. I wish I did, otherwise I could just fix the code and not write an RT ticket... Anyway, it looks like this code can be removed, and this needs to be done :-)
[perl #48286] [TODO] [C] Warnings aren't emitted if a var isn't initialised and -w flag is on in propagate_need()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48286] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48286 In compilers/imcc/cfg.c:propagate_need() there is the todo item (with some context): * emit a warning if -w * looking at some perl6 examples, where this warning * is emitted, there seems always to be a code path * where the var is not initialized, so this might * even be correct :) * * XXX subroutines */ Unfortunately, I don't know what subroutines have to do with this, however the code which follows is commented out and it reports a warning if a variable (in perl6) is uninitialised when the -w flag is used. This looks like some repair is in order.
Re: Standards bearers (was Re: xml and perl 6)
On Sun, Dec 02, 2007 at 07:43:25PM -0800, Peter Scott wrote: : I do feel strongly that we need some sort of solution to this so that Perl : 6 is not merely an outstanding framework that leaves all domain-specific : extensions to the end user. Perl 6 as a language doesn't address this (except to keep the library namespaces precise and accurate), but that doesn't mean it won't get addressed or that we don't want it addressed. We're aiming for an ecology more like Linux, where we distribute the kernel, and others build distributions around it, and those distributions are designed to make it easier for various classes of end users. In any case, I'm certain the community will also make sure that something CPANishly downloadable is there, since no distribution can possibly guess right all the time. But a single editorial board is not scalable over the long haul. We'll eventually need multiple such boards that compete among various perceived and real ecological niches. We can start with one distribution as long as it is explicitly realized that anyone can fork it at any time, for any reason. Then let Darwin take over, and see what the service economy does with it. Now, it might well be that a Perl standards body could specify a mininum suggested set of modules for any distribution to enhance interoperability, but we haven't got to that point yet, I don't think. Someone with an organizational bent could get a running start to come up with such a editorial center, but setting standards out ahead of practice is rarely the optimal approach. And right now, we would, at best, be guessing from Perl 5 best practice. Maybe that's good enough to start with, if we can get any two people to agree on what the Perl 5 best practices are. :) Anyway, that's the reasoning behind supplying as little as possible with the P6 kernel. We don't want anyone mistaking it for a distribution in the first place, nor do we want us language lawyers to evolve into any kind of official distribution board. Central planning doesn't scale over the long term. We should restrict our federal activities to those that help all the states get along with each other, at least well enough to avoid a civil war. Of course, as the U.S. proved at the beginning, when you fear a strong federal government it's possible to invent too weak a federal government. There's a balance in there somewhere that we're still trying to figure out... Larry
Re: Parrot Partial application
metavery behind on everything while moving apartment and country, but here's a start on catching up.../meta chromatic wrote: If there isn't a better way to do this, how would I get the arity of a subroutine? I'm not sure you can from PIR, which I've argued is a problem. I think eventually we'll have to have some metadata available on invokable PMCs that lets us get the expected arity, as that will fix a nasty problem we have with NCI calls versus normal Subs. For subs, the sub PMC contains the offset in the bytecode. From knowing that, you can in look in the bytecode there for the get_params instruction of the sub. That points you to the signature PMC, which tells you how many args there are. What it implemented (when I get chance, which should be this weekend) as an arity method on the Sub PMC? Jonathan is working on an update to our bytecode that may fix this, so there may be a solution coming. On partial application generally, I don't think anything in what I'm doing will make that any easier. Another approach is to have a PMC that wraps up a sub PMC with the supplied arguments. It'd have an array for supplied positionals and a slurply for supplied named args. I think that'd give us what we want for implementing Perl 6's .assuming too, and perhaps better than a thunk... Jonathan
Concurrency
This last SOTO re-reminded me of what an inveterate fan I am of Perl 6. Wow. My question today is about concurrency. I can imagine how things like IPC Mailboxes (e.g. RFC 86) happen in modules. I can also imagine why Threads (e.g. RFC 1) should be in modules- given the obvious dependence on underlying OS. I do see both Cfork and Cwait in S29, but not in STD.pm, which brings me to the questions: * Where will Cfork, Cwait, and possible friends (e.g. Perl 5's Copen-with-|) live? * Is there any expectation of message-passing concurrency functions living inside STD.pm? * How about shared/software-transactional memory? Hopefully I'm not inadvertently starting any kind of flame-fest about anyone's favorite concurrency model here :-D Best, David. Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
Re: [perl #47792] [BUG]: languages/dotnet/Configure.pl causes configuration error
Will Coleda via RT wrote: r23011 added code to config/gen/languages.pm to configure dotnet when configuring parrot instead of (as before) manually, after parrot was built. This isn't ready to happen yet. Reverting 23011 in spirit, dotnet is on its own again. Certainly, the .Net implementation is fairly unmaintainted at the moment. I'm struggling for time for core Parrot stuff, let alone a language as well. Jonathan
Re: Concurrency
I'll try to reply as good as possible, but I'm sure others will do better. David Brunton wrote: This last SOTO re-reminded me of what an inveterate fan I am of Perl 6. Wow. My question today is about concurrency. I can imagine how things like IPC Mailboxes (e.g. RFC 86) happen in modules. I can also imagine why Threads (e.g. RFC 1) should be in modules- given the obvious dependence on underlying OS. I do see both Cfork and Cwait in S29, but not in STD.pm, which brings me to the questions: There's no need for any keyword to be in STD.pm. STD.pm just defines the grammar. Syntactically fork will be like just another sub, so it can safely be handled in the compiler's runtime. * Where will Cfork, Cwait, and possible friends (e.g. Perl 5's Copen-with-|) live? What do you mean by where? The namespace? Or the implementation? * Is there any expectation of message-passing concurrency functions living inside STD.pm? Again it won't be in STD.pm, because it doesn't care about it. But I think there will be both event based and thread based concurrency in Perl 6. Larry Wall usually points to this paper: http://www.seas.upenn.edu/~lipeng/homepage/unify.html Something like that, with a perlish interface, will be part of Perl 6's concurrency model. * How about shared/software-transactional memory? Yes. Maybe http://svn.pugscode.org/pugs/docs/Perl6/Spec/Concurrency.pod (still a draft) contains a bit more helpful information. Hopefully I'm not inadvertently starting any kind of flame-fest about anyone's favorite concurrency model here :-D Why flame, when we can have all of them at once? ;-) Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/ signature.asc Description: OpenPGP digital signature
Re: perl 6 grammar
Larry Wall wrote: On Tue, Dec 04, 2007 at 08:40:10AM -0800, Jonathan Lang wrote: : or (I think): : : method test ($value) { : setup(); : when $value { doit() } #[smart-match the calling object $_ against $value.] : } I know it used to be that way back near the Dawn of Time, but methods don't automatically topicalize anymore unless you explicitly name one of the parameters '$_': Huh. I guess I need to review current standards for method declaration; last I'd checked, the invocant did not need to be explicitly named. : (Question: assuming that the above is valid, would breaking out of the : when block be the same as returning from the method? Or would it : qualify as an abnormal termination of the method?) Well, according to S04: If the smart match succeeds, Cwhen's associated block is executed, and the innermost surrounding block that has C$_ as one of its formal parameters (either explicit or implicit) is automatically broken out of. ...which didn't answer my question, since returning from the method and having the method die both qualify as breaking out of the method in my mind. So it merely returns normally from the method, which is what you'd generally expect. This makes sense to me. Perhaps S04 could be updated to make this a bit more explicit? Also, can 'break' take a parameter? My gut instinct is no; if you want to break out of a method while specifying a return value, you should probably use 'return' instead of 'break'. Indeed, you may want to make this mandatory, much like the conjecture about forcing people to use 'next' or 'last' instead of 'break' when in a loop. -- Jonathan Dataweaver Lang
Re: perl 6 grammar
On Tue, Dec 04, 2007 at 08:40:10AM -0800, Jonathan Lang wrote: : or (I think): : : method test ($value) { : setup(); : when $value { doit() } #[smart-match the calling object $_ against $value.] : } I know it used to be that way back near the Dawn of Time, but methods don't automatically topicalize anymore unless you explicitly name one of the parameters '$_': method test ($_: $value) { setup(); when $value { doit() } #[smart-match the calling object $_ against $value.] } : (Question: assuming that the above is valid, would breaking out of the : when block be the same as returning from the method? Or would it : qualify as an abnormal termination of the method?) Well, according to S04: If the smart match succeeds, Cwhen's associated block is executed, and the innermost surrounding block that has C$_ as one of its formal parameters (either explicit or implicit) is automatically broken out of. So it merely returns normally from the method, which is what you'd generally expect. If you have more questions about switches, S04 probably already discusses it. Larry
Re: Pair notation for number radix
In article [EMAIL PROTECTED], Smylers [EMAIL PROTECTED] wrote: brian d foy writes: In article [EMAIL PROTECTED], Larry Wall [EMAIL PROTECTED] wrote: On Tue, Dec 04, 2007 at 08:28:48AM -0800, brian d foy wrote: : In article [EMAIL PROTECTED], Larry Wall : [EMAIL PROTECTED] wrote: : : : Later in the Literals section of S02, there's a chart of the : : corresponding forms for fat arrow, pair, and paren notation. It has : : : :a = 'foo' :afoo :a(foo) You're confusing various levels here when you say same thing. They're the same in some ways and different in others. The colon can _also_ be used for forming adverbs (similarly to how the slash can be used for both regexes and division, in different places), but that doesn't effect the equivalence of the above. The section where that table is talks about adverbs. This isn't just the same characters being used for different things. Some pairs also act like adverbs. See my earlier message on file test operators.
[perl #48294] [RFE] oo -- improve Method '...' not found' error
# New Ticket Created by Patrick R. Michaud # Please include the string: [perl #48294] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48294 Currently when invoking a non-existent method on an object, the exception that is thrown reads: Method 'get_scalar' not found The error message would be much more helpful if it could also indicate the class of the invocant: Method 'get_scalar' not found for 'ResizablePMCArray' invocant Pm
Re: Standards bearers (was Re: xml and perl 6)
Larry Wall wrote: Now, it might well be that a Perl standards body could specify a mininum suggested set of modules for any distribution to enhance interoperability, but we haven't got to that point yet, I don't think. This would be great though!! Even if it is afterward, it is still a lot better than nothing! perl6 offers a lot of new nice features in the grammar itself, but the lack of standards over than those of programming 'best practices' could be a problem. When I started to learn perl5, I have read (and am still reading because I am far to be a good programmer^^;!), a lot of books, online tutorials but none of them were doing it the same way! And I am still trying to get it! (What I liked though it is that I have learnt of lot more than other languages!) I guess perl6 is a solution to this problem thanks to the grammar itself. This is great, I think. But the above concerns regarding standards modules are a real issue too it should not be underestimated. Anyway, that's the reasoning behind supplying as little as possible with the P6 kernel. We don't want anyone mistaking it for a distribution in the first place, nor do we want us language lawyers to evolve into any kind of official distribution board. Central planning doesn't scale over the long term. We should restrict our federal activities to those that help all the states get along with each other, at least well enough to avoid a civil war. Of course, as the U.S. proved at the beginning, when you fear a strong federal government it's possible to invent too weak a federal government. There's a balance in there somewhere that we're still trying to figure out... Larry -- シリル・デュモン(Cyrille Dumont) [EMAIL PROTECTED] our work is the portrait of ourselves tel: 03-5690-0230 fax: 03-5690-7366 http://www.comquest.co.jp
Re: perl 6 grammar
Jonathan Lang skribis 2007-12-06 16:36 (-0800): I know it used to be that way back near the Dawn of Time, but methods don't automatically topicalize anymore unless you explicitly name one of the parameters '$_': Huh. I guess I need to review current standards for method declaration; last I'd checked, the invocant did not need to be explicitly named. It does if you want to access it by a name other than a lone sigil. -- Met vriendelijke groet, Kind regards, Korajn salutojn, Juerd Waalboer: Perl hacker [EMAIL PROTECTED] http://juerd.nl/sig Convolution: ICT solutions and consultancy [EMAIL PROTECTED]
[perl #48296] Implement get_namespace vtable from pdd17
# New Ticket Created by Will Coleda # Please include the string: [perl #48296] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48296 From PDD17: =item pmc_namespace [deprecated: See RT# 48144] PMC* pmc_namespace(INTERP, PMC* self) Return the namespace object for this PMC. [NOTE: replaced by Cget_namespace.] =item get_namespace PMC* get_namespace(INTERP, PMC* self) Return the namespace object for this PMC. SNIP The get_namespace vtable entry doesn't exist yet in vtable.tbl.
[perl #48070] [TODO] Replace Parrot::IO::Capture::Mini with IO::CaptureOutput
Am working on this with new Parrot contributor Alan Rocker. We've transformed 17 tests so far; 65 to go.
Re: Concurrency
Inadvertently replied to this off-list... Moritz wrote: There's no need for any keyword to be in STD.pm. STD.pm just defines the grammar. Syntactically fork will be like just another sub, so it can safely be handled in the compiler's runtime. * Where will Cfork, Cwait, and possible friends (e.g. Perl 5's Copen-with-|) live? What do you mean by where? The namespace? Or the implementation? I think I'm starting to get the distinction about what goes into STD.pm. Coming most recently from a project in Erlang, concurrency still feels like a kind of flow control to me right now :-\ It looks like they live in the CProcesses namespace from S29. The term built in in S29 confuses me a little, I think, but rereading the section about namespaces helped. Maybe http://svn.pugscode.org/pugs/docs/Perl6/Spec/Concurrency.pod (still a draft) contains a bit more helpful information. Yeah, this was really fun to read. It was also the only place I saw Cyield, Cproduce, Ccoro, etc., so I began to suspect the warning at the top that it's just random notes might be accurate ;) Hopefully I'm not inadvertently starting any kind of flame-fest about anyone's favorite concurrency model here :-D Why flame, when we can have all of them at once? ;-) Hear, hear! Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: Parrot Partial application
On Thursday 06 December 2007 15:49:45 Jonathan Worthington wrote: chromatic wrote: If there isn't a better way to do this, how would I get the arity of a subroutine? I'm not sure you can from PIR, which I've argued is a problem. I think eventually we'll have to have some metadata available on invokable PMCs that lets us get the expected arity, as that will fix a nasty problem we have with NCI calls versus normal Subs. For subs, the sub PMC contains the offset in the bytecode. From knowing that, you can in look in the bytecode there for the get_params instruction of the sub. That points you to the signature PMC, which tells you how many args there are. What it implemented (when I get chance, which should be this weekend) as an arity method on the Sub PMC? That would be much nicer, as then parameter passing wouldn't have to call invoke on a Sub or descendent to get the bytecode offset (which doesn't make sense with an NCI call) to determine if it has to pass parameters (which occurs *after* the invoke, which is sort of a problem if you want to pass parameters to the NCI call you've just invoked and which has already returned with an error that you haven't actually passed any parameters to it). Another approach is to have a PMC that wraps up a sub PMC with the supplied arguments. It'd have an array for supplied positionals and a slurply for supplied named args. I think that'd give us what we want for implementing Perl 6's .assuming too, and perhaps better than a thunk... Heh, wouldn't you call that the Thunk PMC? How about Future? -- c
Re: What is the origin of the nickname, Texas quotes?
Larry Wall wrote: On Thu, Dec 06, 2007 at 09:36:36AM -0700, Thom Boyer wrote: From S02: The double angles may be written either with French quotes, «$foo @bar[]»||, or with Texas quotes, $foo @bar[],|| as the ASCII workaround. I'm curious about the naming of Texas quotes. My guess is that the name is inspired by the existence of a town called Paris, Texas. That city's name might remind you of France, but isn't the real thing. Similarly, Texas Quotes|| might remind you of «French Quotes», but they're not quite as elegant. Have I got that right? Good guess, but no. It comes from the fact that Texas always bragged about how they were the largest state in the union, and had the biggest everything, including ten-gallon hats. That was before we added Alaska. Now if they pull that stunt we offer to carve Alaska up into 4 states, in which case Texas would be the 5th largest. But Texans still like to think big, and we love 'em all to pieces for it. Especially Patrick these days... :) Larry So, it's because this is so much bigger than «this», this, or 'this'? By the way, as a native Texan, I find offensive your claim that Texas*4 Alaska. The truth is hurtful enough: Texas*2.1787 = Alaska I had to carry it out to 4 decimal places so I wouldn't have to round the last digit UP. :-) =thom