Here is an example that wraps create with a procedure that
adds 1 to all elements of the list that create returns.
#lang racket/base
(struct wrap (vals))
(define (create)
(displayln "A")
'(1 2 3))
(define create-wrap
(impersonate-procedure create
(lambda ()
(displayln "B")
I'd like to change the result of a 0-arity function, but I need help
crafting the right magic spell. Here's my attempt.
#lang racket/base
(struct wrap (vals)) ;; Wrap a list
(define (create) '())
(define create-wrap
(impersonate-procedure create
(lambda ()
;;(values ;; -- this w
Thank you!
On Fri, Aug 21, 2015 at 2:38 PM, Matthew Flatt wrote:
> At Fri, 21 Aug 2015 12:44:08 -0400, Benjamin Greenman wrote:
> > I'd like to change the result of a 0-arity function, but I need help
> > crafting the right magic spell. Here's my attempt -- this even possible?
> >
> >
> > #lang
At Fri, 21 Aug 2015 12:44:08 -0400, Benjamin Greenman wrote:
> I'd like to change the result of a 0-arity function, but I need help
> crafting the right magic spell. Here's my attempt -- this even possible?
>
>
> #lang racket/base
>
> (struct wrap (vals)) ;; Wrap a list
> (define (create) '())
>
I'd like to change the result of a 0-arity function, but I need help
crafting the right magic spell. Here's my attempt -- this even possible?
#lang racket/base
(struct wrap (vals)) ;; Wrap a list
(define (create) '())
(define create-wrap
(impersonate-procedure create
(lambda ()
;;(v
5 matches
Mail list logo