Why can't you call a function as input to your proc?
Author |
Message |
TokenHerbz
![](http://compsci.ca/v3/uploads/user_avatars/717170395558e628d9452b.jpg)
|
Posted: Wed Nov 01, 2006 5:24 am Post subject: Why can't you call a function as input to your proc? |
|
|
Example the code i attempted:
code: |
proc setBoxText (var input := font_get (100, 100, Font.New ("times new roman:12:bold"), red): string)
BoxText := input
end setBoxText
|
The input fcn in itself works perfectly, though i wanted to call it when you make a new word for your box, as a proc parameter.
kinda like a type as you go deal, and it will finish the proc after your fcn (which is basicly like "get" with features)
I suppose i could just put it in the proc, but i was wondering why it wont call the fcn in its parameter. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: Wed Nov 01, 2006 9:05 am Post subject: (No subject) |
|
|
because in Turing you can't assign parameters default values, or assign a parameter any kind of value in the declaration (you can in Ruby though!).
Personally, I don't see what's wrong with having your function being called from within the procedure itself anyways |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Wed Nov 01, 2006 9:38 am Post subject: (No subject) |
|
|
because a parameter is a placeholder for the value you pass (actually you could pass a function and execute that internally).
havin a constant function there does not make sense |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|