[clean-list] lazy list as strict argument

clean-list.mail.zooloo at xoxy.net clean-list.mail.zooloo at xoxy.net
Sat Dec 17 17:14:37 MET 2005


Hi all, 

meanwhile I have calmed down a little. My recent "rant" (see *) was not 
meant to offend anyone but to point out what I recognize  as an outstanding 
need, if learning Clean shall be at least as enjoyable as learning any 
other decent language: the need for comprehensive, reliable, up-to-date 
documentation and educational writings, favorably in the www. 

Just an idea: has anyone ever considered to run a Clean Wiki?


Anyway, while dealing with the underlying laws of uniqueness propagation, 
I recognize that I still don't know everything I should about strictness yet. 

The following problem I find particularly puzzling. 


Why does this little program terminate? 

Start = g [0..]
g :: ![Int] -> Int
g a = a!!5

I do not understand what the strictness annotation actually does here to 
the argument of g. From what I have read, I'd expect it to require the 
infinite list to be reduced to SRNF before g is applied (i. e. the 6th element 
should never be extracted). What does it mean to "fully evaluate" a _lazy_ list? 
If nothing but the first few elements are evaluated, doesn't the graph 
representing the list still contain a redex in the tail? 




I'd be grateful for any hints.


Regards, 

zooloo


----
(*) (I know that the CLR still is subtitled "draft", which explains some 
of my difficulties. From what I listed, I've set aside items no. (1) to (3) 
(they might be just mistakes and/or somewhat misleading wording?), but 
(4) remains unsolved, and is related to more fundamental troubles of mine 
with the evaluation and uniqueness propagation behaviour of comprehensions. 

It would help a lot if I knew how a comprehension internally translates to 
"core" functions. The "de-sugared" version of enumerations I could figure 
out from _SystemEnum, but not so with the various array or list comprehension 
or update constructs.)




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16.12.2005

-------------- next part --------------
Spam detection software, running on the system "multi.science.ru.nl", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
postmaster at science.ru.nl for details.

Content preview:  Hi all, meanwhile I have calmed down a little. My
  recent "rant" (see *) was not meant to offend anyone but to point out
  what I recognize as an outstanding need, if learning Clean shall be at
  least as enjoyable as learning any other decent language: the need for
  comprehensive, reliable, up-to-date documentation and educational
  writings, favorably in the www. [...] 

Content analysis details:   (9.2 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 0.3 NO_REAL_NAME           From: does not include a real name
 5.1 BAYES_99               BODY: Bayesian spam probability is 99 to 100%
                            [score: 1.0000]
 3.8 FORGED_MUA_OUTLOOK     Forged mail pretending to be from MS Outlook




More information about the clean-list mailing list