[clean-list] Re: Strict lists kill me...

Jerzy Karczmarczuk karczma@info.unicaen.fr
Mon, 01 Dec 2003 14:01:29 +0100


More on it...

Reminder: I sent a triple-version program which generates
a co-recursive stream - a sampled sinusoid. This needed
lazy lists. With normal lists it works, with head-strict
[!Real] lists it produces rubbish, with unboxed [#Real]
it finds a spine black-hole...

So I tested another example.

prefx :: [#Real]
prefx =: ... some filling, e.g. random numbers. No problemo Baby

strm =: prefx ++| z
   where z = 0.5 *> (strm + Tl strm)

This time it works without complaining. So, scratching my head
I replaced


oscilu =: (z,v,r) where
  z =: [# 0.0 : v]
  v =: [# sin 0.01 : r]
  r =: (2.0*cos 0.01)*>v - z

which generated the spine loop error message, by:

oscilu =: (z,v,r) where
  z =: [# 0.0] ++| v
  v =: [# sin 0.01] ++| r
  r =: (2.0*cos 0.01)*>v - z

i.e., I did thing which I tell my students *never to do*.
And miracle happened, it works.

So, it seems that the pattern [# x : l] does something awful.
But what, and who is to blame?

Thanks.


Jerzy Karczmarczuk