new method

2004-04-04 Thread Jens Rieks
Hi,

Chromatic and I are unsure what the best name for a constructor method is.

Leo, is it time-consuming to fix IMCC in order to make it possible to use 
new as a method name?

Is there something special to consider to avoid problems regarding several 
languages? Is BUILD a good name for a non Perl6 constructor method?

jens




Re: new method

2004-04-04 Thread Leopold Toetsch
Jens Rieks [EMAIL PROTECTED] wrote:
 Hi,

 Chromatic and I are unsure what the best name for a constructor method is.

.sub __init method

is AFAIK the constructor. It gets called automatically for all parent
classes and the class itself and is the best place to put attributes for
objects in place and set these to their default values.

 Leo, is it time-consuming to fix IMCC in order to make it possible to use
 new as a method name?

new isn't really easy to use. It's a Parrot op and second a keyword in
the lexer (which mightn't be really need anymore though).

 Is there something special to consider to avoid problems regarding several
 languages? Is BUILD a good name for a non Perl6 constructor method?

Well, constructors are class-namespace scoped anyway. So there shouldn't
be a problem.

 jens

leo


RE: new method

2004-04-04 Thread Chris
How about some variation on create?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 20/02/2004



Re: new method

2004-04-04 Thread Uri Guttman
 C == Chris  [EMAIL PROTECTED] writes:

  C How about some variation on create?

just please make sure it has the missing 'e'. :)

uri

-- 
Uri Guttman  --  [EMAIL PROTECTED]   http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs    http://jobs.perl.org


Re: new method

2004-04-04 Thread chromatic
On Sun, 2004-04-04 at 10:17, Leopold Toetsch wrote:

 .sub __init method
 
 is AFAIK the constructor. It gets called automatically for all parent
 classes and the class itself and is the best place to put attributes for
 objects in place and set these to their default values.

I personally want to pass arguments to the initializer (constructor
really isn't the right term).  I expect HLLs will want to do the same.

If we set a convention that the initializer is always called BUILD or
CREAT(E), that's fine.  I'd like to set or follow a wise convention now.

-- c



[DOCS] Ops parsing

2004-04-04 Thread Michael Scott
I've updated the docs for the ops parsing system.

	make html-clean; make html

You'll find it under Perl Modules/Operations and Ops/Tools.

Mike



__find_method Overrideable From PASM/PIR?

2004-04-04 Thread chromatic
According to PDD15, defining a method called __find_method() in my PASM
or PIR would allow Perl 5 AUTOLOAD-like behavior.

I can override __get_string() -- and it's tested in t/pmc/delegate.t. 
Is __find_method() workable yet?  If not, how would I go about adding
it?

t/pmc/delegate.t looks like the right place for it, but I distrust that,
for example, the test for __get_string() actually tests what it should
test.  I'd expect to need to define an entirely new class.

Of course, if I'm misunderstanding PDD15 altogether, that's cool too.

-- c