[fpc-devel] Re: [fpc-l] type discussion
Michael Van Canneyt
michael at freepascal.org
Sun Jun 5 15:16:39 CEST 2005
On Sun, 5 Jun 2005, Jamie McCracken wrote:
> Michael Van Canneyt wrote:
> >
> > On Sun, 5 Jun 2005, Jamie McCracken wrote:
> >
> >
> > > Hans-Peter Diettrich wrote:
> > >
> > >
> > > > > Not at all; I certainly don't indent them, and I'm a fanatical
> > > > > indenter.
> > > >
> > > >
> > > > Agreed. I really can't understand why some people indent like
> > > > this:
> > > > if ...
> > > > then
> > > > begin
> > > > ...
> > > > end
> > > > else
> > > > if
> > > > ...
> > >
> > > lol - thats not what I meant. If you want readable code you indent
> > > inside the
> > > begin..end blocks ergo the begin..end syntax becomes redundant cause
> > > its the
> > > indentation that provides the visual cue.
> >
> >
> > Visual, yes. But not for the compiler: it folds whitespace.
> > The compiler NEEDS the begin...end to check your syntax. How is it
> > supposed to know where a stament block begins/ends ? Based on indendation
> > alone ? That would not be Pascal...
>
> yes you are right it exists for the benefit of the compiler rather than the
> developer.
>
> My plan in the RAD Pascal dialect is to preprocess each line and put back the
> begin/end where the indentation occurs/varies without altering the line
> numbers. The compiler already has an internal preprocessor so I will simply be
> extending that. If the end result is not to your liking then continue using
> other dialects as none of my changes will affect them. Of course there is
> nothing stopping you from continuing to use begin end blocks in RAD Pascal if
> you really want to but they will be optional whereas indenting will be
> compulsory (you will get an error if your indenting is not consistent!)
I suggest you create an external preprocessor, and limit yourself to that.
I don't consider your construct to be Pascal, so I will fight inclusion of it
in the compiler, not even under some {$Mode} construct.
The compiler is GPL, so you are free to change it, but that doesn't necessarily
mean your changes will make it back in the compiler main sources.
Things that are considered constructive, may make it in.
This does not fall under that category, in my opinion.
Michael.
More information about the fpc-devel
mailing list