On Sep 6, 2011, at 2:44 PM, Todd Bittner wrote:
> Actually, on pondering it for a few more minutes, your original solution is
> sufficient for what I'm trying to do, which is to consolidate a lot of
> similar code into one common parent function, but it would be interesting to
> know how to c
Actually, on pondering it for a few more minutes, your original solution is
sufficient for what I'm trying to do, which is to consolidate a lot of
similar code into one common parent function, but it would be interesting to
know how to call the function if I only had a string.
So, if for argument
Are you reading the desired field name from somewhere?
On Sep 6, 2011, at 2:29 PM, Todd Bittner wrote:
> Right, but what I want to do in this case is pass in 'x' and dynamically
> construct posn-x rather than pass in the accessor 'posn-x' itself. In other
> words, I know I want to call a p
Right, but what I want to do in this case is pass in 'x' and dynamically
construct posn-x rather than pass in the accessor 'posn-x' itself. In other
words, I know I want to call a posn accessor, but I don't know which one
yet.
I want to dynamically build and call the method rather than just dynam
In Racket, accessors are functions and are thus perfectly legitimate arguments:
(define (foo some-posn some-accessor)
(some-accessor some-posn))
> (foo my-posn posn-x)
3
On Sep 6, 2011, at 2:17 PM, Todd Bittner wrote:
> Hi,
>
> I'm trying to something along the following lines:
>
> >
5 matches
Mail list logo