A few comments/corrections on what I said before about R7RS...

> The draft R7RS says for equal? "Even if its arguments are circular data 
> structures, equal? must always terminate."  That sounds nice and general, 
> except what that MEANS is that every test using "equal?" must be ten times 
> slower and chew up memory.

You to partly solve this for equal? by using a counter to recursively implement 
"equal?" over pairs up to some value, and if you exceed the value, switch to a 
slower equal test that tracks every comparison.

You still have twice as many comparisons, and you still have to track in the 
worst case.  Also, R7RS doesn't have hash tables built in, so there's no easy 
way to self-implement an efficient implementation in a portable way.

It still seems to me that an equal-circ? or similar would be better.  This is a 
big change to the semantics, in particular, it *requires* a much more complex 
and memory-hungry algorithm.  It seems to me it should have a different symbol. 
 It still creates a portability problem; if they'd named the new operator 
"equal-circ?", then implementations or app writers could ADD that without 
interfering with the existing equal?

>  Same for write.

The write is more complicated. R7RS has a "write-simp", and have *CHANGED* the 
semantics of write so that the written output can't be read by older systems. 
Eeek; we intentionally talk about NOT changing the writer for even curly-infix 
for years to come, just to avoid that issue.  I think this should be 
write-circ, and keep using write as is.

The good news is that at least some of the problems with "write" are known:
 http://trac.sacrideo.us/wg/wiki/WG1Ballot6Results
Looks like they're going to have write detect cycles, and separately provide 
'write-simple' and 'write-shared'.  That still means a significant overhead in 
"normal write" to track every cons pair seen :-(.

> (as well as an appeal to restored the c....r functions which are some of the 
> few actually portable functions and have been with us for decades).

Correction: Removing them was discussed here:
http://lists.scheme-reports.org/pipermail/scheme-reports/2011-October/001575.html
http://lists.scheme-reports.org/pipermail/scheme-reports/2011-October/001587.html

But cadddr and friends *are* in the latest draft 6. Good.  It's nice to have 
SOME procedures that are common between versions of the language :-).

I've read a lot of R7RS discussions recently, and I got confused between what 
was discussed and what was agreed on.  Sorry about that!

--- David A. Wheeler

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to