[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

variable indices



Recent mail on the list had Paul musing about whether the (2 ...) should be
a separate word in $var(2 ...). It would be nice, but I can't see how it
would map easily, because then I'd expect the syntax to generalise more:

; a = $b(2 ...)
; a = `{ls}(2 ...)
; a = (a b c d)(2 ...)

The behaviour of the first case is currently different from the behaviour
of the other two cases - the latter two just catenate the two lists.

Perhaps there should be another operator (':'? it's not doing anything)
that performs list element selection from its left-hand operand, taking
the right-hand operator as the indices. To be able to map this smoothly
into the primitives, the right-hand list would have to change syntax, too,
so that it's just one word (unless you want to pass thunks around....).

Perhaps:

; whatis { a = $list:2-,5-8 }

could give:

{ %listelem 2-,5-8 $list }


I'd also be happier with using ranges as indices, I think...

Comments?

steve