[fpc-pascal] Is Nested Procedure Types

2013-11-23 Thread Andrew Brunner

I'm wondering if the is nested procedure type is supposed to work

{$modeswitch nestedprocvars}

Type TMyCallback=procedure(Index:Integer) is nested;

I thought 2.6.0 was supposed to support this but I'm using FPC from 
svn/trunk and it does not.  Any ideas?


see also:
http://wiki.freepascal.org/FPC_New_Features_2.6.0#Support_for_nested_procedure_variables


Thanks,

--
Andrew Brunner

Aurawin LLC
512.850.3117
https://aurawin.com/

Aurawin is a great new way to store, share and enjoy your photos, videos, 
music, and more.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Is Nested Procedure Types

2013-11-23 Thread Jonas Maebe

On 23 Nov 2013, at 15:47, Andrew Brunner wrote:

> I'm wondering if the is nested procedure type is supposed to work
> 
> {$modeswitch nestedprocvars}
> 
> Type TMyCallback=procedure(Index:Integer) is nested;
> 
> I thought 2.6.0 was supposed to support this but I'm using FPC from svn/trunk 
> and it does not.  Any ideas?

It does work, see e.g. 
http://svn.freepascal.org/svn/fpc/trunk/tests/test/tmaclocalprocparam2d.pp


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Cross Compile : treefilteredit.pas(60, 60) Error: Illegal expression

2013-11-23 Thread Osvaldo Filho
Environment:
Ubuntu 13.10 64bits
FPC 2.6.3 - Rev 26119
Lazarus 1.2RC - Rev 43472

When i try compile for i386, i get this:

Free Pascal Compiler version 2.6.3 [2013/11/23] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling lazcontrols.pas
Compiling dividerbevel.pas
dividerbevel.pas(52,31) Hint: Parameter "WithThemeSpace" not used
Compiling extendednotebook.pas
Compiling listfilteredit.pas




*Compiling treefilteredit.pastreefilteredit.pas(60,60) Error: Illegal
expressiontreefilteredit.pas(60,60) Error: Error in type
definitiontreefilteredit.pas(60,60) Fatal: Syntax error, ">" expected but
"" foundFatal: Compilation aborted*
Error: /home/deskx/Aplicativos/fpclaz/bin/ppc386 returned an error exitcode
(normal if you did not specify a source file to be compiled)
make[1]: ** [lazcontrols.ppu] Erro 1
make[1]: Saindo do diretório
`/home/deskx/Documentos/Desenvolvimento/pascal/svn/ex/laz1.2rc32/components/lazcontrols'
make: ** [lazbuild] Erro 2


Any help?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Is Nested Procedure Types

2013-11-23 Thread Andrew Brunner
Ok, I had a test program that used a few other units.  Apparently this 
had to be placed at the top of my units that used and implemented the 
nested callback type.


{$mode objfpc}
{$modeswitch nestedprocvars}


The last question I have is when can I expect to use nested procedure 
variables system wide without compiler directives?  What's the hold-up 
or reason why the mode is even needed?


Thanks again,

On 11/23/2013 09:43 AM, Jonas Maebe wrote:

On 23 Nov 2013, at 15:47, Andrew Brunner wrote:


I'm wondering if the is nested procedure type is supposed to work

{$modeswitch nestedprocvars}

Type TMyCallback=procedure(Index:Integer) is nested;

I thought 2.6.0 was supposed to support this but I'm using FPC from svn/trunk 
and it does not.  Any ideas?

It does work, see e.g. 
http://svn.freepascal.org/svn/fpc/trunk/tests/test/tmaclocalprocparam2d.pp


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is Nested Procedure Types

2013-11-23 Thread Jonas Maebe

On 23 Nov 2013, at 17:29, Andrew Brunner wrote:

> Ok, I had a test program that used a few other units.  Apparently this had to 
> be placed at the top of my units that used and implemented the nested 
> callback type.
> 
> {$mode objfpc}
> {$modeswitch nestedprocvars}

If you turn on warnings, you'll see that the compiler tells you that global 
switches must appear before any statements.

> The last question I have is when can I expect to use nested procedure 
> variables system wide without compiler directives?  What's the hold-up or 
> reason why the mode is even needed?

They are only enabled by default in macpas mode and ISO because traditional 
Macintosh Pascal and ISO Pascal compilers are the only ones that supported them 
by default (albeit not via the "is nested" syntax). They'll probably never be 
enabled by default in any other mode. The reason is simply that there is no 
need to do so.


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is Nested Procedure Types

2013-11-23 Thread Sven Barth

On 23.11.2013 17:29, Andrew Brunner wrote:

The last question I have is when can I expect to use nested procedure
variables system wide without compiler directives?  What's the hold-up
or reason why the mode is even needed?


Same reason why advanced records are disabled by default and why also 
type helpers will require a modeswitch in the future (before 2.8.0 is 
branched): to keep the objfpc mode clean.


Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Cross Compile : treefilteredit.pas(60, 60) Error: Illegal expression

2013-11-23 Thread leledumbo
Please include the respective line. In my trunk source, it's a valid generic
specialization. That point has > as closing bracket of generic type name.
Either your compiler is buggy or you accidentally change the source.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Cross-Compile-treefilteredit-pas-60-60-Error-Illegal-expression-tp5717560p5717564.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal