--
You received this message because you are subscribed to a topic in the Google Groups "Shen" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qilang/UZk0hRVB6bQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qilang+unsubscribe@googlegroups.com.
To post to this group, send email to qil...@googlegroups.com.
Visit this group at https://groups.google.com/group/qilang.
For more options, visit https://groups.google.com/d/optout.
Antti,
So, you are not interested in stacks, after all!
Your attempts at implementing a type-secure stack data type have failed, and so you discovered Mark’s implementation in terms of lambda functions, which is truly abstract. I cannot think of any tricks that would compromise the integrity of this implementation.
Aside: I have now discovered why (top (empty-stack)) and (pop (empty-stack)) did not work for me, even though I pasted the code directly from the book. In my copy of the 3rd edition the definition of empty-stack starts
(define empty-stack
_ -> (/.X etc
where the underscore _ should not be there.
I do not understand what you are trying to achieve with your ANN-program. I freely admit that I do not understand it, neither do I want to get involved in it.
Having said that, it appears to me that your attempt to use lambda functions to simulate OO-programming, even though it might be possible, seems extremely inefficient to me (I cannot prove it – Mark will know more about it).
I believe that using absvector (a powerful – but not purely functional - addition to Shen) is the way forward. It is comparatively easy to emulate C++ classes, alas, not completely.
I do not want to elaborate, but I have learnt it from TBoS, 3rd edn. p.97 (maybe with a few additional hints from Mark).
Good luck with your ANN!
Willi