|
|
On 22-Sep-08 23:16, Darren New wrote:
> andrel wrote:
>> My point was always the other way around: does Haskell allow you to
>> introduce concepts and control structures that from that point on will
>> become conceptually 'part of the language' for you?
>
> No, I don't think it does. I don't think it's possible to write "case"
> or "let" in Haskell. That's kind of the point. I think you're taking
> "reserved words" to mean the same as "meaningful concepts." I'm talking
> from the point of view of someone building a compiler or something, not
> from someone conceptualizing about an application.
>
>> To the extent that for you they behave like 'reserved words'.
>
> I don't care what it behaves like in my brain. I care what happens when
> it compiles.
OK, so there is where we part. I don't want to think about hardware or
compiler issues when I am solving a problem. (except when I end up
writing a compiler of course). I want to express my thoughts in as clear
a way as possible. If the language does not give me the freedom to
express myself as I think is the most clear, I'll try to extend the
language. Just as when I am doing math and I feel that I should need to
introduce a new syntax. Standard and new syntax will form my new
framework. Whatever someone else at any one time though were his
fundamental concepts is immaterial to me.
>
>>> OK, maybe I misphrased it. How does the compiler distinguish the
>>> variable name from the syntactic form that "case" currently
>>> introduces in Haskell? If "you don't", then it means your compiler's
>>> behavior is unspecified when you use the word "case" as a variable.
>>> People generally don't like compiler behavior to be unspecified for
>>> valid programs.
>>
>> Normal scoping rules may apply.
>
> Then it wouldn't be a reserved word, would it? :-)
>
> I don't know if Haskell actually disallows the use of variables named
> the same as "reserved words", but if it doesn't, then that's a reserved
> word.
>
Let me reiterate, I don't even care if Haskell allows it or not. The
discussion was if Haskell should visually make the distinction or not.
To which my answer is no, because what is and what isn't a reserved word
is too arbitrary. i.e. some are legitimate reserved (most of your
examples are from that stock), some are reserved but a case could be
made to relieve them of that status and some are not reserved, but might
be. So fuzziness all over, hence: do not treat them visually different.
Post a reply to this message
|
|