I think you mean the symbol behind the node ... sort of like a simple hash tree scheme for searching by keywords. Assuming this or even another tree ... imagine something like this (in a pseudo-LISP):
(defun buildtree (wordlist) ...code to build tree recursively returns the tree...) (define lookup (tree word) ...code to look up word using tree, returns t or nil...) (defun lookupmany (tree querylist) (if (eq querylist nil) nil (cons (lookup tree (car querylist)) (lookupmany tree (cdr querylist)) ) ) (defun main (wordlist querylist) ; the main entry point (lookupmany (buildtree wordlist) querylist) )
If this is what you mean, this is pretty straightforward functional programming. Is he stateless? This is a matter of debate. Some people will say some forms of functional programming store what we usually call a โstateโ on the stack. Moreover, Common LISP, even after the first issue of Steeleโs book had iterative constructs, and LISP has setq for a long time.
But in the theory of programming languages, what we mean by โstatelessโ is largely satisfied with the idea presented here.
I think this is something like what you mean.
source share