Subject: Removing the first element

From: "Justice, Randy -CONT" <[email-masked]>
Date: Wed, 6 Sep 2000 13:56:24 -0500

I was trying to remove the first element of the list and return the results
in the parameter.
I have two rules: test  and test1.   Why don't test1 work?   What is the
fundamental rule that I am missing??  How does one assign a value to a
parameter --(with numbers one can use "is") ?

test(X):-
   write(X),
   write('\n'),
   [Y|Z] = X,
   write(Y),
   write('\n'),
   write(Z).

test1(X):-
   write(X),
   write('\n'),
   [Y|X] = X,
   write(Y),
   write('\n'),
   write(X).

?- test([[1,2],[1,2,3,4]]).
[[1, 2], [1, 2, 3, 4]]
[1, 2]
[[1, 2, 3, 4]]

Yes
?- test1([[1,2],[1,2,3,4]]).
[[1, 2], [1, 2, 3, 4]]

No

Thanks again... 

Randy