[q-lang-users] a little question
Brought to you by:
agraef
From: Fabian B. <kan...@we...> - 2006-08-25 08:35:16
|
hello, from the q manual i tried the following example: add [X|Xs] = X+add Xs; then i tried this to test the function: ==> add [1, 2, 3, 4] 1+(2+(3+(4+add []))) what i want to know is, how can i change this function to get back a result? i tried the following: add [X|Xs] = X+add Xs if Xs <> []; ==> add [1, 2, 3, 4] 1+(2+(3+add [4])) which is still not the result i want. by the way i am using q 7.3 maybe there is someone who can help me. greetings, fabian |