|
 |
Warp wrote:
> However, it doesn't matter! As long as F behaves like a function, that's
> just fine. This is used quite a lot in template coding, eg. with functors
> and comparators. This gives flexibility and versatility.
Hmm. I never thought of it that way. OK.
> It's not like C++ was the only language which behaves like this.
Well.... I think it's one of the few languages where you can't tell whether
something's invoking a function or adding a name to the namespace at compile
time. It would seem to make writing parsers and such harder than it needs
to be.
I'll grant that there are a number of languages where (say) writing "F(5)"
doesn't tell you whether F is a function, a pointer to a function, or a
function that returns another function, say.
> Most languages have special keywords to denote what you want to do.
> For example, some languages might have a keyword like "function" to denote
> that you are starting a function definition, as opposed to starting a
> function call. I don't really see the big difference.
It makes the grammar easier to automate.
>> You can't tell me a language with undecidable syntax isn't at least a little
>> sucky, yes?
>
> When that syntax brings flexibility, I don't consider is such a huge
> problem.
Other languages seem to manage being as flexible without having such complex
grammars. I'll grant that they trade off runtime efficiency to achieve that.
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
 |