Rob Kinyon skribis 2006-01-19 20:54 (-0500):
> > > There are no references in Perl6.
> > Is your Perl the same as that of other people on this list? :)
> There are no references in Perl6 in the way Perl5 conceives of references.

There are references in Perl 6.

Do note that @foo evaluates to a reference to itself in scalar context,
which isn't some magical auto-referencing thing. Likewise, a reference
to an array is dereferenced when used as an array. This is automatic,
but still not quite magical.

References, their terminology, and their semantics still very much exist.

> I'd say "learn Ruby to know what OO is", but I happen to know you
> already know a nearly-pure OO language - Javascript.

Somehow that makes me think you don't happen to know that I already know
Ruby too. :)

> Every single 'thing' in JS is an object - you can hang methods off of
> a string literal or a number. Most objects in JS aren't references.

They are what one would call a reference if the language were Perl. I'm
very strictly limiting my jargon to Perl's, unless explicitly stated

For example, PHP's references are not references, but more like
pointers and/or symbolic references, depending on which you choose to
call "references" in PHP.

Note, by the way, that JS has "primitive" strings, and Strings, only the
latter being objects. Fortunately for us, though, a string is
automatically promoted to a String when the string is USED AS an object.

> > > &bless was a brilliant idea for Perl5. It's wrong for Perl6.
> > I think it's needed to be able to convert Perl 5 code
> > semi-automatically.  But you have probably thought about this more
> > than I, so I'll ask you: what's the alternative?
> Well, there's two scenarios - you either run your P5 code using Ponie
> or you attempt to use Larry's "Wondrous Machine of Translation".

How would the latter work, if there's no bless?

> But, if you must use the WMoT, then I suspect the following will happen:
>     1) The WMoT notices your use of &bless and marks that package as a
> class and that method as a constructor.
>     2) It creates a Perl6 class for your use, noting the accesses into
> the Perl5 reference that you used and calling those attributes.
>     3) It then creates your BUILD() method, putting all the non-bless
> components of your new() into it.

Doesn't solve the problems as mentioned in this thread, like overlapping


Reply via email to