The same without classes in Lisp:

(define (foo)
  (let ((foo1 (lambda (s) s))
(foo2 (lambda (s) (list->string (reverse (string->list s)))))
        (foo3 (lambda (s) (string-append s ", " s " "))))
    (lambda (in)
      (match in
        ("first" foo1)
        ("second" foo2)
        ("third" foo3)
        (_ void)))))

(define (main)
  (define bar (foo))

  (for/list ([i '("first" "second" "third")])
    ((bar i) "poor c++")))

Reply via email to