[racket-users] Re: Functional augmenting

2019-01-09 Thread George Neuner
Hi Neil, On Tue, 8 Jan 2019 14:28:29 -0500, Neil Van Dyke 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 goo

Re: [racket-users] Re: Functional augmenting

2019-01-09 Thread Greg Hendershott
On Tue, Jan 8, 2019 at 4:35 PM Jens Axel Søgaard wrote: > > Den tir. 8. jan. 2019 kl. 21.40 skrev David Storrs : >> >> >> This. In an ideal world, before/after/around would be parameterized so that >> you can make the change only for a defined scope. >> >> Still, the intent was never that it wou

Re: [racket-users] Re: Functional augmenting

2019-01-08 Thread Jens Axel Søgaard
Den tir. 8. jan. 2019 kl. 21.40 skrev David Storrs : > > This. In an ideal world, before/after/around would be parameterized so > that you can make the change only for a defined scope. > Still, the intent was never that it would extend its effects outside the > current module. > In that case you

Re: [racket-users] Re: Functional augmenting

2019-01-08 Thread David Storrs
On Tue, Jan 8, 2019 at 12:47 PM Eric Griffis wrote: > Apologies for the backtracking, but I'm still having trouble understanding > before/after/between and ordinary function composition. For non-method > functions, what's the difference? > Easy extension of existing code. For example: (define

Re: [racket-users] Re: Functional augmenting

2019-01-08 Thread Neil Van Dyke
Sorry, I think I was being very unclear.  I was only discouraging something `defadvice`-like mutating the behavior of normal Racket procedures, which looks like what was probably originally described: > (define (greet name)   (println (string-append  "Hi, " name))) [...] > (before greet ~a) 

Re: [racket-users] Re: Functional augmenting

2019-01-08 Thread Eric Griffis
My bad. I confused ordinary with generic. On Tue, Jan 8, 2019, 9:47 AM Eric Griffis Apologies for the backtracking, but I'm still having trouble understanding > before/after/between and ordinary function composition. For non-method > functions, what's the difference? > > Also, I'd never heard of

Re: [racket-users] Re: Functional augmenting

2019-01-08 Thread George Neuner
Hi Neil, On 1/7/2019 9:58 PM, Neil Van Dyke wrote: George Neuner wrote on 1/7/19 4:49 PM: 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.

Re: [racket-users] Re: Functional augmenting

2019-01-08 Thread Eric Griffis
Apologies for the backtracking, but I'm still having trouble understanding before/after/between and ordinary function composition. For non-method functions, what's the difference? Also, I'd never heard of these functions as a Perl dev. A quick search turns up Moose. Is that what you're talking abo

Re: [racket-users] Re: Functional augmenting

2019-01-08 Thread David Storrs
On Mon, Jan 7, 2019 at 9:58 PM Neil Van Dyke wrote: > George Neuner wrote on 1/7/19 4:49 PM: > > 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

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread Neil Van Dyke
David Thrane Christiansen wrote on 1/7/19 6:02 PM: A quick grep of the source makes it look like there's at least some support for these. But the docs are certainly less easy to navigate than Scribble docs! The developer of Swindle, Eli Barzilay, was one of the developers of Scribble, as well

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread Neil Van Dyke
George Neuner wrote on 1/7/19 4:49 PM: 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. Thank you; I should've looked it up before incorrectly

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread David Thrane Christiansen
> Swindle/CLOS does implement generic functions, but I'm not aware that it > also implements the before / after / around methods that we have been > talking about. But then, it does so much I may just have missed > something ... its documentation can be tough to read at times. A quick grep of the

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread George Neuner
On 1/7/2019 5:32 PM, David Thrane Christiansen wrote: > 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

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread David Thrane Christiansen
> 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. What about Swindle? https://

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread George Neuner
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 y

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread Neil Van Dyke
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 inte

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread David Storrs
On Mon, Jan 7, 2019 at 1:12 PM George Neuner wrote: > Hi David, > > On 1/7/2019 12:57 PM, David Storrs wrote: > > I haven't worked with Racket's generics before, but a quick skim through > the documentation suggests that no, that's not it. Racket generics appear > to relate to collections and st

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread George Neuner
Hi David, On 1/7/2019 12:57 PM, David Storrs wrote: I haven't worked with Racket's generics before, but a quick skim through the documentation suggests that no, that's not it.  Racket generics appear to relate to collections and structs, whereas I was looking for something that operates on arb

Re: [racket-users] Re: Functional augmenting

2019-01-07 Thread David Storrs
On Sun, Jan 6, 2019 at 4:28 PM George Neuner wrote: > On Fri, 4 Jan 2019 13:30:43 -0500, David Storrs > wrote: > > >Racket's OO system has the 'augment' family of functionality that allows > >you to change how a function works. I'm wondering if there's a way to do > >something similar in functi

[racket-users] Re: Functional augmenting

2019-01-06 Thread George Neuner
On Fri, 4 Jan 2019 13:30:43 -0500, David Storrs wrote: >Racket's OO system has the 'augment' family of functionality that allows >you to change how a function works. I'm wondering if there's a way to do >something similar in functional Racket. For example, when I was working in >Perl I used to