Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A couple easy questions...

6 views
Skip to first unread message

David

unread,
Feb 25, 2003, 4:46:32 AM2/25/03
to perl6-i...@perl.org
How do you determine the datatype of a PMC? For example, if I create the
following array:

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!

Leon Brocard

unread,
Feb 25, 2003, 6:14:58 AM2/25/03
to perl6-i...@perl.org
David sent the following bits through the ether:

> 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

Leopold Toetsch

unread,
Feb 25, 2003, 5:37:35 AM2/25/03
to David, perl6-i...@perl.org
David wrote:

> 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


David

unread,
Feb 25, 2003, 11:23:17 AM2/25/03
to perl6-i...@perl.org
Leopold Toetsch wrote:

> 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

David

unread,
Feb 25, 2003, 11:24:34 AM2/25/03
to perl6-i...@perl.org
Leon Brocard wrote:

> You'd be wanting "typeof".

Thanks.

> ps i fixed your code

Thanks again. :-)

Anyone know about a Parrot Windows binary?

-- David Cuny

Leon Brocard

unread,
Feb 25, 2003, 11:52:45 AM2/25/03
to perl6-i...@perl.org
David sent the following bits through the ether:

> 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

Jerome Quelin

unread,
Feb 25, 2003, 12:00:44 PM2/25/03
to Leon Brocard, perl6-i...@perl.org
Leon Brocard wrote:
> 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?

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

Simon Glover

unread,
Feb 25, 2003, 12:07:23 PM2/25/03
to Jerome Quelin, Leon Brocard, perl6-i...@perl.org

On Tue, 25 Feb 2003, Jerome Quelin wrote:

> I want to include concurrent-funge support.

I'm not even going to ask :-)

Simon

Dan Sugalski

unread,
Feb 25, 2003, 12:19:56 PM2/25/03
to Leon Brocard, perl6-i...@perl.org
At 4:52 PM +0000 2/25/03, Leon Brocard wrote:
>David sent the following bits through the ether:
>
>> 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?

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

Leon Brocard

unread,
Feb 25, 2003, 12:25:45 PM2/25/03
to perl6-i...@perl.org
Dan Sugalski sent the following bits through the ether:

> 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!

Piers Cawley

unread,
Feb 25, 2003, 5:40:17 PM2/25/03
to Jerome Quelin, Leon Brocard, perl6-i...@perl.org
Jerome Quelin <jqu...@mongueurs.net> writes:
> 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.

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

Steve Fink

unread,
Feb 25, 2003, 1:25:54 PM2/25/03
to Leon Brocard, perl6-i...@perl.org
On Feb-25, Leon Brocard wrote:
> David sent the following bits through the ether:
>
> > 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.

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.

0 new messages