On Wed, 2006-11-22 at 19:46 +0100, Rhythmic Fistman wrote:
> just tried building some flx code I hadn't touched for a while
> and "slice" has become a reserved word. What's the other
> slice do?
It's not a reserved word, just in the global namespace.
Put your code in a module.
> 64: publish "slice type"
> 65: union slice[T] =
> 66: | Slice_all
> 67: | Slice_from of T
> 68: | Slice_to of T
> 69: | Slice_range of T * T
> 70: | Slice_one of T
> 71: ;
It nominates the equivalent of Python slices
for substring extraction:
// Python Felix
x[:] x.[Slice_all]
x[1:] x.[Slice_from 1]
x[:2] x.[Slice_to 2]
x[1:2] x.[Slice_range$ 1,2]
x[1] x.[Slice_one 1]
Erick's idea. Point is that the 'slice' thing
is a first class object.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language