Hi Neil,

On Tue, 8 Jan 2019 14:28:29 -0500, Neil Van Dyke
<n...@neilvandyke.org> wrote:

>In current Racket, the defining module wasn't expecting its own 
>procedure definition to change out from under it, and other users of 
>that module also weren't expecting it to change.
>
>Racket semantics for procedures seems good for software engineering, as 
>well as for tools static analysis, and as a foundation for DSLs and 
>other languages implemented as transformations to Racket, and I don't 
>want to break all that.
>
>When we want polymorphism, we can use something like generics, which 
>normally tells both humans and tools that a particular different 
>abstraction is happening (even if you implemented it with normal 
>procedures -- the code and documentation would tell you of the 
>abstraction).  Whether to do that is also a decision of the module that 
>provides the procedure/generic definition and documents it.
>
>[1] However, if `before` in the quoted example is actually only 
>syntactic sugar for `define` with `apply`, then it's not mutating the 
>original procedure, so I can put down the fire extinguisher.  

AFAICS the example is nothing but a wrapper that mutates the input to
the original.  I see nothing wrong with that.

Even in the case of generics, in no case is the original procedure
being mutated.  It's simply being superceded by a new [same name]
function that (theoretically) adds value.  The new function may (or
not) call the original as part of its working.

For normal functions/procedures I don't see harm in wrappers that
specialize them to new environments.  This is done all the time.  If
you are objecting to the wrapper having the same name as the original
function then I take your point about potential confusion ... but
otherwise I'm lost.


>In that 
>syntactic sugar case, whether to do it is a very local decision, of each 
>module that internally opts to use that sugar. Maybe that sugar makes 
>sense, for those particular modules that use it, within whatever 
>project/organization maintains that source code.

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