On Sun, Sep 25, 2005 at 12:52:08 +0200, Juerd wrote:
> Damian Conway skribis 2005-09-24  8:31 (+1000):
> > >In my opinion, making the string value in interpolation different from
> > >the value in Str context is madness.
> > It's dwimmery.
> It's dwymmery, or dwdmmery indeed. Not at all what I mean, am likely to
> mean, or will ever mean.
> > Which often looks like madness until you realize that it's just a
> > reflection of how most hackers think. ;-)
> This calls for a poll, because I believe nothing of this "most".
> Hackers on this list, what do you think?

I think there is no merit in separating the two since you can't have
a default interpolation. There is no one canonical right way to
visually render any object as text.

Based on this claim I think that if we make 2 stringication
operations, one "pure" and one interpolated, we should have roughly
30 interpolation operators, for each possible scenario of
interpolation (interpolation to STDERR, interpolation when we're
printing many other lines, interpolation into a string that gets
sent to a file (we can use type inferrence)), and so on and so

What I'm getting at is that the distinction between interpolation
and stringification is between the purposing of the stringified
forms - programmatic or visual. This distinction is wrong to make
without separating the types of the output, since there are two
implicit constructors for the Str data type, which are not directly
visible to the naive user.

Furthermore, since the two are combinable, e.g.

        "foo${bar}gorch" ~ $moose;

the train of thought the user follows is that of taking four
elements ("foo", $bar, "gorch", $moose) and making one big result
out of them. The separation of interpolation from stringification
here is tricky because it actually does 2 different operations
instead of seemingly one big operation on four operands.

For every "Oh crap, i get it" i've said in my perl 5 programming
career i think i'll have about 3-4 just related to these
interpolation semantics in perl 6.

This also stops users from picking between interpolation and
concatenation on a case by case basis for the purpose of enhancing

On top of that there is the fact that perl 5 people come to expect
that ("$foo") means ("".$foo), except that the first version is
easier to read.

 ()  Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418  perl hacker &
 /\  kung foo master: /me groks YAML like the grasshopper: neeyah!!!!!!

Attachment: pgp7w51MXUWh8.pgp
Description: PGP signature

Reply via email to