Hopefully there is someone out there that is familiar with one of these functional languanges. In particular, I am working with Racket.
Let's say that I have an expression that returns a string that is the name of a function. For example:
(string-append "li" "st")
I then want to use that expression in place of the literal function name in a procedure call. For instance, instead of saying:
(list 'A 'B)
I want to do something like:
((string-append "li" "st") 'A 'B)
The problem I am having is that I can't figure out either how to convert the string to an acceptable procedure call or how to convert it to something that I can use with 'apply' or 'eval' in order to execute it.
For context, what I am trying to do is have the user enter two words and then combine those words, along with some other text, into a procedure name and then execute that procedure. My understanding is that one of the strengths of these languages is that you can do things like this.
Let's say that I have an expression that returns a string that is the name of a function. For example:
(string-append "li" "st")
I then want to use that expression in place of the literal function name in a procedure call. For instance, instead of saying:
(list 'A 'B)
I want to do something like:
((string-append "li" "st") 'A 'B)
The problem I am having is that I can't figure out either how to convert the string to an acceptable procedure call or how to convert it to something that I can use with 'apply' or 'eval' in order to execute it.
For context, what I am trying to do is have the user enter two words and then combine those words, along with some other text, into a procedure name and then execute that procedure. My understanding is that one of the strengths of these languages is that you can do things like this.