[Haskell-cafe] Function call by string

Philipp Volgger pvolgger at gmail.com
Sun Apr 8 09:26:25 EDT 2007


Well, the Haskell files are not the problem, they don't have to be built 
automatically. The point is that I want to call functions in a Haskell 
function if I get their names as strings. Isn't there any possibilty to 
do that? Eventually the interpreter reads also the console in to execute 
the input. Maybe it will be the best to look there (interpreter code of 
GHCi)

Thank you :)

Lennart Augustsson schrieb:
> It sounds like you need to generate some kind of Haskell stubs given 
> the Java signatures.
>
> On Apr 8, 2007, at 11:16 , Philipp Volgger wrote:
>
>> Well my problem is the following. I try to make Haskell work with FIT 
>> for Java. I would like to have a 1-to-1 corresondence between the 
>> Java methods and the functions in the corresponding module in 
>> Haskell, thus they would have to have the same name and 
>> arguments/parameters. From Java I could then run the Haskell Code (by 
>> a Server), but I would like to have the possiblity to name the 
>> module, the functionname and so on.
>>
>>
>> Lennart Augustsson schrieb:
>>> In general, you can't do that.  You can only do it if you restrict 
>>> the functions that can be called somehow, e.g., by having a list of 
>>> callable functions and their names.
>>>
>>> Why do you want to do this?  Perhaps there is a more Haskelly 
>>> solution to your problem.
>>>
>>>     -- Lennart
>>>
>>> On Apr 8, 2007, at 11:01 , Philipp Volgger wrote:
>>>
>>>> Hello everybody!
>>>> Can me somebody say how I can call a function by string? Thus I 
>>>> want to have a function that has as argument a string (name of a 
>>>> function to call) and then tries to call that function, a kind of:
>>>>
>>>> functionCall :: String -> [String] -> RetVal
>>>> functionCall functionName arguments = ...
>>>>
>>>> Thanks
>>>> _______________________________________________
>>>> Haskell-Cafe mailing list
>>>> Haskell-Cafe at haskell.org
>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>>
>
>



More information about the Haskell-Cafe mailing list