new P0, .PerlArray
set P0[1], "cat"
set P0[2], 123
set P0[3], 456.789
and then grab a value from the array:
set P1, P2[1]
how can I test to determine the datatype of the object in P1?
Also, are there any pre-built Windows binaries of Parrot available?
Thanks!
> how can I test to determine the datatype of the object in P1?
You'd be wanting "typeof". The following prints out "PerlString", for
example:
new P0, .PerlArray
set P0[1], "cat"
set P0[2], 123
set P0[3], 456.789
set P1, P0[1]
typeof S0, P1
print S0
print "\n"
end
Leon
ps i fixed your code
--
Leon Brocard.............................http://www.astray.com/
scribot.................................http://www.scribot.com/
... Useless invention no. 404: Inflatable anchor
> How do you determine the datatype of a PMC? For example, if I create the
> following array:
From docs/core_ops.pod (built from core.ops):
=item B<typeof>(out STR, in PMC)
=item B<typeof>(out INT, in PMC)
Return the type of PMC in $2.
The String result is the class name, the int result is the enum value of
the class, which might vary, when new classes are added.
> Thanks!
leo
> From docs/core_ops.pod (built from core.ops):
Thanks. I better upgrade my version, I'm not seeing it in 0.0.9.
-- David Cuny
> You'd be wanting "typeof".
Thanks.
> ps i fixed your code
Thanks again. :-)
Anyone know about a Parrot Windows binary?
-- David Cuny
> Thanks. I better upgrade my version, I'm not seeing it in 0.0.9.
It's been a while since 0.0.9 (errr, 20th Dec). A lot has changed
since then. Maybe it's time for a 0.1.0 release. What are we waiting
for? And why do we have so many version numbers? It'd be nice to have
objects, otherwise we're restricted to toy languages.
Leon
--
Leon Brocard.............................http://www.astray.com/
scribot.................................http://www.scribot.com/
... Komputors nefer maik erers
Dan said: "either exceptions or objects". Once we have one, we'll go to
0.1.0, and when the second will be implemented (order does not matter),
we'll go to 0.2.0. Or am I wrong?
Btw, a proper i/o layer would be nice to have, too...
> And why do we have so many version numbers? It'd be nice to have
> objects, otherwise we're restricted to toy languages.
And even toy languages may benefit from objects (yes, I really need
objects in order to implement -98 version of Befunge, especially since
I want to include concurrent-funge support). Well, I could use my own
hand-crafted objects as a list of whatever, but fun would be much
greater with objects.
Jerome
--
jqu...@mongueurs.net
> I want to include concurrent-funge support.
I'm not even going to ask :-)
Simon
Objects or exceptions. (Or a full I/O layer, or events)
> And why do we have so many version numbers?
Major, minor, point. Reasonably standard, as these things go.
>It'd be nice to have
>objects, otherwise we're restricted to toy languages.
While I'll call C many things (not all of them repeatable) I'm not
sure "toy" is one of them. Nor Forth, Fortran, APL, COBOL, Lisp, or
Basic... :)
Objects are coming, though I've been too pressed for time recently.
String rework first, then objects.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk
> While I'll call C many things (not all of them repeatable) I'm not
> sure "toy" is one of them. Nor Forth, Fortran, APL, COBOL, Lisp, or
> Basic... :)
Granted, but those aren't the languages we're interested in. Parrot is
for dynamic languages, and that gives away the fact that objects would
help in their implementation.
> Objects are coming, though I've been too pressed for time recently.
> String rework first, then objects.
Excellent.
Leon
--
Leon Brocard.............................http://www.astray.com/
scribot.................................http://www.scribot.com/
... What's brown and sticky? A stick!
Yeah, I'm waiting for objects before I have a crack at a scheme
interpreter in parrot. Yeah, I *know* there's a scheme compiler in
parrot but I want to do it a different way for giggles.
--
Piers
We're waiting for objects or exceptions for 0.1.0, but that doesn't
mean we can't have a 0.0.10. But while I agree that a lot has changed
since 0.0.9, not much is different from a Parrot user's perspective
(as opposed to a Parrot implementer's perspective).
At least, I didn't think so. Let's see what a diff turns up...
- IMCC integration
- eval
- some more benchmarking
- cgp core
- optimized math ops
- intersegment branches
- more complete use of PObjs
- beefed up packfiles
- sub/continuation/coroutine fixes
- better NCI (native calling interface)
- many imcc improvements
- jako improvements
So the user-visible stuff would appear to be: imcc integration
(speedup!), eval, sub stuff, and NCI. Okay, you're right -- that's
easily enough to warrant a release.
I'll announce a code freeze soon.