Bug in 0m/03: Unable to append to a list twice

This might be related to Bugs with non-linear unification

When append is called twice on a list, the second one fails. Here’s a minimal example:

(global variable (tasks []))
(program entry point)
	(insert 1)
	(tasks $cur)
	tasks has: $cur
	(insert 2)
	(tasks $cur)
	tasks has: $cur

(insert $item)
	(tasks $list)
	(append $list $item $finalList)
	(now)(tasks $finalList)

The final result should be: [1 2], however the built-in append function fails.

2 Likes

A slightly different way of implementing this via head/tail also fails:

(global variable (tasks []))
(program entry point)
	(insert 1)
	(tasks $cur)
	tasks has: $cur
	(insert 2)
	(tasks $cur)
	tasks has: $cur

(insert $item)
	(tasks $list)
	($finalList = [$item | $list])
	(now)(tasks $finalList)
1 Like