Aliasing an array slice

2003-07-04 Thread Dan Brook
Will it be possible (or sane even) to bind a variable to an array slice
e.g

  ## correct syntax?
  my @array =  a list of values ;

  my @array_slice := @array[ 1 .. @array.end ];

Or would this merely bind @array_slice to the list returned by the slice,
or would it DTRT (in my eyes at least) and bind it to that particular
slice of @array?

Dan Brook


Re: Aliasing an array slice

2003-07-04 Thread Luke Palmer
 Will it be possible (or sane even) to bind a variable to an array slice
 e.g
 
   ## correct syntax?
   my @array =  a list of values ;
 
   my @array_slice := @array[ 1 .. @array.end ];

Yeah, that'll work.  It has to, lest:

my [EMAIL PROTECTED] := (1, 1, map { $^a + $^b } zip(@fibs, @fibs[1...])) #[1]

Wouldn't work.

 Or would this merely bind @array_slice to the list returned by the slice,
 or would it DTRT (in my eyes at least) and bind it to that particular
 slice of @array?
 
 Dan Brook

[1] Oh don't look so scared :-)

Luke


Re: Aliasing an array slice

2003-07-04 Thread Damian Conway
Dan Brook wrote:

Will it be possible (or sane even) to bind a variable to an array slice


It *should* be, since it's possible (if ungainly) to do it in Perl 5:

	use Data::Dumper 'Dumper';

	@bar = (1,2,3);

	*foo = (sub [EMAIL PROTECTED])-(@bar[1,0,3]);

	print Dumper [EMAIL PROTECTED];

$foo[0] = 9;
$foo[1] = 11;
$foo[2] = 13;
	print Dumper [EMAIL PROTECTED];

Damian



Re: Perl6 Daydreams (on topic but frivolous)

2003-07-04 Thread Jonadab the Unsightly One
Iain Truskett [EMAIL PROTECTED] writes:

 * Jonadab the Unsightly One ([EMAIL PROTECTED]) [01 Jul 2003 23:41]:
  Iain Truskett [EMAIL PROTECTED] writes:
 
   Not the only one. And with Parrot being able to execute
   Z-code, it might be sane to port Inform to Parrot!
 
  Did you mean port Inform to run on Parrot, or port Inform
  to compile to parrot?
 
 The former. 

That shouldn't be too hard, once Parrot is essentially complete.
Inform is _fairly_ portable.  Not extremely portable like z-code, but
fairly portable.

 I was thinking more of Parrot being a portable interactive fiction
 platform for reading and creating games.

I can see the advantage in having Inform run on Parrot, so that games
could be created anywhere.  Currently Inform only runs on a relative
handful of major platforms (RISC OS, most POSIX systems, Win32, DOS,
Mac classic, Amiga, OS/2, and a couple of others I think.)  Various
people have expressed interest on getting it to run on various
handheld devices, but the only such effort I know about succeeding is
the Psion 5, though the folks in rec.arts.int-fiction would know
better; I've been out of touch with the IF community lately.

For reading/playing games, I don't think it makes sense to try to
compete with the existing, established virtual machines.  The
z-machine is the veritable holy grail of portability.  Every month it
seems somebody releases a new z-machine for Yet Another Obscure
Platform.  z-code runs on everything from Gameboy to Emacs.