<beneroth>
((lit hd)) is a function call, calling the result of (lit hd)
<beneroth>
so it probably segfaults there, no?
<beneroth>
as the result of (lit hd) is most likely not a function body
<Regenaxer>
Hi beneroth!
orivej has quit [Ping timeout: 264 seconds]
<joncfoo>
no it doesn't segfault - it just returns ("c")
<Regenaxer>
hmm, so is
<Regenaxer>
((lit hd) (add-word () (cdr WORD)))
<Regenaxer>
supposed to be a computed function call
<Regenaxer>
withe the result if add-word as arg?
<joncfoo>
yes that is what I expect
<Regenaxer>
(lit hd) returns the value quoted
<joncfoo>
well (cons ((lit hd) (add-word () (cdr WORD)) TRIE)
<Regenaxer>
yes, that's different
<Regenaxer>
ah, misread
<joncfoo>
if I remove the call to lit, I get a "hd -- Undefined"
<beneroth>
yeah function call
<joncfoo>
yea I have to quote the transient symbol
<Regenaxer>
hd is "c"
<Regenaxer>
so it you quote it, it is not a function
<Regenaxer>
(quote . "c")
<beneroth>
what is the expected result of (add-word () (chop "cat")) ?
<beneroth>
btw. this is equal to (add-word NIL '("c" "a" "t"))
<joncfoo>
("c" ("a" ("t" (ok]
<joncfoo>
I'm trying to build a Trie structure
<Regenaxer>
ok, let me try to clean up
<beneroth>
joncfoo, 'cons function is not destructive, and cons is prepending, not appending
<joncfoo>
that's ok - it can be in reverse, it doesn't matter in the end
<beneroth>
(if (not Word) ...) -> (ifn Word ..)
<joncfoo>
+1
<joncfoo>
nice shortcut
<beneroth>
strongly recommend to keep to the picolisp naming convention, though it has no technical effect. Local variables starting with upper case, so hd -> Hd
<Regenaxer>
yeah
<joncfoo>
sounds good
<joncfoo>
are function parameters supposed to be all caps?
<Regenaxer>
What args are the 'cons'es supposed to get?
<Regenaxer>
Not all caps
<tankf33der>
joncfoo: cant open clojure code link on iphone
<Regenaxer>
all caps are rather global constants
<beneroth>
tankf33der, it loads forever on desktop firefox, but eventually something comes up
<beneroth>
joncfoo, function parameters are basically the same as local variables :)
<tankf33der>
joncfoo: you took too complex task.
<joncfoo>
lol
<tankf33der>
joncfoo: btw, i have 4clojure solved on picolisp: