hilbert icon indicating copy to clipboard operation
hilbert copied to clipboard

Cannot recursively evaluate a function

Open ruurd opened this issue 10 years ago • 2 comments

Enjoy! -> f(x)=x^2
x ** 2
Enjoy! -> f(4) 
16.0
Enjoy! -> f(f(f(4)))
I'm so sorry, something wrong. Please feel free to report this.   
Enjoy! -> f(f(4))
I'm so sorry, something wrong. Please feel free to report this.
Enjoy! -> f(16)
256.0

ruurd avatar Dec 11 '14 14:12 ruurd

For that matter, composition of functions in general doesn't work well:

Hi guys,thank you for using Hilbert.
You need to execute "postulate zfc_analysis" if you wanna do real analysis.

Enjoy! -> postulate zfc_analysis
success! :)
Enjoy! -> f(x) = x^2
x ** 2
Enjoy! -> g(x) = x + 1
1 + x
Enjoy! -> f(g(2))
I'm so sorry, something wrong. Please feel free to report this.

It's also worth pointing out that there's a significant pause before the ambiguous "I'm so sorry, something wrong" error message.

jackmaney avatar Dec 11 '14 22:12 jackmaney

@jackmaney @ruurd Thank you so much! I'm sorry for delay.. That's true, function in Hilbert is not first class, but we should do..

Basically Hilbert aim to be pure logic programing language so it's difficult to handle higher-order function.

But I'll try it.

gogotanaka avatar Dec 17 '14 08:12 gogotanaka