guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheme 101


From: Alejandro Forero Cuervo
Subject: Re: Scheme 101
Date: Tue, 27 Nov 2001 20:06:12 -0500
User-agent: Mutt/1.2.5i

    is there a way to use a string as a function name?  i also tried
    string->symbol, eval and operator ":" i'm pretty sure it is
    possible.  it would be very usefull when ef-str is read from user
    input for e.g

Hmm, the following works for me in Guile 1.5.2:

  (define (f x y) (+ x y))
  (define ef-str "f")
  ((eval (string->symbol ef-str) (interaction-environment)) 1 2)

What do you get?

Alejo.
http://bachue.com/alejo

--
The mere formulation of a problem is far more essential than its solution.
      -- Albert Einstein.

$0='!/sfldbi!yjoV0msfQ!sfiupob!utvK'x44;print map{("\e[7m \e[0m",chr ord
(chop$0)-1)[$_].("\n")[++$i%77]}split//,unpack'B*',pack'H*',($F='F'x19).
"F0F3E0607879CC1E0F0F339F3FF399C666733333CCF87F99E6133999999E67CFFCCF3".
"219CC1CCC033E7E660198CCE4E66798303873CCE60F3387$F"#Don't you love Perl?

Attachment: pgpqOY9lPOBfD.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]