Re: Q: Keys can be strings/ints only?

2006-01-20 Thread Klaas-Jan Stol
Matt Fowles wrote: Klaas-Jan~ On 1/20/06, Klaas-Jan Stol [EMAIL PROTECTED] wrote: Hi, I tried to index aggregates using several types of keys (that is, several types of values), and it seems only string and integer values can be used as keys. A quick look at the source in compilers/imcc

Parrot link failure imc_yyin_set/get

2006-01-16 Thread Klaas-Jan Stol
Hi, since yesterday, Parrot breaks during compiling, with the following output: c++ -o miniparrot -L/usr/local/lib -Wl,-E compilers/imcc/main.o \ -Wl,-rpath=/home/klaas/parrot/blib/lib -L/home/klaas/parrot/blib/lib -lparrot -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp

Re: Parrot link failure imc_yyin_set/get

2006-01-16 Thread Klaas-Jan Stol
Klaas-Jan Stol wrote: Hi, since yesterday, Parrot breaks during compiling, with the following output: c++ -o miniparrot -L/usr/local/lib -Wl,-E compilers/imcc/main.o \ -Wl,-rpath=/home/klaas/parrot/blib/lib -L/home/klaas/parrot/blib/lib -lparrot -lnsl -ldl -lm -lcrypt -lutil -lpthread

Qs WRT params: flags using get_params and .param notation

2006-01-15 Thread Klaas-Jan Stol
hi, I have 2 questions wrt PIR parameter notation and usage. I'm not quite sure how I should specifiy the flags when using get_params, instead of the .param notation. according to PDD03, flag 3 is for specifiying slurpy parameters. Should I type: get_params (3), $P0 to say $P0 is a

Re: declaration of 'clone'

2006-01-13 Thread Klaas-Jan Stol
Joshua Hoblitt wrote: On Thu, Jan 12, 2006 at 04:53:26PM +0100, Leopold Toetsch wrote: Klaas-Jan Stol wrote: Hi, I'm trying to implement some functions into the Lua PMCs, but I'm having trouble to compile them. I want to add a clone method to the LuaNil PMC (which should extend

[PATCH] Add new_from_string() to LuaNumber (was: Re: .const HLL improvement)

2006-01-13 Thread Klaas-Jan Stol
.const .LuaNumber n = 12.34 I presume LuaNumber doesn't have new_from_string (Float hasn't either). Attached is a patch that implements new_from_string() for LuaNumber. In my opinion it's handy to say: .const .LuaNumber n = 12.34 kind regards, klaas-jan ---

[PATCH] changes for LuaNil

2006-01-13 Thread Klaas-Jan Stol
, LuaBoolean)); -VTABLE_set_integer_native(INTERP, dest, 1); -return dest; -} - -} - -/* - -=back - -=head1 AUTHORS - -Original code by Klaas-Jan Stol. - -=cut - -*/ - +/* +Copyright: 2005 The Perl Foundation. All Rights Reserved. +$Id: luanil.pmc 10933 2006-01-06 01:43:24Z particle

[PATCH] Changes for LuaTable

2006-01-13 Thread Klaas-Jan Stol
this patch changes the behaviour of the LuaTable PMC. changes have to do with the reference semantics that PMCs have, and LuaTables should not have. Setting and getting a value now will set (and get) a copy of the value. Clone() returns a reference to itself, as clone() should be used for

declaration of 'clone'

2006-01-12 Thread Klaas-Jan Stol
Hi, I'm trying to implement some functions into the Lua PMCs, but I'm having trouble to compile them. I want to add a clone method to the LuaNil PMC (which should extend Null.pmc, not None.pmc, as it does currently; changed that already) However, I get the following error: luanil.c:343:

Lua2PIR translator

2006-01-10 Thread Klaas-Jan Stol
of code the Lua compiler should more or less be generating. Kind regards, Klaas-Jan Stol

Paper on Parrot [2]

2006-01-06 Thread Klaas-Jan Stol
work. I hope it's worthwhile to read. I'll be finishing it this weekend. If you read it and think to see incorrect information, please inform me. (most information is from mailing lists, docs and Perl6 essentials 2nd ed., so some info could be out-of-date) Kind regards, Klaas-Jan Stol

Event system implementation

2006-01-04 Thread Klaas-Jan Stol
Hi, As you know, I'm currently busy writing a paper on the architecture of Parrot, and during my attempt to describe the exception sub-system, something came to mind. I'm not sure if the event system is fully operational (I thought it was already implemented), but I do know the plan was to

Event sub-system implementation

2006-01-04 Thread Klaas-Jan Stol
Hi, As you know, I'm currently busy writing a paper on the architecture of Parrot, and during my attempt to describe the exception sub-system, something came to mind. I'm not sure if the event system is fully operational (I thought it was already implemented), but I do know the plan was to

Threading PDD?

2005-12-23 Thread Klaas-Jan Stol
Hi, I'm wondering, is there a PDD about Thread implementation in Parrot? I searched the list archive, and found a lot of info. Dan even mentioned writing a PDD on the subject, but I havent' been able to find it. Thanks, klaas-jan

Strange behaviour of PIR register $P0 vs others

2005-12-18 Thread Klaas-Jan Stol
Hi, I get some strange behaviour in the attached code snippet. The problem is with the lines marked with a '*'. If the global 'r' is stored into $P0, and in the second marked line it is called, the output of the print statements furhter below is: Lua_Proto_2_0 2 instead of the expected 1 2

Re: Global storage access

2005-12-06 Thread Klaas-Jan Stol
Leopold Toetsch wrote: On Dec 5, 2005, at 21:58, Klaas-Jan Stol wrote: hi, if I understood correctly, the global storage is implemented as a hash table. If so, will it be possible to load this global hash table in a P register? It is possible right now. See the introspection interface

[PATCH] .lex syntax in PIR docs (imcc)

2005-12-05 Thread Klaas-Jan Stol
hi, attached is a patch that adds the new .lex syntax. The description is copy/paste from PDD20. regards, klaas-jan --- imcc/docs/syntax.pod2005-12-05 19:49:30.0 +0100 +++ imcc/docs/syntax2.pod 2005-12-05 20:15:53.0 +0100 @@ -207,6 +207,25 @@ them with commas:

Global storage access

2005-12-05 Thread Klaas-Jan Stol
hi, if I understood correctly, the global storage is implemented as a hash table. If so, will it be possible to load this global hash table in a P register? So, for example, are there any plans to support this: $P0 = get_globals # put a reference to the global storage into register $P0

Re: [perl #37815] Tcl: implement [flush]

2005-12-02 Thread Klaas-Jan Stol
Hi, attached a patch with a start on the implementation of flush.pir Note that ParrotIO.pmc doesn't seem to have a method to find out what mode it is opened in, so that check cannot be done. regards, kj Will Coleda (via RT) wrote: # New Ticket Created by Will Coleda # Please include the

Components of Parrot

2005-11-30 Thread Klaas-Jan Stol
Hello, Some time ago, I announced I would be writing a paper on the architecture of Parrot. The paper will be about 10 pages (I think, at this point), so there will be quite a high level of abstraction in order to be able to fit all important info. (so no class diagrams, if one could even

Re: Paper Software Architecture 1: started writing

2005-10-19 Thread Klaas-Jan Stol
Hi, first of all, thanks for reading! :-) Most things I wrote so far, I got from several sources, like the Parrot FAQ. Joshua Hoblitt wrote: This is because Parrot is implemented in C, while developing a large program such as this could well have been done in C++. This is for three

Paper Software Architecture 1: started writing

2005-10-18 Thread Klaas-Jan Stol
Hi all, Some weeks ago, I announced my plans for writing a paper on the archtecture of Parrot. In the mean time, I made a start, and more or less defined the structure of the article. It's an initial draft, so nothing definite yet. Also, as it's a really early draft, not much too read.

Paper Software Architecture 1: started writing

2005-10-18 Thread Klaas-Jan Stol
Hi all, Some weeks ago, I announced my plans for writing a paper on the archtecture of Parrot. In the mean time, I made a start, and more or less defined the structure of the article. It's an initial draft, so nothing definite yet. Also, as it's a really early draft, not much too read.

Software Architecture of Parrot

2005-10-04 Thread Klaas-Jan Stol
Hi, Currently I'm doing a course 'Software Architecture' for my Master Computer Science. For this course, I have to write a paper on some subject that has to do with software architecture. Therefore, I proposed to write a paper on the architecture of Parrot, and today I got approval of this

Re: Variable registers

2005-10-03 Thread Klaas-Jan Stol
Leopold Toetsch wrote: On Oct 1, 2005, at 18:11, Klaas-Jan Stol wrote: ah I thought so. just making sure. Then another question WRT this; will there be a register allocator? In other words, an attempt to minimize the number of needed registers? (in my simple code generator implementations

Re: Variable registers

2005-10-01 Thread Klaas-Jan Stol
Leopold Toetsch wrote: On Oct 1, 2005, at 8:46, [EMAIL PROTECTED] wrote: hi, I read that with the new calling conventions, there are a variable number of registers. So, if I understand correctly, if a function call takes 2 parameters, then there are only 2, and if there are 30

Re: [PATCH] PIR Syntax: (end)namespace id

2005-08-25 Thread Klaas-Jan Stol
woops, I used tabs to indent, that gives ugly layout. Here's a NEW version with spaces. regards, klaas-jan Klaas-Jan Stol wrote: hi, In the current docs of PIR, the .namespace id .endnamespace id directives are not mentioned. This patch adds a short description of both to syntax.pod

Re: [PATCH] PIR Syntax: (end)namespace id

2005-08-25 Thread Klaas-Jan Stol
thanks, applied. in the future, please provide diffs relative to the parrot base directory, it makes it easier to find the files to patch. that is, I should do (for instance) $ diff -u imcc/docs/file.pod imcc/docs/newfile.pod patchfile ? also, this patch brings up an interesting

Re: NCI: passing PMCs and using them

2005-08-23 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol wrote: hi, I'm currently trying to check out the NCI. As my Lua compiler only uses PMCs (and not I/N/S registers), calling C functions will only be done with PMCs. I couldn't find info on this matter: suppose I have this string PMC, how can I

NCI: passing PMCs and using them

2005-08-22 Thread Klaas-Jan Stol
hi, I'm currently trying to check out the NCI. As my Lua compiler only uses PMCs (and not I/N/S registers), calling C functions will only be done with PMCs. I couldn't find info on this matter: suppose I have this string PMC, how can I access the actual string in it? so, when calling:

Re: How to add a new opcode?

2005-08-09 Thread Klaas-Jan Stol
Gerd Pokorra wrote: For tests I want to add a new opcode to Parrot. I created a file ops/my.ops and do the configuration and make again, but I don't find my opcode in the file lib/Parrot/OpLib/core.pm. How to add a new opcode? Can you give me an example. Gerd Pokorra

Calling SUPER methods

2005-08-07 Thread Klaas-Jan Stol
Hi, I was wondering if it is possible to call specific methods from a parent PMC from another method in your (child) PMC, for some other object than SELF. My situation may be a bit complex, so I'll explain: I have a LuaTable PMC, extending the Hash PMC. I override the add method, because

Re: ANSI escape characters

2005-08-03 Thread Klaas-Jan Stol
Nick Glencross wrote: Nick Glencross wrote: Klaas-Jan, 'Escape' is 27 decimal, or 033 octal. http://www.nntp.perl.org/group/perl.perl6.internals/9381 http://www.nntp.perl.org/group/perl.perl6.internals/9814 Nick I may have been overly concise! What I meant was that \0xx notation is

ANSI escape characters

2005-08-02 Thread Klaas-Jan Stol
hi, I'm not very familiar with this, so forgive me for my ignorance with this. I don't know whether this issue is related to Parrot, or that it's something else I don't understand. I read a bit about ANSI escape codes, and I'm wondering if this should work in Parrot. That is, when writing

Lua project

2005-08-02 Thread Klaas-Jan Stol
Hi, as my little project is progressing step by step, I figured it's time show something to the world. The current version of the Lua compiler targeting Parrot is 0.2.1. If people want to have a look, you can get it at http://members.home.nl/joeijoei/parrot. Please read the README file in the

Re: Accessing Hash with strings/keys

2005-07-31 Thread Klaas-Jan Stol
Leopold Toetsch wrote: On Jul 29, 2005, at 10:38, Klaas-Jan Stol wrote: Anybody an idea what I'm doing wrong here? By far the simplest thing is either look at the opcode in ops/core_ops.c or use a debugger and set a breakpoint at the appropriate opcode, e.g. Parrot_set_p_p_kc

Accessing Hash with strings/keys

2005-07-29 Thread Klaas-Jan Stol
Hi, I'm trying to extend the standard Hash PMC, if it returns None, because there was no value at the specified key, then I want to override this behaviour by returning something else. In order to do that, I should know what methods are called. That's where I'm running into trouble. I can

Compiling dynamic PMCs

2005-07-28 Thread Klaas-Jan Stol
hi, as my attempt to write a lua compiler is continuing (slowly but surely), and quite some stuff is working already (although rather s l o w), I decided it was time to write the PMCs representing the various Lua datatypes. I understood from my previous postings (and replies on those) that

Re: pmc syntax

2005-07-28 Thread Klaas-Jan Stol
hi, Will Coleda wrote: On Jul 27, 2005, at 4:00 PM, Klaas-Jan Stol wrote: hi, Is there any documentation about the complete syntax for pmc files when writing PMCs (this time in C)? I think that's technically the only way to write PMCs. (things written in PIR are Objects

[PATCH] Readme file dynclasses

2005-07-28 Thread Klaas-Jan Stol
hi, attached a patch that changes the README file in dynclasses directory. The original doesn't mention you have to do perl Configure.pl after adding a new PMC file. klaas-jan --- README 2005-07-28 13:10:51.0 +0200 +++ README.new 2005-07-28 13:10:32.0 +0200 @@ -58,8

Re: Compiling dynamic PMCs

2005-07-28 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol wrote: 1. write the PMC 2. edit parrot/config/gen/makefiles/dynclasses.in 3. make In my case this didn't work. The .in files are processed by Configure.pl to create the real files. perl Configure.pl ... should do it, possibly after 'make realclean

Re: pmc syntax

2005-07-28 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol wrote: Suppose I would want to have my own custom representation of None. What should I do to have my child class be a singleton too? (just extending singleton as well?) None isn't a singleton. But have a look at the Null PMC or better env.pmc

Re: pmc syntax

2005-07-28 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol wrote: mmm, I looked at classes/none.pmc, this is a copy/paste: === #include assert.h static PMC * Py_None; pmclass None singleton { Ah, yep - None is a singleton too - sorry for my confusion. So it should be rather easy to subclass None

pmc syntax

2005-07-27 Thread Klaas-Jan Stol
hi, Is there any documentation about the complete syntax for pmc files when writing PMCs (this time in C)? I found genclass.pl and pmc2c.pl, but I couldn't find anything about all keywords that can be used. In particular, I wrote down some scenarios. Maybe there are some more cases than

Re: Calling Super Methods

2005-07-23 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Matt Diephouse wrote: There's currently no way to call a superclass' method. I've just run into this and leo suggested I sent a note to the list. Here's what I want to do: I have a ParrotClass (a class defined in PIR) that is derived from the String class. I want to

Key question

2005-07-05 Thread Klaas-Jan Stol
Hi, currently I'm experimenting a bit with Keys. It seems that a Key *can* be set to a number (floating point), but that this results in a segfault, when using that key. So: .sub main P0 = new .Key P1 = new .Hash P2 = new .Integer # set the key to a number P0 = 1.23 P2 =

new calling conventions

2005-06-28 Thread Klaas-Jan Stol
hi, I've been playing a bit with the new set_*/get_* ops that implement the new calling conventions, according to pdd03. If the number of passed arguments is larger than the number of parameters the function takes, an exception is thrown (this is the overflow case described in PDD03)

Indexing hashtables

2005-06-22 Thread Klaas-Jan Stol
hi, I have some trouble indexing hashtables. I have the following code snippet: .sub main .local pmc x x = new .Hash .local pmc y y = new .Hash x[y] = y $P10 = new .Integer $P10 = 1 x[y;a] = $P10 # (1) this does not

Invoking an object

2005-06-17 Thread Klaas-Jan Stol
hi, I have a question concerning invoking objects represented at runtime by ParrotObjects. First an introduction (quite long, but then you get the picture of what I'd like to do). Suppose I have this class Foo. Foo has a number of operations, like adding, etc. In fact, the operations

Re: Invoking an object

2005-06-17 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol wrote: I don't quite see the problem that is suggested in parrotobject.pmc: void* invoke(void* next) { SELF.init(); return next; } This is more a relict from the Pie-thon hack. But removing it doesn't really help currently

Re: PMCs and Objects question

2005-06-12 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol wrote: hi, My question concerns functionality of PMCs and Objects. while reading the docs about the functionality of classes and objects, I read that the vtable entries of a class can be overridden to give the class special behaviour. I'd like

Unexpected behaviour calling method of attribute

2005-06-12 Thread Klaas-Jan Stol
Hi, I have a class A, that has an object of class B as an attribute. I've overriden the add() method of class A, and I want to let class B handle the actual work. The idea is to make this class B replacable by the user, so he can override the behaviour of a certain object of A, without

PMCs and Objects question

2005-06-10 Thread Klaas-Jan Stol
hi, My question concerns functionality of PMCs and Objects. while reading the docs about the functionality of classes and objects, I read that the vtable entries of a class can be overridden to give the class special behaviour. I'd like to know if I'm correct (I just realized this), if I say

Re: New generational GC Scheme

2005-06-08 Thread Klaas-Jan Stol
tuned dynamically, as in at run-time? alexandre mentioned this may be possible on #parrot, but there may be trouble with decreasing the generation count. i don't know if run-time tuning of the generation count is necessary, but if so, i imagine that decreasing the count at run-time could be

Re: [perl #34912] Badly balanced at classes/pmc2c2.pl

2005-04-11 Thread Klaas-Jan Stol
[EMAIL PROTECTED] (via RT) wrote: # New Ticket Created by [EMAIL PROTECTED] # Please include the string: [perl #34912] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34912 --- osname= linux osvers= 2.4.0 arch=

Re: Dynamic libs don't seem to work

2004-12-10 Thread Klaas-Jan Stol
=4, ptr_alignment=1 byteorder=1234, nv=double, numvalsize=8, doublesize=8 = thanks, kj Klaas-Jan Stol wrote: Hello, I just got a fresh cvs checkout, compiled it, compiled pge and tried to make tcl. This is what I get: (cd ../../ ./parrot --output=languages

Re: Dynamic libs don't seem to work

2004-12-10 Thread Klaas-Jan Stol
Sam Ruby wrote: Klaas-Jan Stol wrote: Hello, I just got a fresh cvs checkout, compiled it, compiled pge and tried to make tcl. This is what I get: (cd ../../ ./parrot --output=languages/tcl/lib/tcllib.pbc languages/tcl/lib/tcllib.imc) Couldn't load 'tcl_group': tcl_group: cannot open shared

Dynamic libs don't seem to work

2004-12-09 Thread Klaas-Jan Stol
Hello, I just got a fresh cvs checkout, compiled it, compiled pge and tried to make tcl. This is what I get: (cd ../../ ./parrot --output=languages/tcl/lib/tcllib.pbc languages/tcl/lib/tcllib.imc) Couldn't load 'tcl_group': tcl_group: cannot open shared object file: No such file or directory

pmc2c2.pl fails on mac 10.2

2004-11-21 Thread Klaas-Jan Stol
I just got my OS 10.2 installation working today, and wanted to get a parrot on it, but when compiling, I get this error: Badly balanced at classes/pmc2c2.pl line 316. make: *** [classes/default.dump] Error 255 The source is a fresh checkout. I also tried the latest.tar.gz, but the problem

Re: Fwd: Re: Parrot BASIC

2004-11-16 Thread Klaas-Jan Stol
Joshua Gatcomb wrote: All, Please read Clinton's reply - especially the part about being blocked from the list for about a year. Cheers, Joshua Gatcomb a.k.a. Limbic~Region --- Clinton A. Pierce [EMAIL PROTECTED] wrote: Date: Tue, 16 Nov 2004 11:34:05 -0500 To: Joshua Gatcomb [EMAIL PROTECTED]

PIR: Arguments are passed without passing them

2004-11-08 Thread Klaas-Jan Stol
Hello, (* I'm trying a lot of things out, to figure out each part of the Lua language. This is Yet Another Question , this time concerning missing arguments *) I'm currently figuring out how missing arguments should be handled. Suppose there is a function foo, that takes 4 parameters. In Lua

Re: Closures and subs

2004-11-04 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol [EMAIL PROTECTED] wrote: Hello, I've been playing with closures and subs but I have a little bit of trouble with those. newsub $P0, .Closure, _foo $P0(q) newsub $P0, .Closure, _foo $P0(q) Closures have to be distinct. leo

Re: Closures and subs

2004-11-04 Thread Klaas-Jan Stol
I now see I made some errors (I explain below) First, I show the Lua code: function newCounter () local i = 0 return function () -- anonymous function i = i + 1 return i end end c1 = newCounter() print(c1()) -- 1 print(c1()) -- 2 This is the translation (and it works! :-) .sub

Does Parrot have True coroutines?

2004-11-04 Thread Klaas-Jan Stol
Hello, I spoke (through email) with Roberto Ierusalimschy, one of the creators of the Lua programming language, and I said that Parrot has good support for implementing coroutines and closures (heck, they are explicitly there). However, in a reply, Roberto asked: Are you sure Parrot support true

Re: Does Parrot have True coroutines?

2004-11-04 Thread Klaas-Jan Stol
Well, I don't know how true coroutines are defined, but Parrot, as it's CPS based, has no problems with coroutines and there are no restrictions to coroutines, AFAIK. To be honest, I hadn't thought of this, either (this true-ness of coroutines), but then again, I'm no expert on these things.

Closures and subs

2004-11-03 Thread Klaas-Jan Stol
: get_string() not implemented in SArray ( I know that is because of a being an SArray) I know there are more important issues at the moment, but if someone could spare a moment, that'd be great. I'm trying to get a grip on function syntax. Regards, Klaas-Jan Stol

<    1   2   3   4