[fpc-pascal] Bls: Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Mr Bee
> Maybe a little bit offtopic, but I have a question regarding the compiler >directives: is there a way to tell Lazarus to use these directives in every >new unit? I even expect a bit further. These {$MODE OBJFPC}, {$H+}, and {$J-} >directives should be the *default* directives for every new FPC

[fpc-pascal] Bls: Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Mr Bee
> I definitely *do not want* to explain to any new programmer what a "writeable >constant" is... This concept should remain buried :) Exactly! I also don't >understand why the {$MODE OBJFPC} uses the {$J+} as the default. :) –Mr Bee Pada Selasa, 21 Juni 2016 12:47, Michalis Kamburelis m

Re: [fpc-pascal] Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Marc Hanisch
Thanks Michalis for your excellent work! It's very important to left the early 90s associated with Pascal programming behind us and to encourage new developers to have a look onto the modern aspects of Object Pascal! Maybe a little bit offtopic, but I have a question regarding the compiler directi

Re: [fpc-pascal] Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Michalis Kamburelis
2016-06-20 5:31 GMT+02:00 Mr Bee : [...] > I have a little suggestion though. I prefer to use {$J-} directive in my > Pascal program. I think it encourages good programming practice in Pascal. > The {$J-} means constant is a constant no matter how you declare it. To bad > FPC is still using {$J+} a

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Björn Lundin
On 2016-06-21 00:37, Fabio Luis Girardi wrote: > > > 2016-06-20 18:15 GMT-03:00 Björn Lundin >: > > > on Linux and AIX I use lockf. > then read() and write() from the os. > However I lock the whole file, but the manpage says it is possible to > lock

[fpc-pascal] Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Mr Bee
Good work, sir. Thank you very much. I might use your article to direct people who still thinks Pascal today is still like the old Pascal of the 70's. :)  I have a little suggestion though. I prefer to use {$J-} directive in my Pascal program. I think it encourages good programming practice in Pa

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Fabio Luis Girardi
2016-06-20 18:15 GMT-03:00 Björn Lundin : > > > on Linux and AIX I use lockf. > then read() and write() from the os. > However I lock the whole file, but the manpage says it is possible to > lock parts of it. > > > This can be used to lock character devices, like /dev/ttyUSB0? FPC fpFLock does the

Re: [fpc-pascal] default parameter single = NaN

2016-06-20 Thread David Emerson
On 06/20/2016 02:53 PM, Martin wrote: On 20/06/2016 22:45, David Emerson wrote: I found a workaround, which is to use Infinity as the default value, instead of NaN. It's acceptable for my use, though a little awkward. there is another workaround. Do not repeat the default value at implementati

Re: [fpc-pascal] default parameter single = NaN

2016-06-20 Thread David Emerson
On 06/20/2016 02:43 PM, Jonas Maebe wrote: On 20/06/16 22:59, David Emerson wrote: Error: function header doesn't match the previous declaration for a (non-method) function that does exactly match its previous declaration: function make_scale_matrix (zx:single; zy:single=NaN):t_2d_affine; It

Re: [fpc-pascal] default parameter single = NaN

2016-06-20 Thread Martin
On 20/06/2016 22:45, David Emerson wrote: I found a workaround, which is to use Infinity as the default value, instead of NaN. It's acceptable for my use, though a little awkward. there is another workaround. Do not repeat the default value at implementation. Declare as function make_scale_ma

Re: [fpc-pascal] default parameter single = NaN

2016-06-20 Thread David Emerson
I found a workaround, which is to use Infinity as the default value, instead of NaN. It's acceptable for my use, though a little awkward. ~David ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/l

Re: [fpc-pascal] default parameter single = NaN

2016-06-20 Thread Jonas Maebe
On 20/06/16 22:59, David Emerson wrote: Error: function header doesn't match the previous declaration for a (non-method) function that does exactly match its previous declaration: function make_scale_matrix (zx:single; zy:single=NaN):t_2d_affine; I use "NaN" extensively to indicate a null / no

[fpc-pascal] default parameter single = NaN

2016-06-20 Thread David Emerson
Hey all, After installing fpc 3.0.0, I'm getting an... Error: function header doesn't match the previous declaration for a (non-method) function that does exactly match its previous declaration: function make_scale_matrix (zx:single; zy:single=NaN):t_2d_affine; I use "NaN" extensively to in

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Björn Lundin
On 2016-06-20 11:28, Mark Morgan Lloyd wrote: > I'm approaching a situation where up to four identical processes will be > reading and writing the same files. There will be process-level > synchronisation which should prevent clashes, but I'd still like to add > locking at the file level. > > I pr

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Mark Morgan Lloyd
Jonas Maebe wrote: On 20/06/16 11:28, Mark Morgan Lloyd wrote: I'm approaching a situation where up to four identical processes will be reading and writing the same files. There will be process-level synchronisation which should prevent clashes, but I'd still like to add locking at the file leve

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Jonas Maebe
On 20/06/16 11:28, Mark Morgan Lloyd wrote: I'm approaching a situation where up to four identical processes will be reading and writing the same files. There will be process-level synchronisation which should prevent clashes, but I'd still like to add locking at the file level. If you use sysu

Re: [fpc-pascal] What is the difference between case else and case otherwise

2016-06-20 Thread Sven Barth
Am 20.06.2016 17:19 schrieb "Dennis" : > > There is no details on http://www.freepascal.org/docs-html/ref/refsu57.html There is none by itself (except that "otherwise" is Extended ISO Pascal compliant). The only visible difference would be if you'd have a if-statement as last case statement as an

Re: [fpc-pascal] What is the difference between case else and case otherwise

2016-06-20 Thread Anthony Walter
In GNU Pascal otherwise is synonymous to else. http://www.getlazarus.org/learn/language/lexical/#case_condition ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] What is the difference between case else and case otherwise

2016-06-20 Thread Dennis
There is no details on http://www.freepascal.org/docs-html/ref/refsu57.html Thanks in advance. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Marcos Douglas
On Sun, Jun 19, 2016 at 3:26 AM, Michalis Kamburelis wrote: > > Hi, > > So, I wrote a document describing (quickly!) many features of the > modern Object Pascal:) > > Read on: > > http://michalis.ii.uni.wroc.pl/~michalis/modern_pascal_introduction/modern_pascal_introduction.html > > http://michali

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Sven Barth
Am 20.06.2016 11:56 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > There's a few places where a native English author would have done things a bit differently. For example, in most places "Castle Game Engine" would probably be prefixed by "the", and also "it allows [something,

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Mark Morgan Lloyd
Michalis Kamburelis wrote: Hi, So, I wrote a document describing (quickly!) many features of the modern Object Pascal:) Read on: http://michalis.ii.uni.wroc.pl/~michalis/modern_pascal_introduction/modern_pascal_introduction.html http://michalis.ii.uni.wroc.pl/~michalis/modern_pascal_introduct

[fpc-pascal] (Unix) file locking

2016-06-20 Thread Mark Morgan Lloyd
I'm approaching a situation where up to four identical processes will be reading and writing the same files. There will be process-level synchronisation which should prevent clashes, but I'd still like to add locking at the file level. I presume that what I should be looking at is Fcntl(F_SetL