[clean-list] segmentation fault
lethevert
acatofearlgrey at ybb.ne.jp
Sat Aug 25 16:12:17 MEST 2007
Hello,
The following program leads to a segmentation fault.
==== ListModl.dcl ====
definition module ListModl
import _SystemStrictLists
map :: !(u:a -> v:b) w:(l u:a) -> w:(l v:b) | List l a & List l b, [w <= u,w <= v]
==== ListModl.icl ====
implementation module ListModl
import ListModl
map :: !(u:a -> v:b) w:(l u:a) -> w:(l v:b) | List l a & List l b, [w <= u,w <= v]
map f [|] = [|]
map f [|a:aa] = [|f a: map f aa]
==== Main.icl ====
module Main
import ListModl, StdInt
Start = map ((+) 1) [1,2,3,4,5]
==================
But the error will be disappeared if I add specialized functions.
map :: !(u:a -> v:b) w:(l u:a) -> w:(l v:b) | List l a & List l b, [w <= u,w <= v]
special l = []; l = [!]; l = [ !]; l = [!!]
I found the error both in Windows and in Linux.
--
lethevert
lethevert at users.sourceforge.net
http://lethevert.blogspot.com/
More information about the clean-list
mailing list