
Sat, 20 Oct 2001 10:58:02 +0800 (GMT-8), Saswat Anand
I am wondering why this function should not work with input [x,y] (list with two elements) too, since third element is not referenced.
What a pattern matches is independent from which of the variables it binds are used. The pattern [a,b,c], or equivalently a::b::c::[], matches lists of length 3. You can write a::b::_ to match all lists of length 2 or more. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRCZAK

Marcin 'Qrczak' Kowalczyk wrote:
What a pattern matches is independent from which of the variables it binds are used.
The pattern [a,b,c], or equivalently a::b::c::[], matches lists of length 3. (...)
... unless it matches lazily, as in let [a,b,c] = [1,2,3,4] in let [a,b,c] = [] in 42. Artur -- Zamow odbitki ze zdjec cyfrowych lub archiwum zdjec na CD! [ http://lab.foto.onet.pl/laboratorium.html ]
participants (2)
-
Artur Zawlocki
-
Marcin 'Qrczak' Kowalczyk