Recent

Author Topic: !! Change Begin-End to {}  (Read 15316 times)

dolemi

  • New Member
  • *
  • Posts: 13
!! Change Begin-End to {}
« on: January 02, 2016, 01:13:14 pm »
Can we have an option to change {} to /* */, and change Begin-End  to {}

vincococka

  • Full Member
  • ***
  • Posts: 101
Re: !! Change Begin-End to {}
« Reply #1 on: January 02, 2016, 01:33:52 pm »
While one can say that everything is possible, I believe that it will lead to confusion when you`ll sometimes switch between C/C++ code and C'ed Pascal syntax.

I came from C world and it is just a matter of habit (begin/end, and {} comments).
---
  Guide me God and I`ll find you

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: !! Change Begin-End to {}
« Reply #2 on: January 02, 2016, 01:38:42 pm »
Can we have an option to change {} to /* */, and change Begin-End  to {}
Use Java, C(++/#), PHP etc. etc.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

balazsszekely

  • Guest
Re: !! Change Begin-End to {}
« Reply #3 on: January 02, 2016, 01:46:28 pm »
Quote
@dolemi
Can we have an option to change {} to /* */, and change Begin-End  to {}
No, I don't think it's possible.  After a few hours of coding you won't even notice "begin end", it will come naturally.

Quote
@eny
Use Java, C(++/#), PHP etc. etc.
This is a good one.  :D
Seriously, changing "begin end" to "{}", it's like changing "{}" to "begin end" in c, c++.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11352
  • FPC developer.
Re: !! Change Begin-End to {}
« Reply #4 on: January 02, 2016, 01:48:45 pm »
Note that Pascal (comment) { } behave differently depending on modes.

In some modes comments must exactly match, in some modes one  } closes the comment.

And no, Pascal is not curly braces, deal with it.


Thaddy

  • Hero Member
  • *****
  • Posts: 14169
  • Probably until I exterminate Putin.
Re: !! Change Begin-End to {}
« Reply #5 on: January 02, 2016, 02:15:26 pm »
Can we have an option to change {} to /* */, and change Begin-End  to {}

The problem is that would probably also make FPC case sensitive O:-)

I'd also like to abbreviate procedure to void,use struct instead of record (although that can be done with macro's),  reverse the type declaration, but usually I stick to C/C++ in those case.

Real Problems:
You can't use conditionals anymore, you can't use a string re[presentation of a GUID etc, etc.
« Last Edit: January 02, 2016, 02:20:10 pm by Thaddy »
Specialize a type, not a var.

guest58172

  • Guest
Re: !! Change Begin-End to {}
« Reply #6 on: January 02, 2016, 02:54:46 pm »
Can we have an option to change {} to /* */, and change Begin-End  to {}

That's stupid to ask this. Historically, languages that use curly braces (and  more generally speaking more symbols) and those who use begin end (and generally speaking more keywords) don't have the same origin.

Pascal influence graph::

http://exploringdata.github.io/vis/programming-languages-influence-network/#Pascal

C influence graph:

http://exploringdata.github.io/vis/programming-languages-influence-network/#C

(see also https://upload.wikimedia.org/wikipedia/commons/2/25/Genealogical_tree_of_programming_languages.svg)

It's like If you wanted to write in french with the cyrilic alphabet. It doesn't work.

Thaddy

  • Hero Member
  • *****
  • Posts: 14169
  • Probably until I exterminate Putin.
Re: !! Change Begin-End to {}
« Reply #7 on: January 02, 2016, 03:14:13 pm »
Can we have an option to change {} to /* */, and change Begin-End  to {}

That's stupid to ask this.

Well, it is a bit more complicated than that.
Both Delphi and especially FPC have syntactic elements that find their source in other language branches.
There is little left for the purists, imo.
Specialize a type, not a var.

dolemi

  • New Member
  • *
  • Posts: 13
Re: !! Change Begin-End to {}
« Reply #8 on: January 02, 2016, 03:19:30 pm »
It is a preference, you like blue, I like green, and none is wrong or right. Everyone has own reason to have Begin-end or {}.

Linux has lots of desktop background pictures. Why does Lazarus cannot have more options fit for different types of programmers? With varieties options, it attracts different type of background people.

I call it as user-friendly. What do you think?

dolemi

  • New Member
  • *
  • Posts: 13
Re: !! Change Begin-End to {}
« Reply #9 on: January 02, 2016, 03:21:05 pm »
I am doing marketing for Lazarus.

dolemi

  • New Member
  • *
  • Posts: 13
Re: !! Change Begin-End to {}
« Reply #10 on: January 02, 2016, 03:44:33 pm »
I have a software that can handle few dozen language syntax.

Abelisto

  • Jr. Member
  • **
  • Posts: 91
Re: !! Change Begin-End to {}
« Reply #11 on: January 02, 2016, 03:45:33 pm »
Can we have an option to change {} to /* */, and change Begin-End  to {}

Yet another holly-war and yet another troll. Just ask about changing curve brackets to TAB characters like in the Python.
OS: Linux Mint + MATE, Compiler: FPC trunk (yes, I am risky!), IDE: Lazarus trunk

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: !! Change Begin-End to {}
« Reply #12 on: January 02, 2016, 04:09:29 pm »
Can we have an option to change {} to /* */, and change Begin-End  to {}
That's easy:
Code: Pascal  [Select][+][-]
  1. uses SysUtils,StrUtils;
  2. ...
  3. ReplacedString := StringsReplace(OriginalString,['{','}','begin','end'],['/*','*/','{','}',[rfReplaceAll,rfIgnoreCase]);
  4.  
;)
Side note:
I don't want to take OP too seriously, he surely needs to Pascalize his brain first. And based on his other questions, Linuxify as well. It's a well known behavior that we once meet in a while.

BeniBela

  • Hero Member
  • *****
  • Posts: 905
    • homepage
Re: !! Change Begin-End to {}
« Reply #13 on: January 02, 2016, 04:15:03 pm »

Seriously, changing "begin end" to "{}", it's like changing "{}" to "begin end" in c, c++.

And in C/C++ you can actually do that!

Code: [Select]
#define begin {
#define Begin {
#define bEgin {
#define BEgin {
#define beGin {
#define BeGin {
#define bEGin {
#define BEGin {
#define begIn {
#define BegIn {
#define bEgIn {
#define BEgIn {
#define beGIn {
#define BeGIn {
#define bEGIn {
#define BEGIn {
#define begiN {
#define BegiN {
#define bEgiN {
#define BEgiN {
#define beGiN {
#define BeGiN {
#define bEGiN {
#define BEGiN {
#define begIN {
#define BegIN {
#define bEgIN {
#define BEgIN {
#define beGIN {
#define BeGIN {
#define bEGIN {
#define BEGIN {
#define end ;}
#define End ;}
#define eNd ;}
#define ENd ;}
#define enD ;}
#define EnD ;}
#define eND ;}
#define END ;}


And that is why C++ is superior

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: !! Change Begin-End to {}
« Reply #14 on: January 02, 2016, 04:21:16 pm »

Seriously, changing "begin end" to "{}", it's like changing "{}" to "begin end" in c, c++.

And in C/C++ you can actually do that!

Code: [Select]
#define begin {
#define Begin {
#define bEgin {
#define BEgin {
#define beGin {
#define BeGin {
#define bEGin {
#define BEGin {
#define begIn {
#define BegIn {
#define bEgIn {
#define BEgIn {
#define beGIn {
#define BeGIn {
#define bEGIn {
#define BEGIn {
#define begiN {
#define BegiN {
#define bEgiN {
#define BEgiN {
#define beGiN {
#define BeGiN {
#define bEGiN {
#define BEGiN {
#define begIN {
#define BegIN {
#define bEgIN {
#define BEgIN {
#define beGIN {
#define BeGIN {
#define bEGIN {
#define BEGIN {
#define end ;}
#define End ;}
#define eNd ;}
#define ENd ;}
#define enD ;}
#define EnD ;}
#define eND ;}
#define END ;}


And that is why C++ is superior
That is also why C++ is unsafe to use and since there is C++ to do that, freepascal has no reason to do it.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018