Moritz Lenz wrote:

cdumont wrote:
1- $str1 ~ $str2

The '+' suggests numerical addition (and requires disambiguation in the
case of $str + $number - should $str be interpreted as a number, or
$number as a string?).

The . is already taken by method calls (used far more often), and is
easy to overlook when concatenating strings.

Yeah, that's what I thought about the use of the dot for hashes and objects
but hash or object :


which is visually different from :


as the concatenation keeps the sigil.

I am not a huge fan of the + operator either but
well, why add a third type when the dot could be just fine ?
2 ways are already more than one.

2- $life = (!$monster) ?? 'safe' !! 'dead';

is it true??? really??? then you're safe. if not (! is not), you're
dead. PWND.

Again I think that a visually outstanding operator simplifies reading.
It's really easy to overlook a single ':', as it's used in p5.

You are right, that is outstanding but again, so many languages use
a standard ? :
To make it outstand a little bit more :

$life = (!$monster) ?? 'safe' |(^0^;)| 'dead';

But might take some time to get acoustumed to it...(just kidding)

But if we want to choose the visibility key then


is not what I will call something especially visual even if
it's not that awful (well, depending on the keyboard this can be a reall pain though)

3- given $operator {
when '' {}


The given ... when doesn't seem to bring that much from switch ... case
given ... if would make a little bit more sense.

I don't know the rationale about that, but perhaps it's to distinguish
given-when (which uses smartmatching) from other languages that just do
string or number comparison.
I am not native so I do not really know either but I don't feel comfortable
with profusions of different keywords in languages...
why not a :

pour $operator {
   lorsque '' {}

And hashes require '=>' but it could be nice to switch to ':'
because then :(or perhaps we can use whatever separator we want?)

There is a :key(value) pair notation already.

And I know this may not sound that much but it could be sent to
javascript or actionscript or any ecmascript based languages.

I don't think it's a good idea to write files that can be interpreted
either as Perl 6 or as javascript. Perhaps a nice idea for an
obfuscation, though.

No, the aim is not really to write files like ECMAScript but
a very simple example is querying the db
and send the object to javascript or actionscript with a remote call
or the other way round.
The closer the basic structure is, the less manipulation will be needed.
JSON (which should be renamed ESON) is growing these days
and making interactions between languages easier is not that bad.
I have written the example so that to show the internal structure
but could be nice to just do :

my $imageGalleries = new ImgLoader($path);

print "Content-type:text/json¥n¥n";
print Dumper($imageGalleries);

Then whatever the third part, they will be able to handle the object.
it is just a kind of standard serialization to keep persistence.
Last time i used perl to connect to a DB, get the result then send it
into the php serialization format to a php program placed in an other
server.(the framework was in php so...)
Now, just dumping the result and using the json_decode function could work
and for many other languages too.

But that's not a vital point but a nice feature to have.

Anyway, I hope perl6 is going to get out soon!
I didn't really got all the oop keywords but that shouldn't be that bad.

(any reference of functions include in perl6?)


Thank you!


シリル・デュモン(Cyrille Dumont)
our work is the portrait of ourselves
tel: 03-5690-0230 fax: 03-5690-7366

Reply via email to