Forum > Suggestions

A modest proposal in response to those who want "curly brackets"

<< < (3/6) > >>

MarkMLl:

--- Quote from: CM630 on February 03, 2021, 08:18:38 pm ---The Arduino language (some kind of C I think) uses {} instead of Begin/ End. I still cannot get used to that.

--- End quote ---

It's C++, with a little bit of extra preprocessing.

MarkMLl

skalogryz:
To be honest, I don't see a reason why not to have some sort of "Cascal" project.
Just a C-like syntax notation (language, if you want) that would be translated directly into Pascal.
Naturally RTL and all language types would be Pascal based (strings, dynamic arrays, managed types... etc)

Maybe go a bit further than C-family and allow things like this:

--- Code: C  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---void SomeFunc(int a, b, c)
Again: this should be aside project (a translator), not a native compiler support.

Some syntax would need to be introduced to provide support for Pascal units.
But they can also be borrowed from c-like non-OOP languages, i.e. D.

In some sense, this is what Apple done with Swift-language.

MarkMLl:

--- Quote from: skalogryz on February 03, 2021, 09:32:20 pm ---To be honest, I don't see a reason why not to have some sort of "Cascal" project.

--- End quote ---

Leaving aside for a moment the "reservations" of the community, I think the major argument against that is the extent to which type checking etc. would have to be relaxed... do we really want to be party to that? C is really not a well-thought-out language, it started off with essentially nothing which could not be implemented using assembler macros (adding a modicum of block structure to assembler code was a very popular project in the 80s, hence I suspect Trev's comment about somebody who used begin and end with C).

C++ has attempted to tighten things up and has then layered a lot of complexity on top, which is basically "putting lipstick on a pig". Few people who- IMO- really know what they're doing attempt to defend it: "Within C++, there is a much smaller and cleaner language struggling to get out." (Stroustrup).

MarkMLl

skalogryz:

--- Quote from: MarkMLl on February 03, 2021, 10:38:45 pm ---I think the major argument against that is the extent to which type checking etc. would have to be relaxed...

--- End quote ---
why relax any pascal restriction?
(except for the mandatory "var" section, which comes next to curly braces?)

People who is asking for curlies, don't have a type checking on their mind.

Even the operators priority could stay in a pascal way. (yes, people will complain that copy-pasted C code doesn't compile in Cascal)

dpremus:
When I was started learning Pascal (Turbo Pascal 3.0 for DOS) there is no curly brackets on my keyboard.

In that time curly brackets was replaced with local characters for my country so "{"  was replaced with "Š"
and "}" was replaced with "Đ".    :)

So in that time I was used  "(*"   and  "*)" instead curly brackets. and "(." ".)" instead "["  "]"
But  "(*"   "*)" are still great for debugging, for example when you need to comment some code that already have comments with curly brackets.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---(* { frist multiline  comment }procedure test1;beginend; { second multiline  comment }procedure test2;beginend; *) 

But only thing that I would like to see in Pascal, was multi line string. That will be great for SQL and HTML template.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version