On 1/7/2019 2:23 PM, Neil Van Dyke wrote:
George Neuner wrote on 1/7/19 1:12 PM:
Your examples look a lot like what is possible using Lisp's generic functions: specifically "before", "after" and "around" functions.

Before/after/around are what I call "advice".  Advice is a lifesaver when you need it and there's no good documented interface.  For example: "I really-really-really need that one function in that library I use to work differently, but I'm not allowed to modify that library, and I plan to quit this job before anyone else sees my code or tries to update to a new version of that library".  But I don't think of advice as good for documented and maintainable code for software engineering.

13 of one, baker's dozen of the other. <grin>

Though I mostly agree with you, your "advice" does have its uses:

http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html
    in particular see the sections on method combinations.

And this is the "documentation" for generic functions in Lisp:

http://www.lispworks.com/documentation/HyperSpec/Body/m_defgen.htm#defgeneric
http://www.lispworks.com/documentation/HyperSpec/Body/m_defmet.htm#defmethod


The basic generics machinery isn't terribly hard to implement inside a compiler.  I'm not sure though how I would do it on top of Racket.   I'm sure I could hack up some ugly macros that would work, but it seems like it needs to be a language to be done right.

YMMV,
George

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to