--- [EMAIL PROTECTED] wrote on 26-Aug-2000/15:15:31-7:00

> Hi Volker
> This may be a partial dupe of one I sent earlier.
> 
> Why do you insert the "item: first a", but then not use it?
> 

Paul needed the index and the item without all that 'first everytime.
this is a big bit ugly, but gives you both values:
> > a: "101"
> > forall a [item: first a
> >     print index? a]

its a sample, so i found no use for the 'item..
not as elegant as Gabrieles solution :)

> Here's a console session that prints index and item:
> 
> >> a: "101"
> == "101"
> >> forall a [prin index? a print [" " first a]] a: head a ; This final
> statement is needed only if the forall is rerun later.
> 1  1
> 2  0
> 3  1
> == "101" ; This results from the "final statement" in the console line
> above.
> >>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, August 26, 2000 2:10 PM
> Subject: [REBOL] Index? Re:
> 
> 
> >
> >
> > a: "101"
> > forall a [item: first a
> >     print index? a]
> >
> > >
> > >     Is there an alternative for:
> > >
> > >     >>a: "101"
> > >     >>foreach item a [print index? item]
> > >     1
> > >     2
> > >     3
> > >
> > > Obvious to you REBOL gurus this generates an error.  But it illustrates
> > > clearly what I want to do.  Damn, index? is native!  :)   Anyone have
> some
> > > helpful alternatives.
> > >
> > >
> > > Paul Tretter
> > >
> > >
> > Volker
> >
> >
> 
> 
-- Volker 

Reply via email to