On Mon, 4 Feb 2002, Alex Gough wrote:

> On Mon, 4 Feb 2002, Simon Glover wrote:
> 
> >  Re the former, am I right in thinking that assignment from a PerlArray
> >  to a non-PMC register should always be in scalar context; ie that:
> >
> >      new P0, PerlArray
> >      set S0, P0
> >
> >  should lead to S0 having the value "0" and not ""?
> 
> "string" isn't "scalar" context, I think this should stringify the
> array, so that @foo = qw(elephants hide in custard) becomes "@foo" ->
> "elephantshideincustard".
> 

 You're quite right - I'm not quite sure why I thought this would be
 "scalar" context, but on reflection it clearly isn't. However, this does
 give rise to a couple of questions:

 1. What should we do if the array contains strings of more than one type
 and/or encoding? Clearly we need to do some kind of transcoding, but how
 do we decide what to transcode to? I've had a look in strings.pod but it
 doesn't seem to be terribly helpful on this point.

 2. Will the elements of PerlArrays always be scalar values, or can they
 be aggregates (like other PerlArrays for instance).

 Simon

Reply via email to