Re: [fpc-pascal] FPC with case insensitive file system under Linux

2012-02-28 Thread Sven Barth

Am 28.02.2012 08:38, schrieb Noah Silva:


Windows supports multiple locales and has 95% of the
computer market -


Not really: http://en.wikipedia.org/wiki/Usage_share_of_operating_systems

Anyway, if we did everything the way Microsoft suggested, we would give
up real sym links and litter the filesystem with .lnk files, too.


Modern versions of NTFS support symlinks, too. Also there were reasons 
why Microsoft decided to use .lnk files: 
http://technet.microsoft.com/de-de/magazine/2006.09.windowsconfidential%28en-us%29.aspx


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


Re: [fpc-pascal] FPC with case insensitive file system under Linux

2012-02-28 Thread Noah Silva
Hi Sven,

>From what I've read, the NT kernel (and filesystem) support a lot of things
that Windows in general doesn't.  Presumably this is because it is
(unofficially, of course) loosely based on VMS, but Win32 was originally
designed to work with DOS, etc.

Thank you,
 Noah Silva

2012/2/28 Sven Barth 

> Am 28.02.2012 08:38, schrieb Noah Silva:
>
>
>>Windows supports multiple locales and has 95% of the
>>computer market -
>>
>>
>> Not really: http://en.wikipedia.org/wiki/**Usage_share_of_operating_**
>> systems 
>>
>> Anyway, if we did everything the way Microsoft suggested, we would give
>> up real sym links and litter the filesystem with .lnk files, too.
>>
>
> Modern versions of NTFS support symlinks, too. Also there were reasons why
> Microsoft decided to use .lnk files: http://technet.microsoft.com/**
> de-de/magazine/2006.09.**windowsconfidential%28en-us%**29.aspx
>
> Regards,
> Sven
>
> __**_
> 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] FPC with case insensitive file system under Linux

2012-02-28 Thread Sven Barth

Am 28.02.2012 09:47, schrieb Noah Silva:

Hi Sven,

 From what I've read, the NT kernel (and filesystem) support a lot of
things that Windows in general doesn't.  Presumably this is because it
is (unofficially, of course) loosely based on VMS, but Win32 was
originally designed to work with DOS, etc.


Yes, the NT kernel is definitely much more powerful than the Win32 
subsystem. For example it has a single rooted object based file system 
where other file systems are automatically mounted and you can access 
them through e.g. \Devices\Harddisk0\HarddiskVolume1. Also it supports 
symbolic links in there (the Win32 subsystem uses them internally very 
much). One can explore all those things for example with my Native NT 
port of Free Pascal ;)


The symlink feature I talked about can be used in Vista and newer from 
within the Win32 subsystem as well though.


Regards,
Sven

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


Re: [fpc-pascal] xterm -e program-compiled-with-fpc2.4.0 doesn't work

2012-02-28 Thread Noah Silva
Hi Max,

I haven't used Shell(), and I am sure others can help you there.  However,
I can think of at least two alternatives:
1. Use pexec() directly
2. Use TProcess or TUTF8Process.

 Thank you,
   Noah Silva

2012/2/28 max 

> With the advent of Debian6 fpc 2.4.0-2 has become the only available
> version.
> Before that, it may have been 1.0 ?
> A simple program of mine compiled in 2008 with the old fpc , when started
> with xterm -e program still runs fine today.
> Now. the new compiler warns about SHELL function being deprecated and
> link.res containing output sections but finishes.
> Though the produced binary runs as expexted when run in an xterm, using the
> method of xterm -e program does not [ this is the method of starting the
> program through the X11 twm-menu, which should come up with a new
> xterm-window] :  I only see a short flicker of an xterm-window then
> disapearing; there's no error message.
> Would anyone have an idea what's wrong?
>
> --
> View this message in context:
> http://free-pascal-general.1045716.n5.nabble.com/xterm-e-program-compiled-with-fpc2-4-0-doesn-t-work-tp5519778p5519778.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
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC with case insensitive file system under Linux

2012-02-28 Thread Noah Silva
Hi Sven,

It seems that since NT is the only remaining Windows kernel now that it
might make sense to use NT functions in (for example) the normal SysUtils
library for more efficient implementations - do you think there is any
strong reason not to?

You have to figure there are two layers of thunking going on now:
1. System/SysUtils -> Win32
2. Win32 -> NT.

Does .NET, etc. Actually use the Win32 APIs or NT APIs?
(The runtime, obviously the programs use the .NET API...)

Thank you,
 Noah Silva

2012/2/28 Sven Barth 

> Am 28.02.2012 09:47, schrieb Noah Silva:
>
>  Hi Sven,
>>
>>  From what I've read, the NT kernel (and filesystem) support a lot of
>> things that Windows in general doesn't.  Presumably this is because it
>> is (unofficially, of course) loosely based on VMS, but Win32 was
>> originally designed to work with DOS, etc.
>>
>
> Yes, the NT kernel is definitely much more powerful than the Win32
> subsystem. For example it has a single rooted object based file system
> where other file systems are automatically mounted and you can access them
> through e.g. \Devices\Harddisk0\**HarddiskVolume1. Also it supports
> symbolic links in there (the Win32 subsystem uses them internally very
> much). One can explore all those things for example with my Native NT port
> of Free Pascal ;)
>
> The symlink feature I talked about can be used in Vista and newer from
> within the Win32 subsystem as well though.
>
>
> Regards,
> Sven
>
> __**_
> 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] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-02-28 Thread Sven Barth

Am 28.02.2012 08:22, schrieb Noah Silva:

Well ObjectPascal has been around since the early 90s at least, and from
an end-user point of view, pascal became primarily Object Oriented with
TurboVision and later Delphi in the mid 90s - so anyone who doesn't know
about that is severely misinformed.  I am not sure that changing the
name will make up for that.



To stress this a bit: around two weeks ago I told my "program 
optimization" teacher (who's the head of the "programing languages" 
chair) about Free Pascal (and Delphi) and he didn't know that Pascal 
"already" supports OOP... :(


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


Re: [fpc-pascal] FPC with case insensitive file system under Linux

2012-02-28 Thread Sven Barth

Am 28.02.2012 10:03, schrieb Noah Silva:

Hi Sven,

It seems that since NT is the only remaining Windows kernel now that it
might make sense to use NT functions in (for example) the normal
SysUtils library for more efficient implementations - do you think there
is any strong reason not to?

You have to figure there are two layers of thunking going on now:
1. System/SysUtils -> Win32
2. Win32 -> NT.


The NT API is not documented and I don't think it's worth the hazzle 
(working with an undocumented API) to improve performance a little bit. 
The Win32 API is THE API if you target Windows, so we shouldn't play 
with that. Also it might be that programs that check whether 
applications can be "Windows certified" will check whether the 
application accesses the native API and I don't want to tell a company 
that wants to certificate an application written in FPC that they can't 
do it...



Does .NET, etc. Actually use the Win32 APIs or NT APIs?
(The runtime, obviously the programs use the .NET API...)


.NET is based on top of Win32 so it uses only the Win32 API. The only 
people that officially use the Native API are driver, kernel and 
subsystem developers at Microsoft (and ReactOS).


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


Re: [fpc-pascal] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-02-28 Thread Noa Shiruba
Sven,

Wow, you should buy him a book on Delphi.  I would say on FPC, but the main FPC 
book is only to be had by mail order - I keep hoping they will offer it in 
Kindle format or such.

  -- Noah 

On 2012/02/28, at 18:05, Sven Barth  wrote:

> Am 28.02.2012 08:22, schrieb Noah Silva:
>> Well ObjectPascal has been around since the early 90s at least, and from
>> an end-user point of view, pascal became primarily Object Oriented with
>> TurboVision and later Delphi in the mid 90s - so anyone who doesn't know
>> about that is severely misinformed.  I am not sure that changing the
>> name will make up for that.
>> 
> 
> To stress this a bit: around two weeks ago I told my "program optimization" 
> teacher (who's the head of the "programing languages" chair) about Free 
> Pascal (and Delphi) and he didn't know that Pascal "already" supports OOP... 
> :(
> 
> Regards,
> Sven
> ___
> 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


[fpc-pascal] [admin] FPC with case insensitive file system under Linux

2012-02-28 Thread Jonas Maebe

Hi,

Can everyone please take this topic to the fpc-other list? It has no  
longer anything to do with FPC.


Thanks,


Jonas
FPC mailing lists admin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: OT: Amazing new development tools

2012-02-28 Thread Lukasz Sokol
On 26/02/2012 11:17, Mattias Gaertner wrote:
> On Sun, 26 Feb 2012 11:43:38 +0100 (CET) Michael Van Canneyt
>  wrote:
> 
>> 
>> 
>> On Sun, 26 Feb 2012, Vinzent Höfler wrote:
>> 
>>> On Sat, 25 Feb 2012 19:15:54 +0100, ik
>>>  wrote:
>>> 
 I found the following amazing lecture that present a new idea
 of a development tool, that I think will interest you all:
 
 http://vimeo.com/36579366
>>> 
>>> Impressive, indeed. And I am usually not that easily impressed.
>> 
>> Impressed indeed. But IMHO limited to a certain kind of
>> programming. The binary search part could probably be done for any
>> kind of programming, I suppose.
> 
> I doubt that "any kind of programming". He showed the simplest case:
> a function that only receives base types. But most functions work on
> complex parameters - classes. These need to be set up. Either by
> writing a test environment or by taking a snapshot with the debugger.
> Then you can run the function repeatedly.
> 
> The next step is to "compile" the function on every change. Easy with
> an interpreter. How to compile only one function of a big program and
> insert/replace it?

Sorry for a plug, but MS VC++ 6.0 (!)* allowed for Pause->Edit Code->
Quick compile->Resume Execution kind of workflow...

Yes, in Debug/Pause mode, you COULD write a {code block} and then go
Debug->Apply and Continue (or something like that) and voila,
you could totally change code paths ... 
(Not that I know much about internals/constraints of this, to be honest, 
but of all, i found that a very cool feature)

Is there a way to add THAT to FPC/Lazarus/GDB world ? 

(especially simulation/image/OpenGL Artists would be grateful :) )
> 
> The next step is to run the function and read every value change. 
> Easy in an interpreter. For a compiled program you have to single
> step with the debugger.
> 
> 

Lukasz

* Yes, Microsoft Visual C++ Six Point Zero. Mine (dating from before my times 
where I work now)
is from 1998. *

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


Re: [fpc-pascal] Re: FPC with case insensitive file system under Linux

2012-02-28 Thread Jorge Aldo G. de F. Junior
2012/2/27 Jürgen Hestermann :
> Virgo Pärna schrieb:
>
>>    Essentialy, case insensitive filesystems are less problematic.
>>
>
> No, just the opposite. The  problems are only moved (and increased) from the
> techie level (where it should belong to) to the user.
> This is not a good idea IMO.
> If there problems with capitalization of certain characters exist then these
> problems should be solved or
> if that's not possible for some reason such characters should not be allowed
> in file systems.
>
> But giving it all over to the user and tell him  "We did not know how to
> handle this mess, just try yourself" is not a solution.
>

Isnt that the unix/c philosophy ? "If you dont know how to handle the
problem, pretend the problem doesnt exists..."


>
>
> ___
> 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] Fix & Continue in FPC [was: off-topic discussion)

2012-02-28 Thread Jonas Maebe


On 27 Feb 2012, at 13:32, Lukasz Sokol wrote:


On 26/02/2012 11:17, Mattias Gaertner wrote:

The next step is to "compile" the function on every change. Easy with
an interpreter. How to compile only one function of a big program and
insert/replace it?


Sorry for a plug, but MS VC++ 6.0 (!)* allowed for Pause->Edit Code->
Quick compile->Resume Execution kind of workflow...

Yes, in Debug/Pause mode, you COULD write a {code block} and then go
Debug->Apply and Continue (or something like that) and voila,
you could totally change code paths ...
(Not that I know much about internals/constraints of this, to be  
honest,

but of all, i found that a very cool feature)

Is there a way to add THAT to FPC/Lazarus/GDB world ?


Apple supported that in older versions of their development tools, and  
it worked as well (or as badly) with FPC as it did with GCC. It  
required changes to their dynamic linker (for the code replacement)  
and to GDB. It was extremely flakey and limited though, and they  
abandoned it fairly quickly.


Since the required support is generally not part of the compiler but  
of the environment (you need a way to inject the new code, and  
possibly data, into the process, and link up everything with the new  
version), I don't think this is something that can be added as an  
"FPC" feature.



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


[fpc-pascal] Linking message "...did you forget -T?"

2012-02-28 Thread Graeme Geldenhuys
Hi,

I've been meaning to ask this question since many months ago.  Why do
I get that ". did you forget -T?" whenever I compile any project.
It never used to be there (months ago).

-
...snip...
Compiling ./apps/ide/replacedialogform_mfm.pas
Compiling ./apps/ide/sourcehintform.pas
Compiling ./apps/ide/sourcehintform_mfm.pas
Compiling ./lib/common/regcomponents/regunitgroups.pas
Linking ./mseide.elf
/usr/bin/ld: warning: ./link.res contains output sections; did you forget -T?
442952 lines compiled, 23.9 sec
-


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linking message "...did you forget -T?"

2012-02-28 Thread Sven Barth

Am 28.02.2012 12:06, schrieb Graeme Geldenhuys:

Hi,

I've been meaning to ask this question since many months ago.  Why do
I get that ". did you forget -T?" whenever I compile any project.
It never used to be there (months ago).

-
...snip...
Compiling ./apps/ide/replacedialogform_mfm.pas
Compiling ./apps/ide/sourcehintform.pas
Compiling ./apps/ide/sourcehintform_mfm.pas
Compiling ./lib/common/regcomponents/regunitgroups.pas
Linking ./mseide.elf
/usr/bin/ld: warning: ./link.res contains output sections; did you forget -T?
442952 lines compiled, 23.9 sec
-




http://www.freepascal.org/faq.var#unix-ld219

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


Re: [fpc-pascal] Linking message "...did you forget -T?"

2012-02-28 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> 
> I've been meaning to ask this question since many months ago.  Why do
> I get that ". did you forget -T?" whenever I compile any project.
> It never used to be there (months ago).

http://www.freepascal.org/faq.var#unix-ld219
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linking message "...did you forget -T?"

2012-02-28 Thread Graeme Geldenhuys
On 28 February 2012 13:09, Sven Barth  wrote:
>
> http://www.freepascal.org/faq.var#unix-ld219


OK, so I must just ignore that output then.  Is there no way to hide
that linker output.

PS:
I'm using ld 2.20.1-system.20100303 as supplied by Ubuntu 10.04.4 (64-bit).


Thanks for the info.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-02-28 Thread Graeme Geldenhuys
On 28 February 2012 11:05, Sven Barth wrote:
>
> To stress this a bit: around two weeks ago I told my "program optimization"
> teacher (who's the head of the "programing languages" chair) about Free
> Pascal (and Delphi) and he didn't know that Pascal "already" supports OOP...
> :(

That seems to be the normal response.  There is no hope for us pascal
developers.  :-)



-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-02-28 Thread Graeme Geldenhuys
On 28 February 2012 12:18, Noa Shiruba  wrote:
>
> I would say on FPC, but the main FPC book is only to be had by mail order


Give him a copy of the FPC Language Reference  pdf document.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-02-28 Thread Marcos Douglas
On Tue, Feb 28, 2012 at 12:50 AM, Lars  wrote:
> Frank Church wrote:
>> 5. This requires an increase in the uptake of Pascal. I mean if a language
>> like D can get so much attention and have libraries being created for it
>> why can't Pascal which has been longer established.
>>
>
> Another language to check out is TutorialD by Date and Darwen, a pascal
> like relational database language. Another interesting one which there is
> almost no information about is "Pascal/R" which was a relational pascal
> that died quickly, but I don't know why.
>
>
>> 6.  I guess one major shortcoming of Pascal is it is not immediately
>> identified with objects, like C. Can Free Pascal simply change its name to
>> Object Pascal
>
> Not all of freepascal is object oriented, a lot of it is simple procedural
> and you have the option to use objects if you want. Java and Ruby make the
> grand mistake of making everything an object and forcing you to code in
> objects when you shouldn't have to. C# the ugly java rip off language also
> forces you into objects and classes.  If IntToStr was welded in to some
> object and I had to create an "IntToStr object" before calling IntToStr,
> that would suck major.
>
> What would be nice is some actual innovation in programming languages
> instead of reinventing C++ over and over again.  I think what languages
> need is a relational twist to them. A new data type known as the Table in
> our langauges instead of arrays and records. It is known as a Relvar in
> TutorialD. We use ugly "object relational (o/r) mappers" instead of having
> tables and relvars in our language. Too many people reinvent the database
> using arrays, associative arrays, stringlists, TLists - all this should be
> a database table that you can create easily in your language instead of
> resorting to embedding SQL strings into your program.

Other language that have the Table type is Lua (www.lua.org).
This is an amazing language, very simple, clean and fast.

>> Honestly I think the name is probably the biggest problem if in an era of
>> objects everything it is not associated with Pascal due to its age and
>> past.
>>
>
> Objects everything.. yuck.. I still like simple procedural code for
> teaching people and for doing quick prototypes, I think one of the biggest
> mistakes of the industry is obsession with objects and not enough
> education about relational techniques (http://www.dbdebunk.com)

+1
I agree with this obsession with objects.

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


Re: [fpc-pascal] Linking message "...did you forget -T?"

2012-02-28 Thread Sven Barth

Am 28.02.2012 12:20, schrieb Graeme Geldenhuys:

On 28 February 2012 13:09, Sven Barth  wrote:


http://www.freepascal.org/faq.var#unix-ld219



OK, so I must just ignore that output then.  Is there no way to hide
that linker output.


AFAIK there is no option for that...

Regards,
Sven

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


Re: [fpc-pascal] Re: Class const of array of record.

2012-02-28 Thread Everton Vieira
But is used like one. Why is that so?

2012/2/24 Jonas Maebe 

>
> On 24 Feb 2012, at 18:07, Everton Vieira wrote:
>
> > static; should be a keyword, doesn't?
>
> No, it's not a keyword.
>
>
> Jonas
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



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

Re: [fpc-pascal] Re: Class const of array of record.

2012-02-28 Thread Jonas Maebe


On 28 Feb 2012, at 13:25, Everton Vieira wrote:


2012/2/24 Jonas Maebe 


On 24 Feb 2012, at 18:07, Everton Vieira wrote:


static; should be a keyword, doesn't?


No, it's not a keyword.


But is used like one. Why is that so?


It's not used like one. Keyword means "it's a reserved word by the  
language, and you can never use it for anything other than how it's  
defined by the language". Examples of keywords are "begin" and  
"procedure". Some identifiers are only keywords in certain language  
modes (e.g. try/except/on/finally/raise are only keywords in language  
modes that know about exception handling).


There are other identifiers that can have a special meaning in a  
particular context (such as "cdecl" and "static"), but outside that  
context they behave like any other modifier. Or they may simply be  
types or routines that are part of the system unit. The reason is that  
code written for language dialects that do not treat those identifiers  
as keywords can otherwise not be compiled. To illustrate:


{$mode objfpc}

type
  longint = string;
  cdecl = longint;
  protected = longint;
  varargs = char;
  sin = byte;

var
  stdcall: cdecl;

// note that the final "cdecl;" here does have the "original" meaning  
of cdecl

function static(const inline: protected): varargs; cdecl;
begin
  static:=stdcall[sin(inline[1])];
end;

begin
end.


Jonas

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


Re: [fpc-pascal] Re: Class const of array of record.

2012-02-28 Thread Everton Vieira
I see. I only said so because i thought would became more pretty if his
was bolded like de inline next to him.

2012/2/28 Jonas Maebe 

>
> On 28 Feb 2012, at 13:25, Everton Vieira wrote:
>
>  2012/2/24 Jonas Maebe 
>>
>>  On 24 Feb 2012, at 18:07, Everton Vieira wrote:
>>>
>>>  static; should be a keyword, doesn't?

>>>
>>> No, it's not a keyword.
>>>
>>
>> But is used like one. Why is that so?
>>
>
> It's not used like one. Keyword means "it's a reserved word by the
> language, and you can never use it for anything other than how it's defined
> by the language". Examples of keywords are "begin" and "procedure". Some
> identifiers are only keywords in certain language modes (e.g.
> try/except/on/finally/raise are only keywords in language modes that know
> about exception handling).
>
> There are other identifiers that can have a special meaning in a
> particular context (such as "cdecl" and "static"), but outside that context
> they behave like any other modifier. Or they may simply be types or
> routines that are part of the system unit. The reason is that code written
> for language dialects that do not treat those identifiers as keywords can
> otherwise not be compiled. To illustrate:
>
> {$mode objfpc}
>
> type
>  longint = string;
>  cdecl = longint;
>  protected = longint;
>  varargs = char;
>  sin = byte;
>
> var
>  stdcall: cdecl;
>
> // note that the final "cdecl;" here does have the "original" meaning of
> cdecl
> function static(const inline: protected): varargs; cdecl;
> begin
>  static:=stdcall[sin(inline[1])**];
> end;
>
> begin
> end.
>
>
>
> Jonas
>
> __**_
> fpc-pascal maillist  -  
> fpc-pascal@lists.freepascal.**org
> http://lists.freepascal.org/**mailman/listinfo/fpc-pascal
>



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

Re: [fpc-pascal] Re: Class const of array of record.

2012-02-28 Thread Sven Barth

Am 28.02.2012 14:13, schrieb Everton Vieira:

I see. I only said so because i thought would became more pretty if his
was bolded like de inline next to him.



If this is your problem then you should ask this on the Lazarus list. 
This is a problem of the highlighter not of the compiler.


Note: There was a discussion about this recently already (maybe you even 
read it).


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


Re: [fpc-pascal] Linking message "...did you forget -T?"

2012-02-28 Thread Mark Morgan Lloyd

Sven Barth wrote:

Am 28.02.2012 12:20, schrieb Graeme Geldenhuys:

On 28 February 2012 13:09, Sven Barth  wrote:


http://www.freepascal.org/faq.var#unix-ld219



OK, so I must just ignore that output then.  Is there no way to hide
that linker output.


AFAIK there is no option for that...


| grep -v

:-)

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Fix & Continue in FPC [was: off-topic discussion)

2012-02-28 Thread Lukasz Sokol
On 28/02/2012 10:45, Jonas Maebe wrote:
> 
> On 27 Feb 2012, at 13:32, Lukasz Sokol wrote:
> 
>> On 26/02/2012 11:17, Mattias Gaertner wrote:
>>> The next step is to "compile" the function on every change. Easy
>>> with an interpreter. How to compile only one function of a big
>>> program and insert/replace it?
>> 
>> Sorry for a plug, but MS VC++ 6.0 (!)* allowed for Pause->Edit
>> Code-> Quick compile->Resume Execution kind of workflow...
>> 
>> Yes, in Debug/Pause mode, you COULD write a {code block} and then
>> go Debug->Apply and Continue (or something like that) and voila, 
>> you could totally change code paths ... (Not that I know much about
>> internals/constraints of this, to be honest, but of all, i found
>> that a very cool feature)
>> 
>> Is there a way to add THAT to FPC/Lazarus/GDB world ?
> 
> Apple supported that in older versions of their development tools,
> and it worked as well (or as badly) with FPC as it did with GCC. It
> required changes to their dynamic linker (for the code replacement)
> and to GDB. It was extremely flakey and limited though, and they
> abandoned it fairly quickly.
> 
> Since the required support is generally not part of the compiler but
> of the environment (you need a way to inject the new code, and
> possibly data, into the process, and link up everything with the new
> version), I don't think this is something that can be added as an
> "FPC" feature.
> 
> 
> Jonas 

(Un)fortunately I don't know much about the internals, as I mentioned :)

The closest idea that looks similar is a loadable library: you can unload a dll 
(or a .so), edit/recompile/rebuild it while the caller program is 
paused/waiting,
then reload it (with an obvious constraint that you can't modify the interfaces
that the already-running program knows)
 - now imagine each code/data block is separate 'object' that can be 
loaded/unloaded...?

(Did I just hit on the unmentionable feature of loadable modules :) )

Lukasz

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


Re: [fpc-pascal] Re: Class const of array of record.

2012-02-28 Thread Everton Vieira
Is true, in that case here isn't the place. But nice that why isn't a
keyword is clear now.

2012/2/28 Sven Barth 

> Am 28.02.2012 14:13, schrieb Everton Vieira:
>
>  I see. I only said so because i thought would became more pretty if his
>> was bolded like de inline next to him.
>>
>>
> If this is your problem then you should ask this on the Lazarus list. This
> is a problem of the highlighter not of the compiler.
>
> Note: There was a discussion about this recently already (maybe you even
> read it).
>
> Regards,
> Sven
>
> __**_
> fpc-pascal maillist  -  
> fpc-pascal@lists.freepascal.**org
> http://lists.freepascal.org/**mailman/listinfo/fpc-pascal
>



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

Re: [fpc-pascal] Re: Fix & Continue in FPC [was: off-topic discussion)

2012-02-28 Thread Jonas Maebe


On 28 Feb 2012, at 14:36, Lukasz Sokol wrote:


On 28/02/2012 10:45, Jonas Maebe wrote:


Apple supported that in older versions of their development tools,
and it worked as well (or as badly) with FPC as it did with GCC. It
required changes to their dynamic linker (for the code replacement)
and to GDB. It was extremely flakey and limited though, and they
abandoned it fairly quickly.


(Un)fortunately I don't know much about the internals, as I  
mentioned :)


The closest idea that looks similar is a loadable library: you can  
unload a dll
(or a .so), edit/recompile/rebuild it while the caller program is  
paused/waiting,
then reload it (with an obvious constraint that you can't modify the  
interfaces

that the already-running program knows)
- now imagine each code/data block is separate 'object' that can be  
loaded/unloaded...?


That is basically what Apple did. But if you want to do that at a  
reasonable speed and with support for e.g. existing addresses in  
memory (someone may have taken the address of a routine you are about  
to replace, and if the new code is larger it may get stored somewhere  
else), then you need lots of extra support (e.g. via trampolines for  
code; for data it's even harder). Not to mention that your debugger  
has to be able to deal with code changing addresses all the time and  
debug info changing.


In the end, people spent more time debugging the inconsistencies and  
limitations of "fix and continue" than it helped them. Maybe  
Microsoft's implementation is better, but

a) it is extremely hard to get right
b) as mentioned, it cannot be implemented in FPC itself; it mainly  
requires support from a lot of other things (and if that support is in  
place and requires some help from the compiler, then we can talk about  
making FPC support such an environment)



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

Re: [fpc-pascal] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-02-28 Thread Lukasz Stafiniak
On Tue, Feb 28, 2012 at 8:22 AM, Noah Silva
 wrote:
>
> If you want to convince people to use FPC and are having issues, you should
> ask them what features, exactly, they are looking for.  Chances are that FPC
> has them.  (If they want a functional language, though, then you're out of
> luck).

Pascal is not entirely opposed to being a functional language. There
are two missing language features (consider it a proposal of
Functional Pascal):

(1) A declaration part, that parallels "var", with keyword "val" or
"let" (since "val" is taken up by a procedure). It introduces named
values, i.e. non-assignable variables. The part after "=" can be any
expression. Therefore, this feature spoils the "declaration --
implementation divide" that is dear to Pascal.

(2) Closures. That is, making local functions that only use "const"
arguments and "val / let" variables safe to return from the outer
function. This can be done by allocating the "val / let" data on the
heap, or perhaps easier by copying them into an implicitly built
object and interpreting the returned local function as pointer to
method of this object. The closure-object would be memory-managed as
other objects.

What do you think?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: What is the most widely used Pascal on Linux and other Unix variants?

2012-02-28 Thread Alberto Narduzzi

To stress this a bit: around two weeks ago I told my "program
optimization" teacher (who's the head of the "programing languages"
chair) about Free Pascal (and Delphi) and he didn't know that Pascal
"already" supports OOP... :(


don't be so sad... pass your exams, whatever it takes to, then rethink 
of the whole thing on your own... ;-)

It was exactly the same 20 years ago, when Pascal _already_ supported OOP.

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