There were knights once upon a time who did indeed say Ni, but it is no longer so.
There were knights once upon a time who did indeed say Ni, but it is no longer so.
Concerning the language itself, the block-based Lisp influence taken from REBOL is noteworthy. The latter is quite underappreciated in general.
I even think Ni is turning out more readable than Rebol/Red - probably due to the use of keyword syntax and infix arguments. And the idea with arg words made lambdas very lightweight, much more so than in Rebol.
For example, here is a very naive version:
lambda: function [block] [
args: sort unique collect [
parse block [
any [
w: set arg get-word! (
keep to-word arg
change w to-word arg
)
| skip
]
]
]
function args block
]
test in REPL... >> f: lambda [:a + :b]
>> f 1 2
== 3
>> foo: lambda [c: :a + :b print [:a "+" :b "=" c]]
>> foo 1 2
1 + 2 = 3
NB. However you wouldn't really use :arg-name here because this is already reserved for the get-word! datatype.However... if I understand your code properly - you are basically generating an argument declaration by scanning for "get words". So its still a static declaration.
In Ni an arg word is an operation. That means a Ni func can decide how many arguments to pull, and in which order, dynamically, much like stack oriented languages can do. Usefulness? Dunno :) But its not the same.
Also, yes, I opted out of set words in Ni since I want to be able to have keyword syntax á la Smalltalk/Self. And I use "^" instead of ":" prefix for get words, because I wanted the argwords to be similar to how they look in Smalltalk. :)