Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
concatenation of a str and a str function result (*solved*)
#10
programandala.net Wrote:
boriel Wrote:Regarding to the forward function declaration, I think it's much more elegant to let the compiler to guess the function type instead of letting the user to declare it in advance.
But if it's required I will also put it.

I agree the programmer shouldn't declare the functions in advance, it's quite annoying. But the current behaviour of the compiler (default float for not yet parsed functions) forces the programmer to rearrange the source in order to put the string functions at the top, what sometimes is hard to achieve, because some functions call others, and so on... Is this compiler limitation hard to remove? If so, I'd rather declare the functions in advance, so the source can be written freely with any desired layout. That would be more comfortable for the programmer.
With the "forward" declaration (as FreeBasic, C or Pascal do) this limitation is rather easy to remove. But allowing the function to be called in advance without a forward declaration with a single pass compiler (as ZX BASIC), is rather difficult, because the calling code compilation must be delayed until the function has already been declared. This is a somewhat advanced compilation technique referred sometimes as "lazy compilation", and it's mostly used in dynamic languages. I will give it a try... :wink:
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)