Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-10

Turbo Pascal Mode Bug?

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Zaka E-Lab

Hello,

I have a peace of code that demonstrates that in the TP mode of freepascal, one can use a function as a procedure.

Is this a bug or a normal behavior?

My University have replaced ( other time ) freepascal.org, and we must use the archaic Turbo Pascal 6.0, cause they say that freepascal don't respect the ISO Pascal.

I let you the code here:

program func_as_proc(input,output);
function pru_func:boolean;
begin
    writeln ('If I am printed, then you can use a function as a
procedure.');
    pru_func := TRUE

end; { pru_func }

begin
    (*
     *  Prove if a function can be used as a procedure.
     *)
    pru_func;
end.

Thanks in advance.

Reply by email

Florian Klaempfl
to Zaka E-Lab
Show quoted text 6 lines
Hello, I have a peace of code that demonstrates that in the TP mode of freepascal, one can use a function as a procedure. Is this a bug or a normal behavior?

Normal because FPC emulates TP7, just add {$X+} in TP6 and you get the same behaviour.

Show quoted text 30 lines
My University have replaced ( other time ) freepascal.org, and we must use the archaic Turbo Pascal 6.0, cause they say that freepascal don't respect the ISO Pascal. I let you the code here: program func_as_proc(input,output); function pru_func:boolean; begin writeln ('If I am printed, then you can use a function as a procedure.'); pru_func := TRUE end; { pru_func } begin (* * Prove if a function can be used as a procedure. *) pru_func; end. Thanks in advance. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Daniël Mantione
to Zaka E-Lab: I have a peace of code that demonstrates that in the TP mode of freepascal, one can use a…

Op Mon, 1 Oct 2007, schreef Zaka E-Lab:

My University have replaced ( other time ) freepascal.org, and we must use the archaic Turbo Pascal 6.0, cause they say that freepascal don't respect the ISO Pascal.

Funny. Free Pascal does not respect ISO Pascal, because it respects Turbo Pascal. :) Turbo Pascal in turn, does not respect ISO Pascal, because it respects UCSD Pascal.

Daniël

Reply by email

Zaka E-Lab
to Daniël Mantione

Daniël Mantione:

Funny. Free Pascal does not respect ISO Pascal, because it respects Turbo Pascal. :) Turbo Pascal in turn, does not respect ISO Pascal, because it respects UCSD Pascal.

Is very confusing when talking about Standard Pascal, cause it's not like C/C++ that have standard that is respected by most people ( at least, is what I feel ). My teachers talk about "Standard Pascal" ( no one knows what they are talking about, but you must accept their holy truth ), I knew that TP is not ISOP, but the pupil can't refuse the teacher unless he wants to be bitten.

Florian Klaempfl:

Normal because FPC emulates TP7, just add {$X+} in TP6 and you get the same behaviour.

Is there a way to do the contrary? I mean, to avoid the use of a function as a procedure in freepascal.

Thanks.

Zaka.

Reply by email

Jonas Maebe
to Zaka E-Lab
Zaka E-Lab wrote 7 lines
Florian Klaempfl: > Normal because FPC emulates TP7, just add {$X+} in TP6 and you get > the > same behaviour. Is there a way to do the contrary? I mean, to avoid the use of a function as a procedure in freepascal.

Add {$x-}

Jonas

Reply by email

Daniël Mantione
to Felipe Monteiro de Carvalho

Op Tue, 2 Oct 2007, schreef Felipe Monteiro de Carvalho:

Show quoted text 7 lines
As per the docs: http://www.freepascal.org/docs-html/prog/progsu82.html#x90-900001.2.17 There is a GNU pascal mode. AFAIK Gnu Pascal follows ISO Pascal, so it would be possible to use Free Pascal with this mode, or GNU Pascal, to have a compiler that complies with ISO Pascal.

Yes, but, the ISO Pascal support was never coded. This mode did basically disable a lot of functionality and provide no GNU Pascal compatibility. Because this results in false expectations, I have disabled it some time ago.

See the "user changes" document on the wiki.

Daniël

Reply by email