Maybe this is not the right list for that, sorry. But is there a good
reason for this behavior?
# perl -e 'print substr("ciao",0,10);'
ciao
# ruby -e 'puts "ciao"[0..10]'
ciao
# python -c 'print "ciao"[0:10];'
ciao
# csi -e '(print (substring "ciao" 0 10))'
Error: (substring) out of range 0 10
Call history:
<syntax> (print (substring "ciao" 0 10))
<syntax> (substring "ciao" 0 10)
<eval> (print (substring "ciao" 0 10))
<eval> (substring "ciao" 0 10) <--
I find it rather inconvenient and I can't really see any good reason
to do that. In fact, it makes the usage of substring "unsafe" and the
countermeasures I can imagine (manual bounds checks, padding, writing
my-own-substring-function, whatever) are quite unsatisfactory... to me
at least.
Regards,
Michele
_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers