[racket] ] Converting symbols to procedures?

From: Deren Dohoda (deren.dohoda at gmail.com)
Date: Mon Aug 11 13:04:43 EDT 2014

Don't quote. You want to pass the class in a list, pass the class in a list.

#lang racket
(define foo%
  (class object%
    (super-new)
    (field [x 0])))
(define bar%
  (class object%
    (super-new)
    (field [x 0])))

(define-values (f b)
  (apply values
         (map make-object (list foo% bar%))))
f
b



On Mon, Aug 11, 2014 at 12:57 PM, Kevin Forchione <lysseus at gmail.com> wrote:

>
> Here’s another example of my problem:
>
> #lang racket
>
> (define foo%
>   (class object%
>     (super-new)
>     (field [x 0])))
> (define bar%
>   (class object%
>     (super-new)
>     (field [x 0])))
>
> ∏(apply make-object '(foo% bar%))
>
> This doesn’t work because the make-object is being passed symbols instead
> of classes.  If I wrap make-object in a function that does an eval on the
> symbol I run into another problem dealing with namespaces.
>
> -Kevin
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140811/cf02f0e7/attachment-0001.html>

Posted on the users mailing list.