Re: Discuss changing the behaviour of append()
- Posted by DerekParnell (admin) Jun 11, 2014
- 4748 views
Do you see the normal append() function call from Derek's new deep_append() function?
Sorry, I do not see...
This is the second Derek's logic bug - he just doesn't demonstrate that his wrong code, and I can say nothing about his first logic bug.
You sir, are have a very effective trolling skill.
I didn't show you my failing code because I assumed you had the required Euphoria skills to see when the use of append() would cause the issue first described. My mistake.
Can you point out where there are any logic errors in this function or discussion of mine, please.
The code I posted earlier was the working code. My first attempt at this function used the append() function but that failed at times, due to it trying to append to an atom.
Instead of ...
S[I[1]] &= {X}
my original function had
integer n = I[1] S[n] = append(S[n], X)
This fails when the item at S[n] is an atom. I then changed my code to explicitly test for that condition ...
integer n = I[1] if atom(S[n]) then S[n] = append({S[n]}, X) else S[n] = append(S[n], X) end if
At which point I posted my original question. I have now changed my function to use the concatenation operator to get around the shortcoming in append(), but my suggestion about changing the append() function's behaviour still stands.

