Linked by Thom Holwerda on Thu 30th Jun 2005 12:26 UTC
General Development For Linux users, HLA is a strong programming tool that allows them to create powerful programs on a variety of different levels. As HLA becomes more feature-rich, additional applications will be written using HLA under Linux. With HLA and Linux, programmers can develop new and exciting applications anyone can use. Read more.
Permalink for comment
To read all comments associated with this story, please click here.
RE: C Escape sequences
by Randall Hyde on Fri 1st Jul 2005 05:09 UTC

>>>> ylai replied to:
The *nice* thing about the fact that HLA does *not* use C's escape character sequence syntax is that it is much easier to create such strings to pass on to other (C) programs and functions that *do* want to see these escape sequences.
------

I think arguing this is "nice" is quite far fetched.
<<<<<<<<<<

Having used this facility to write C code from program's I've written, I would hardly call it "far fetched".


he also wrote:>>>>>>>>>>>>
Can you also give a compelling reason why most people and in most cases want to do stuff like this?
<<<<<<<<<<
In most case, of course not. People typically don't write code that generates C code in most cases.

Then again, what's the big deal with support Pascal-like string rather than C-style strings? If I'd supported C-style strings, then the people on the *other* side of the fence would complain. Keep in mind, HLA is *not* C. It's its own language and there never was an intent to duplicate C. Indeed, of all the languages out there *too* duplicate, C comes in pretty low on the list because of its well-known readability problems. As someone else has pointed out, the main contribution C made to HLA was in the design of some of the compile-time language (preprocessor in C) facilities. C's preprocessor did those fairly nicely compared to other languages. Borrowing quotes and apostrophes from C was another good thing. But C's escape sequences are *not* particularly readable or an amazing good thing to have in a language, hence, they were not adopted.

continuing:>>>>>>>>>>>>
Unless in situations like writing a C parser, there is actually no good reason for this, especially in mixed programming environment.
<<<<<<<<<<<<<<<<<&l t;<<<<<
And the good reason for supporting C escape sequences in a non-C language is?

and more:>>>>>>>>>>>>>
The escape sequences in C are immediately translated by the compiler into their ASCII representation (and not by run time hooks in the I/O library), and you must have users with C-escape interpreting eyes if you see a point to pass strings with literal C escapes to e.g. printf.
<<<<<<<<<<<<<<<<<
I'm not sure I see the point you're trying to make. Obviously, you seem to believe that C's way of doing character strings is the only way to accomplish the task. Great. Feel free to do it that way when you create your own language. I happen to disagree and chose to do it a different way in the language I implemented. Thus far, you're the *only* person I've ever heard complain about this. That doesn't put it very high on my list of priorities to change in the language.
Cheers,
Randy Hyde