Code: Select all
(ref (list) L)
Code: Select all
(set 'L '(a b c d 1 2 3))
(ref 'd L)
Code: Select all
(list? (3 1 L))
:- true
(ref (3 1 L) L)
:- read error message from newLisp
Where is the answer? It may be a very simple, newbie question.
I.e. the problem as far as i can guess is in the treatment of brackets and quotes by nL.
If our list includes (d 1) as a _sublist_ - (a b c (d 1) 2 3 , the match for '(d 1) will happen, and so examples from documentation work.
But i see no way to match for a subsequence in a flat list, if the sequence is produced by a previous calculation as a list and so is bracketed.
For example - I calculate something that produces "list_q" which is ("1" "0")
I want to find where in list L that "1" is included:
(ref ( 0 1 list_q) L)
:- will fail
because NL wants to treat brackets and quotes as literal part of the symbol in searching the list L.