Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Sven Barth
Am 06.02.2017 02:37 schrieb "Ryan Joseph" : > > I tried class functions in records already but I got the error "Class methods must be static in records”. Not sure what that means but I assumed they don’t work either. You need to add the "static" modifier to the method. Class functions in records c

fpc-pascal@lists.freepascal.org

2017-02-05 Thread Michael Van Canneyt
On Sun, 5 Feb 2017, Jürgen Hestermann wrote: Am 2017-02-05 um 20:26 schrieb Sven Barth: > Is that a valid identifier? > Here > http://wiki.lazarus.freepascal.org/Identifiers > it says: > Rules for identifiers: > Must begin with a letter from the English alphabet or an underscore (_). > Can b

Re: [fpc-pascal] A jit tool for command line compilation of Pascal?

2017-02-05 Thread Stuart Cox
Yes, thanks. Couldn't seem to track it down. On 2017-02-05 5:57 PM, Dmitry Boyarintsev wrote: InstantFPC ? http://wiki.freepascal.org/InstantFPC thanks, Dmitry On Sun, Feb 5, 2017 at 8:31 PM, Stuart Cox > wrote: Several years ago I seem to remember using a FPC

Re: [fpc-pascal] A jit tool for command line compilation of Pascal?

2017-02-05 Thread Dmitry Boyarintsev
InstantFPC ? http://wiki.freepascal.org/InstantFPC thanks, Dmitry On Sun, Feb 5, 2017 at 8:31 PM, Stuart Cox wrote: > Several years ago I seem to remember using a FPC tool that allowed me to > write Pascal code and have its source file loaded, compiled and executed at > the command line. If I

[fpc-pascal] A jit tool for command line compilation of Pascal?

2017-02-05 Thread Stuart Cox
Several years ago I seem to remember using a FPC tool that allowed me to write Pascal code and have its source file loaded, compiled and executed at the command line. If I remember correctly, it kept access to the environment that it was being executed immediately under and so was like a Pascal

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Ryan Joseph
I tried class functions in records already but I got the error "Class methods must be static in records”. Not sure what that means but I assumed they don’t work either. Too bad, that would be a nice feature. > On Feb 6, 2017, at 2:29 AM, Sven Barth wrote: > > Oh, well, it was worth a shot...

fpc-pascal@lists.freepascal.org

2017-02-05 Thread Jürgen Hestermann
Am 2017-02-05 um 20:26 schrieb Sven Barth: > Is that a valid identifier? > Here > http://wiki.lazarus.freepascal.org/Identifiers > it says: > Rules for identifiers: > Must begin with a letter from the English alphabet or an underscore (_). > Can be followed by alphanumeric characters (alphabetic

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Sven Barth
Am 05.02.2017 15:04 schrieb "Ryan Joseph" : > > I never knew Pascal had default parameters, a feature I always use and enjoy in PHP. Once again I learn something new about the language I use. :) I suggest you to read through the language reference guide then ;) > However, the constructor with def

fpc-pascal@lists.freepascal.org

2017-02-05 Thread Sven Barth
Am 05.02.2017 15:53 schrieb "Jürgen Hestermann" : > > > > Am 2017-02-05 um 15:24 schrieb Howard Page-Clark: >> >> var >> &begin: boolean; > > > Is that a valid identifier? > Here > http://wiki.lazarus.freepascal.org/Identifiers > it says: > > Rules for identifiers: > > Must begin with a letter fr

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Maciej Izak
2017-02-05 14:34 GMT+01:00 Ryan Joseph : > However, the constructor with default params does not work. I get the same > error as before. {$modeswitch advancedrecords} is on. > > type > MyRecord = record > x: integer; > constructor Foo (_x: integer = 0); >

fpc-pascal@lists.freepascal.org

2017-02-05 Thread Mattias Gaertner
On Sun, 5 Feb 2017 14:24:46 + Howard Page-Clark wrote: > Consider this program, which returns False: > > program Project1; > > uses sysutils; > > var >&begin: boolean; > > begin >&begin:=IsValidIdent('&begin'); >WriteLn('IsValidIdent(''&begin'') evaluates to ', &begin); > end.

fpc-pascal@lists.freepascal.org

2017-02-05 Thread Jürgen Hestermann
Am 2017-02-05 um 15:24 schrieb Howard Page-Clark: var &begin: boolean; Is that a valid identifier? Here http://wiki.lazarus.freepascal.org/Identifiers it says: Rules for identifiers: * Must begin with a letter from the English alphabet or an underscore (_). * Can be followed by alphanum

fpc-pascal@lists.freepascal.org

2017-02-05 Thread Howard Page-Clark
Consider this program, which returns False: program Project1; uses sysutils; var &begin: boolean; begin &begin:=IsValidIdent('&begin'); WriteLn('IsValidIdent(''&begin'') evaluates to ', &begin); end. Should sysutils.IsValidIdent() be updated to return True in this case? ___

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Ryan Joseph
I never knew Pascal had default parameters, a feature I always use and enjoy in PHP. Once again I learn something new about the language I use. :) However, the constructor with default params does not work. I get the same error as before. {$modeswitch advancedrecords} is on. type MyReco

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Sven Barth
Am 05.02.2017 09:39 schrieb "Ryan Joseph" : > > > > On Feb 5, 2017, at 3:27 PM, Sven Barth wrote: > > > > constructor with a default parameter. > > How? never heard of this. Thanks. See here at the bottom: http://freepascal.org/docs-html/current/ref/refsu65.html#x176-19800014.4.1 (it's the same f

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Ryan Joseph
> On Feb 5, 2017, at 3:27 PM, Sven Barth wrote: > > constructor with a default parameter. How? never heard of this. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Sven Barth
Am 05.02.2017 09:13 schrieb "Ryan Joseph" : > > Why is this restriction in place and what are the alternatives if any? Some times I want to just provide a method that sets default values for a record without any parameters but FPC doesn’t let me for some reason. Delphi compatibility. As a workarou

[fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Ryan Joseph
Why is this restriction in place and what are the alternatives if any? Some times I want to just provide a method that sets default values for a record without any parameters but FPC doesn’t let me for some reason. Regards, Ryan Joseph ___ fpc