4 ms·
I have been using tables in Icon since 1986 (they were in Icon before that). Tables allow key/value pairs to be anything. You can set up a specific value to be
by oldandtired 8y ago
I have been using tables in Icon since 1986 (they were in Icon before that). Tables allow key/value pairs to be anything. You can set up a specific value to be returned if the key presented to the table doesn't exist. Lists, sets, tables, records are the mutable values, strings, csets, integers, reals are the immutable.
Failure is an option, so all expressions can succeed and return a value or fail with no result. So there is not an issue with the truthiness of values and the semantics of true/false.
Simple tests like
if a < b < c < d then { do something } else { do something }
are standard in the Unicon/Icon languages.
Icon was my goto language until about 2000 or so and thereafter I have been using Unicon (the Unified Extended Dialect of Icon).
1 based indexing is very useful when you have the dual of indexes < 1 starting at the right hand end of any string or list. Hence, you can work from either end if you need and there are good use cases for starting from the RHS of strings and lists.
I have looked at Lua in the past and nothing in it has given me any incentive to move away from Unicon/Icon. Lisp/Scheme/Kernel and FORTH/Factor have more notable (as far as I am concerned) facilities than Lua.
Though Unicon/Icon has flaws and certain kinds of missing facilities like lambda's, I find that I am more productive in Unicon/Icon than I have been in other languages. YMMV.