[fpc-pascal] a proposal about with syntax

2013-03-16 Thread Xiangrong Fang
Suppose I have the following class:

type
  TMyClass = class
  public
property Caption: string read FCaption write FCaption;
property Items[Index: Integer]: string read GetItem write SetItem;
default;
function Count: Integer;
  end;

I would like to do this:

with MyClassInstance as mci, SomethingElse do begin
  Caption := 'A new caption';
  for i := 0 to Count - 1 do
mci[i] := UpperCase(mci[i]);
end;

That is, to add an optional as clause to the with statement so that
access array element in a structure is made easier.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

2013-03-16 Thread Rainer Stratmann
May be you can use STM32F...

That works for me with FPC.
http://j-software.dk/stm32f103.php

Am Saturday 16 March 2013 03:13:52 schrieb Justin Smyth:
 I'm using a LPC 1343 Microcontroller unit from waveshare, basically its a
 Cortex M3.

 the link for the board is -
 http://www.wvshare.com/product/Open1343-Package-A.htm

 I've now got STLInk V2 debugging kit , i want to debug this board in
 lazarus


 KInd Regards

 Justin

 -Original Message-
 From: Rainer Stratmann
 Sent: Saturday, March 16, 2013 6:28 AM
 To: FPC-Pascal users discussions
 Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

 What kind of controller?
 Atmel AVR 8 bit?
 ARM 32 bit?

 For AVR it works good.

 Am Friday 15 March 2013 13:29:48 schrieb Justin Smyth:
  I've tried to use mikropascal and not had any luck , i emailed them my
  board i was going to use with the product and they said they didnt
  support it.

 may be in the future...

  I've now got a ST Link V2 for the debugging , if someone could give me an
  idea how to set it up  , i would be great full.
 
  Kind Regards
 
 
  Justin Smyth
 
  -Original Message-
  From: Rainer Stratmann
  Sent: Friday, March 15, 2013 9:30 PM
  To: FPC-Pascal users discussions
  Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms
 
  Am Friday 15 March 2013 10:40:15 schrieb Roberto P.:
   2013/3/15 Rainer Stratmann rainerstratm...@t-online.de
  
For 32 bit ARM I would try to use freepascal.
I got it work somehow.
  
   any tip or guide would be appreciated, then.
 
  For me that is not easy. Most of the time I get it work somehow and
  shortly
  after I did not realize why ... :-)
  I have suggestions to make something easier, but I am always facing
  excuses
  why it is good as it is, so I less take part of this type of discussions
  which are exhausting for me.
 
 I'm just a little afraid of the potentially limited maturity of
 these.
   
What do you mean exactly with that?
  
   I mean that (maybe) both FPC and mikroePascal are young products for
   the embedded world, so that I might be facing compiler or  library
   propblems during the devlopment, besides my own project problems.
 
  May be mikroe is not providing the sourcecode (I am not sure), but they
  have for nearly everything a solution. Ethernet, FAT, SPI, SD-Card, USB,
  HTTP, TCP, etc...
  There were problems in the past, but because they are (heavily) busy with
  that
  stuff they solve most of the important problems. And I think they are
  honest.
  ___
  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 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 maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

2013-03-16 Thread Justin Smyth
I've had a quick read of http://j-software.dk/stm32f103.php , for the fpc 
part i kinda get what to do ,


i want to be able to debug code on the fly as in when its running on my 
board using the STLINK V2... so i assume i would have to setup lazarus gdb 
to do this , is this correct ? if so how.


-Original Message- 
From: Rainer Stratmann

Sent: Saturday, March 16, 2013 7:15 PM
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

May be you can use STM32F...

That works for me with FPC.
http://j-software.dk/stm32f103.php

Am Saturday 16 March 2013 03:13:52 schrieb Justin Smyth:

I'm using a LPC 1343 Microcontroller unit from waveshare, basically its a
Cortex M3.

the link for the board is -
http://www.wvshare.com/product/Open1343-Package-A.htm

I've now got STLInk V2 debugging kit , i want to debug this board in
lazarus


KInd Regards

Justin

-Original Message-
From: Rainer Stratmann
Sent: Saturday, March 16, 2013 6:28 AM
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

What kind of controller?
Atmel AVR 8 bit?
ARM 32 bit?

For AVR it works good.

Am Friday 15 March 2013 13:29:48 schrieb Justin Smyth:
 I've tried to use mikropascal and not had any luck , i emailed them my
 board i was going to use with the product and they said they didnt
 support it.

may be in the future...

 I've now got a ST Link V2 for the debugging , if someone could give me 
 an

 idea how to set it up  , i would be great full.

 Kind Regards


 Justin Smyth

 -Original Message-
 From: Rainer Stratmann
 Sent: Friday, March 15, 2013 9:30 PM
 To: FPC-Pascal users discussions
 Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

 Am Friday 15 March 2013 10:40:15 schrieb Roberto P.:
  2013/3/15 Rainer Stratmann rainerstratm...@t-online.de
 
   For 32 bit ARM I would try to use freepascal.
   I got it work somehow.
 
  any tip or guide would be appreciated, then.

 For me that is not easy. Most of the time I get it work somehow and
 shortly
 after I did not realize why ... :-)
 I have suggestions to make something easier, but I am always facing
 excuses
 why it is good as it is, so I less take part of this type of discussions
 which are exhausting for me.

I'm just a little afraid of the potentially limited maturity of
these.
  
   What do you mean exactly with that?
 
  I mean that (maybe) both FPC and mikroePascal are young products for
  the embedded world, so that I might be facing compiler or  library
  propblems during the devlopment, besides my own project problems.

 May be mikroe is not providing the sourcecode (I am not sure), but they
 have for nearly everything a solution. Ethernet, FAT, SPI, SD-Card, USB,
 HTTP, TCP, etc...
 There were problems in the past, but because they are (heavily) busy 
 with

 that
 stuff they solve most of the important problems. And I think they are
 honest.
 ___
 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 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 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] a proposal about with syntax

2013-03-16 Thread Sven Barth
Am 16.03.2013 07:14 schrieb Xiangrong Fang xrf...@gmail.com:

 Suppose I have the following class:

 type
   TMyClass = class
   public
 property Caption: string read FCaption write FCaption;
 property Items[Index: Integer]: string read GetItem write SetItem;
default;
 function Count: Integer;
   end;

 I would like to do this:

 with MyClassInstance as mci, SomethingElse do begin
   Caption := 'A new caption';
   for i := 0 to Count - 1 do
 mci[i] := UpperCase(mci[i]);
 end;

 That is, to add an optional as clause to the with statement so that
access array element in a structure is made easier.

This was already requested multiple times and also reported on the
bugtracker... Nevertheless in your specific case you can just use
Items[i] instead of mci[i].

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

Re: [fpc-pascal] FreeBSD failure compiling fpdoc 2.7.1

2013-03-16 Thread Graeme Geldenhuys
On 2013-03-15 16:40, Pierre Free Pascal wrote:
 
 So often I end up with
   BASE_271_DIR/lib/fpc/2.7.1
 but also
   BASE_271_DIR/lib/fpc/2.6.0
 which contains the newly installed linraries...


No, that is not the case. I only have a lib/fpc/2.7.1/ directory tree.
My build script was posted in my earlier message. I have used that same
script since about FPC 2.4.0


   A good solution to avoid it is to put
 your trunk compiler binary in the path before the release
 compiler.

I explicit specify the compiler and install prefix to avoid such issues.
This has worked for many years. It seems it might be a fpmake issue to
me. Everything is done correctly, except the lib*.a files are not copied
to the INSTALL_PREFIX path.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

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


Re: [fpc-pascal] FreeBSD failure compiling fpdoc 2.7.1

2013-03-16 Thread Graeme Geldenhuys
On 2013-03-15 18:08, Marco van de Voort wrote:
 
 You install using the bootstrap compiler, not the generated one.

OK, I changed the 'gmake install' in my scrip to use the generated
compiler. It made no difference.



 my script:

I used your script (nice by the way), and it produced the exact same
results as mine. No lib*.a files in the INSTALL_PREFIX directory tree.

I'm using FreeBSD 9.1 64-bit

My starting compiler is FPC 2.6.2 (installed from binary release).


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

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


RE: [fpc-pascal] [OT] Pascal compiler for embedded platforms

2013-03-16 Thread Justin Smyth
Arm cortex m3 lpc 1343
32 bit
Board from wave share

-Original Message-
From: Rainer Stratmann rainerstratm...@t-online.de
Sent: ‎16/‎03/‎2013 6:28 AM
To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

What kind of controller? 
Atmel AVR 8 bit?
ARM 32 bit?

For AVR it works good.

Am Friday 15 March 2013 13:29:48 schrieb Justin Smyth:
 I've tried to use mikropascal and not had any luck , i emailed them my
 board i was going to use with the product and they said they didnt support
 it.
may be in the future...


 I've now got a ST Link V2 for the debugging , if someone could give me an
 idea how to set it up  , i would be great full.

 Kind Regards


 Justin Smyth

 -Original Message-
 From: Rainer Stratmann
 Sent: Friday, March 15, 2013 9:30 PM
 To: FPC-Pascal users discussions
 Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

 Am Friday 15 March 2013 10:40:15 schrieb Roberto P.:
  2013/3/15 Rainer Stratmann rainerstratm...@t-online.de
 
   For 32 bit ARM I would try to use freepascal.
   I got it work somehow.
 
  any tip or guide would be appreciated, then.

 For me that is not easy. Most of the time I get it work somehow and shortly
 after I did not realize why ... :-)
 I have suggestions to make something easier, but I am always facing excuses
 why it is good as it is, so I less take part of this type of discussions
 which are exhausting for me.

I'm just a little afraid of the potentially limited maturity of
these.
  
   What do you mean exactly with that?
 
  I mean that (maybe) both FPC and mikroePascal are young products for the
  embedded world, so that I might be facing compiler or  library propblems
  during the devlopment, besides my own project problems.

 May be mikroe is not providing the sourcecode (I am not sure), but they
 have for nearly everything a solution. Ethernet, FAT, SPI, SD-Card, USB,
 HTTP, TCP, etc...
 There were problems in the past, but because they are (heavily) busy with
 that
 stuff they solve most of the important problems. And I think they are
 honest.
 ___
 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 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] a proposal about with syntax

2013-03-16 Thread Xiangrong Fang
In my example, you can use Items[], but in my real project it is a record with 


发送自魅族MX

 原始邮件 
发件人:Sven Barth pascaldra...@googlemail.com
时间:3月16日 17:12 周六
收件人:FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
主题:Re: [fpc-pascal] a proposal about with syntax

Am 16.03.2013 07:14 schrieb Xiangrong Fang xrf...@gmail.com:

 Suppose I have the following class:

 type
   TMyClass = class
   public
 property Caption: string read FCaption write FCaption;
 property Items[Index: Integer]: string read GetItem write SetItem;
default;
 function Count: Integer;
   end;

 I would like to do this:

 with MyClassInstance as mci, SomethingElse do begin
   Caption := 'A new caption';
   for i := 0 to Count - 1 do
 mci[i] := UpperCase(mci[i]);
 end;

 That is, to add an optional as clause to the with statement so that
access array element in a structure is made easier.

This was already requested multiple times and also reported on the
bugtracker... Nevertheless in your specific case you can just use
Items[i] instead of mci[i].

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] [OT] Pascal compiler for embedded platforms

2013-03-16 Thread Michael Ring

Those two links may help:

The first article references the 2nd:

http://www.eevblog.com/forum/beginners/help-on-arm-cortex-m3-development-tools-ide/20/?wap2

https://github.com/mossmann/hackrf/wiki/LPC43xx-Debugging

Michael

Am 16.03.13 03:13, schrieb Justin Smyth:
I'm using a LPC 1343 Microcontroller unit from waveshare, basically 
its a Cortex M3.


the link for the board is - 
http://www.wvshare.com/product/Open1343-Package-A.htm


I've now got STLInk V2 debugging kit , i want to debug this board in 
lazarus



KInd Regards

Justin

-Original Message- From: Rainer Stratmann
Sent: Saturday, March 16, 2013 6:28 AM
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

What kind of controller?
Atmel AVR 8 bit?
ARM 32 bit?

For AVR it works good.

Am Friday 15 March 2013 13:29:48 schrieb Justin Smyth:

I've tried to use mikropascal and not had any luck , i emailed them my
board i was going to use with the product and they said they didnt 
support

it.

may be in the future...



I've now got a ST Link V2 for the debugging , if someone could give 
me an

idea how to set it up  , i would be great full.

Kind Regards


Justin Smyth

-Original Message-
From: Rainer Stratmann
Sent: Friday, March 15, 2013 9:30 PM
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

Am Friday 15 March 2013 10:40:15 schrieb Roberto P.:
 2013/3/15 Rainer Stratmann rainerstratm...@t-online.de

  For 32 bit ARM I would try to use freepascal.
  I got it work somehow.

 any tip or guide would be appreciated, then.

For me that is not easy. Most of the time I get it work somehow and 
shortly

after I did not realize why ... :-)
I have suggestions to make something easier, but I am always facing 
excuses

why it is good as it is, so I less take part of this type of discussions
which are exhausting for me.

   I'm just a little afraid of the potentially limited maturity of
   these.
 
  What do you mean exactly with that?

 I mean that (maybe) both FPC and mikroePascal are young products 
for the
 embedded world, so that I might be facing compiler or library 
propblems

 during the devlopment, besides my own project problems.

May be mikroe is not providing the sourcecode (I am not sure), but they
have for nearly everything a solution. Ethernet, FAT, SPI, SD-Card, USB,
HTTP, TCP, etc...
There were problems in the past, but because they are (heavily) busy 
with

that
stuff they solve most of the important problems. And I think they are
honest.
___
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 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 maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] a proposal about with syntax

2013-03-16 Thread Xiangrong Fang
Sorry, the email was interrupted, but sent by the phone in background...

So the decision of this feature is that it is not worth to add, right?

Thanks.



2013/3/16 Xiangrong Fang xrf...@gmail.com

 In my example, you can use Items[], but in my real project it is a record
 with


 发送自魅族MX

  原始邮件 
 发件人:Sven Barth pascaldra...@googlemail.com
 时间:3月16日 17:12 周六
 收件人:FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
 主题:Re: [fpc-pascal] a proposal about with syntax


 Am 16.03.2013 07:14 schrieb Xiangrong Fang xrf...@gmail.com:
 
  Suppose I have the following class:
 
  type
TMyClass = class
public
  property Caption: string read FCaption write FCaption;
  property Items[Index: Integer]: string read GetItem write SetItem;
 default;
  function Count: Integer;
end;
 
  I would like to do this:
 
  with MyClassInstance as mci, SomethingElse do begin
Caption := 'A new caption';
for i := 0 to Count - 1 do
  mci[i] := UpperCase(mci[i]);
  end;
 
  That is, to add an optional as clause to the with statement so that
 access array element in a structure is made easier.

 This was already requested multiple times and also reported on the
 bugtracker... Nevertheless in your specific case you can just use
 Items[i] instead of mci[i].

 Regards,
 Sven

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

Re: [fpc-pascal] Re: fcl-xml

2013-03-16 Thread dev . dliw
Hi,
 If you need xpath, you might also want to look at my Internet Tools (
 (http://benibela.de/sources_en.html#internettools), they contain a basically
 complete XPath 2 implementation

I already implemented all I need with fcl-xml, but thanks for the hint anyway. 
:)

d.l.i.w

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


[fpc-pascal] fpcup for FreeBSD

2013-03-16 Thread Reinier Olislagers
(Cross posted: FPC+Laz lists)

Hi all,

I've updated the fpcup automatic FPC+Laz installer from svn for FreeBSD.

Tested on PC BSD, (similar to FreeBSD 9 x64 but with built in x11).

A quick test showed a clean box with just fpcup will install Laz
trunk+FPC fixes_2.6 well. Of course fpcup can be adjusted to get FPC
trunk etc.

Source code as usual at
https://bitbucket.org/reiniero/fpcup

Download for x64 FreeBSD via
https://bitbucket.org/reiniero/fpcup/downloads

General changes in the dev version:
- apart from svn download support, I've added mercurial and git support.
(@Graeme: fpcup can download the new tiopf repo but will probably need
to switch branches for it to be useful)
- fpcup can now create the Lazarus setup.exe if you are on windows (or
presumably wine) if you have the Inno Setup Compiler installed. Thanks
to Martin Friebe for improving the Laz build batch scripts which made
this possible!

As usual, Ludo Brands  I would appreciate comments, patches, as well as
in this case an x86 build ;)


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


[fpc-pascal] test

2013-03-16 Thread patspiper

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


Re: [fpc-pascal] a proposal about with syntax

2013-03-16 Thread 印場 乃亜
Hi,

I also think this would be useful, but for other reasons, often times I end up 
with code like the following:

With BigLongThingIDontWantToWriteOutEverySingleTime do
  begin
 Height := 100;
 Width := 200;
...
 SomeOtherObject.Submit(BigLongThingIDontWantToWriteOutEverySingleTime);
  end;

Notice how I have to write the long thing out again at the bottom.  There must 
be a way around that (Something like Self, but that refers to whatever you 
are using in With).  In Xiangrong's example, this could be mci, but even it it 
was a static name it would be useful.  (If this exists and I am just not aware, 
please let me know!)

Thank you,
   Noah Silva

On 2013/03/16, at 15:13, Xiangrong Fang xrf...@gmail.com wrote:

 Suppose I have the following class:
 
 type
   TMyClass = class
   public
 property Caption: string read FCaption write FCaption;
 property Items[Index: Integer]: string read GetItem write SetItem; 
 default;
 function Count: Integer;
   end;
 
 I would like to do this:
 
 with MyClassInstance as mci, SomethingElse do begin
   Caption := 'A new caption';
   for i := 0 to Count - 1 do
 mci[i] := UpperCase(mci[i]);
 end;
 
 That is, to add an optional as clause to the with statement so that access 
 array element in a structure is made easier.
 ___
 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] a proposal about with syntax

2013-03-16 Thread Daniel Gaspary
On Sat, Mar 16, 2013 at 3:02 PM, 印場 乃亜 shir...@galapagossoftware.com wrote:
 With BigLongThingIDontWantToWriteOutEverySingleTime do
   begin
  Height := 100;
  Width := 200;
 ...
  SomeOtherObject.Submit(BigLongThingIDontWantToWriteOutEverySingleTime);
   end;

 Notice how I have to write the long thing out again at the bottom.  There
 must be a way around that (Something like Self, but that refers to
 whatever you are using in With).

You can use a Class Helper:

http://pastebin.com/pFL49byh

But you gonna need to use a type cast. And with a SomethingElse at
the with, as showed by Xiangrong, things can become messy.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE: [fpc-pascal] [OT] Pascal compiler for embedded platforms

2013-03-16 Thread Justin Smyth
I have downloaded openocd and will install it and setup the gdb side of it. 

Not sure when could be today or tomorrow 

-Original Message-
From: Michael Ring m...@michael-ring.org
Sent: ‎17/‎03/‎2013 1:09 AM
To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

Those two links may help:

The first article references the 2nd:

http://www.eevblog.com/forum/beginners/help-on-arm-cortex-m3-development-tools-ide/20/?wap2

https://github.com/mossmann/hackrf/wiki/LPC43xx-Debugging

Michael

Am 16.03.13 03:13, schrieb Justin Smyth:
 I'm using a LPC 1343 Microcontroller unit from waveshare, basically 
 its a Cortex M3.

 the link for the board is - 
 http://www.wvshare.com/product/Open1343-Package-A.htm

 I've now got STLInk V2 debugging kit , i want to debug this board in 
 lazarus


 KInd Regards

 Justin

 -Original Message- From: Rainer Stratmann
 Sent: Saturday, March 16, 2013 6:28 AM
 To: FPC-Pascal users discussions
 Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

 What kind of controller?
 Atmel AVR 8 bit?
 ARM 32 bit?

 For AVR it works good.

 Am Friday 15 March 2013 13:29:48 schrieb Justin Smyth:
 I've tried to use mikropascal and not had any luck , i emailed them my
 board i was going to use with the product and they said they didnt 
 support
 it.
 may be in the future...


 I've now got a ST Link V2 for the debugging , if someone could give 
 me an
 idea how to set it up  , i would be great full.

 Kind Regards


 Justin Smyth

 -Original Message-
 From: Rainer Stratmann
 Sent: Friday, March 15, 2013 9:30 PM
 To: FPC-Pascal users discussions
 Subject: Re: [fpc-pascal] [OT] Pascal compiler for embedded platforms

 Am Friday 15 March 2013 10:40:15 schrieb Roberto P.:
  2013/3/15 Rainer Stratmann rainerstratm...@t-online.de
 
   For 32 bit ARM I would try to use freepascal.
   I got it work somehow.
 
  any tip or guide would be appreciated, then.

 For me that is not easy. Most of the time I get it work somehow and 
 shortly
 after I did not realize why ... :-)
 I have suggestions to make something easier, but I am always facing 
 excuses
 why it is good as it is, so I less take part of this type of discussions
 which are exhausting for me.

I'm just a little afraid of the potentially limited maturity of
these.
  
   What do you mean exactly with that?
 
  I mean that (maybe) both FPC and mikroePascal are young products 
 for the
  embedded world, so that I might be facing compiler or library 
 propblems
  during the devlopment, besides my own project problems.

 May be mikroe is not providing the sourcecode (I am not sure), but they
 have for nearly everything a solution. Ethernet, FAT, SPI, SD-Card, USB,
 HTTP, TCP, etc...
 There were problems in the past, but because they are (heavily) busy 
 with
 that
 stuff they solve most of the important problems. And I think they are
 honest.
 ___
 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 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 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] a proposal about with syntax

2013-03-16 Thread Xiangrong Fang
shiruba shir...@galapagossoftware.com's example is better than mine, and
was exactly the reason I posted this suggestion.

I don't think a class helper is worth for this stuff, if I need to write a
helper I would rather do this:

longobj := BigLongThingIDontWantToWriteOutEverySingleTime;
With longobj do begin
  Height := 100;
  Width := 200;
  ...
  SomeOtherObject.Submit(longobj);
end;

That's not elegant, but it is really not worth for a helper in this case,
IMHO.  with itself is a convenience syntax anyway, why adding an as to
make it more convenient a bad idea?  I don't know what's make it complex if
there are 2 or more subject in the with?


2013/3/17 Daniel Gaspary dgasp...@gmail.com

 On Sat, Mar 16, 2013 at 3:02 PM, 印場 乃亜 shir...@galapagossoftware.com
 wrote:
  With BigLongThingIDontWantToWriteOutEverySingleTime do
begin
   Height := 100;
   Width := 200;
  ...
 
  SomeOtherObject.Submit(BigLongThingIDontWantToWriteOutEverySingleTime);
end;
 
  Notice how I have to write the long thing out again at the bottom.  There
  must be a way around that (Something like Self, but that refers to
  whatever you are using in With).

 You can use a Class Helper:

 http://pastebin.com/pFL49byh

 But you gonna need to use a type cast. And with a SomethingElse at
 the with, as showed by Xiangrong, things can become messy.

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

Re: [fpc-pascal] a proposal about with syntax

2013-03-16 Thread Daniel Gaspary
On Sat, Mar 16, 2013 at 7:55 PM, Xiangrong Fang xrf...@gmail.com wrote:
 I don't think a class helper is worth for this stuff, if I need to write a
 helper I would rather do this:

I am not sure that I understand your point.

The Class helper was a way to show how it's possible. And with that
helper, ALL objects could use it's method. You could use it as
library.

 why adding an as to make it more convenient a bad idea?

I don't mean that. The Type cast is necessary in my solution, just that.

  I don't know what's make it complex if there are 2 or more subject in the 
 with?

Context. A conflict case the two object were of the same class.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] a proposal about with syntax

2013-03-16 Thread Xiangrong Fang

   I don't know what's make it complex if there are 2 or more subject in
 the with?

 Context. A conflict case the two object were of the same class.


Are you saying this case:

with MyClassInstance1 as m, MyClassInstance2 do begin
  m.Property1 := 123;
  Property2 := 456;
end;

Here you don't know Property2 belongs to which object instance??  If so,
this is not a problem at all, because even without as you still cannot
distinguish, so the compiler should deny this kind of usage anyway,
however, with as, you can do this:

with MyClassInstance1 as m1, MyClassInstance2 as m2 do begin
  m1.Property1 := 123;
  m2.Property2 := 456;
end;

To summarize, as does NOT try to eliminate context ambiguity (also it
won't make a clear context ambiguous), but provided some convenience when
needed.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] a proposal about with syntax

2013-03-16 Thread Flávio Etrusco
On Sat, Mar 16, 2013 at 10:14 PM, Xiangrong Fang xrf...@gmail.com wrote:
   I don't know what's make it complex if there are 2 or more subject in
  the with?

 Context. A conflict case the two object were of the same class.


 Are you saying this case:

 with MyClassInstance1 as m, MyClassInstance2 do begin
   m.Property1 := 123;
   Property2 := 456;
 end;

 Here you don't know Property2 belongs to which object instance??

No, he's saying that *his hack* using class helper wouldn't cover this
case (two objects in the same 'with' clause).

Daniel, I find this hack as ingenious as atrocious ;-)
But thinking about it a bit, when FPC gets generic methods you can
make this kind of workable!

 (...)
 To summarize, as does NOT try to eliminate context ambiguity (also it
 won't make a clear context ambiguous), but provided some convenience when
 needed.

As Sven said this feature has already been requested a few times.
I don't remember whether it was permanently vetoed by FPC developers
or just is in the to-do, but vaguely remember people arguing it's
un-pascal because of the local variable/scope - which is
unfortunate, because IMO the 'with' syntax is one of the most
abominable un-pascal things Borland introduced in the language, and
*forcing* the AS syntax (but probably with some other keyword like
ALIAS) would make it much more palatable.

Best regards,
Flávio
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] a proposal about with syntax

2013-03-16 Thread 印場 乃亜
Hi,

Also with using the longobj below, you have to declare it first (yet more 
manual temporary/helper variables).  
Also, once you do that, you don't need with as much to begin with since you 
could use a single char. variable name.

BTW, I don't think Daniel was suggesting that we actually use a class helper 
for such cases - just demonstrating that it's possible.  I have to admit I 
didn't even think of using a class helper, so that's fairly creative.  It could 
also be a possible implementation pathway if someone decides to implement it - 
but I doubt it since if you have access to internal compiler structures, you 
already know what with is referring to.

I am not sure anyone has decided that as is specifically a bad idea. (Correct 
me if I am wrong).  Look at it the opposite way, though.  For every request, 
there has to be somebody capable of implementing it in the compiler who has 
free time and considers it to be more important than all of the other things 
outstanding.  

I fully support having an as operator or something effectively similar, 
however I also know than submitting a patch is better than making a feature 
request.  

Also, I am happy just to have with at all.  My other main language (ABAP) 
has lots of awesome stuff like Native DB integration, but somehow doesn't have 
WITH!  (From the my limited Java experience, it seems Java doesn't have an easy 
alternative either).

Thank you,
Noah Silva

On 2013/03/17, at 7:55, Xiangrong Fang xrf...@gmail.com wrote:

 shiruba's example is better than mine, and was exactly the reason I posted 
 this suggestion.
 
 I don't think a class helper is worth for this stuff, if I need to write a 
 helper I would rather do this:
 
 longobj := BigLongThingIDontWantToWriteOutEverySingleTime;
 With longobj do begin
   Height := 100;
   Width := 200;
   ...
   SomeOtherObject.Submit(longobj);
 end;
 
 That's not elegant, but it is really not worth for a helper in this case, 
 IMHO.  with itself is a convenience syntax anyway, why adding an as to 
 make it more convenient a bad idea?  I don't know what's make it complex if 
 there are 2 or more subject in the with?
 
 
 2013/3/17 Daniel Gaspary dgasp...@gmail.com
 On Sat, Mar 16, 2013 at 3:02 PM, 印場 乃亜 shir...@galapagossoftware.com wrote:
  With BigLongThingIDontWantToWriteOutEverySingleTime do
begin
   Height := 100;
   Width := 200;
  ...
   SomeOtherObject.Submit(BigLongThingIDontWantToWriteOutEverySingleTime);
end;
 
  Notice how I have to write the long thing out again at the bottom.  There
  must be a way around that (Something like Self, but that refers to
  whatever you are using in With).
 
 You can use a Class Helper:
 
 http://pastebin.com/pFL49byh
 
 But you gonna need to use a type cast. And with a SomethingElse at
 the with, as showed by Xiangrong, things can become messy.
 ___
 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] a proposal about with syntax

2013-03-16 Thread 印場 乃亜
Hi,

On 2013/03/17, at 11:37, Flávio Etrusco flavio.etru...@gmail.com wrote:
 
 No, he's saying that *his hack* using class helper wouldn't cover this
 case (two objects in the same 'with' clause).
 
Well, more to the point, it only works with OOP.  I use WITH on structures, 
etc. all the time, so ... yes implementing it in the compiler/RTL would be 
preferable of course.

 Daniel, I find this hack as ingenious as atrocious ;-)
 But thinking about it a bit, when FPC gets generic methods you can
 make this kind of workable!

No comment, but the fact that he replied with his solution so quickly makes 
me wonder if he has actually used it before!

 
 (...)
 To summarize, as does NOT try to eliminate context ambiguity (also it
 won't make a clear context ambiguous), but provided some convenience when
 needed.
 
 As Sven said this feature has already been requested a few times.
 I don't remember whether it was permanently vetoed by FPC developers
 or just is in the to-do, but vaguely remember people arguing it's
 un-pascal because of the local variable/scope - which is
 unfortunate, because IMO the 'with' syntax is one of the most
 abominable un-pascal things Borland introduced in the language, and
 *forcing* the AS syntax (but probably with some other keyword like
 ALIAS) would make it much more palatable.

I'm a bit confused on this point.  To me, WITH has been around for a long time, 
and is to me very Pascal.  Probably because PAscal is one of the only languages 
that allows nested procedures, etc., and with seems similar to me.  (Also, 
pretty much to me Borland = Pascal).  Although I just wanted a keyword (like 
self), the AS proposal makes more sense if you use more than one item in the 
same WITH.  (I usually don't because they would have the same fields anyway...) 
 

I think having functions/procedures with no arguments callable with 
procedurename() is un-pascal-like as well, but it hardly bothers me that FPK 
allows it.  Just because I don't love it doesn't mean others don't.  (There is 
a lot of C like syntax that has creeped into FPK, but I assume that'S either 
because it was easy to implement and a few people wanted it, or because it made 
porting C stuff to Pascal easier).  One could say OOP isn't Pascal like because 
the original inventor didn't come up with TObject... 

Actually the only thing that makes me uncomfortable about the keyword as, is 
that it strangely reminds me of SQL.  I suppose that isn't a bad thing though.  

 Thank you,
   Noah Silva
 
 Best regards,
 Flávio
 ___
 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] a proposal about with syntax

2013-03-16 Thread Flávio Etrusco
 Actually the only thing that makes me uncomfortable about the keyword as, 
 is that
 it strangely reminds me of SQL.  I suppose that isn't a bad thing though.

No problem with SQL, but as is already safe typecast, remember? ;-)

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


Re: [fpc-pascal] a proposal about with syntax

2013-03-16 Thread Daniel Gaspary
On Sun, Mar 17, 2013 at 12:07 AM, 印場 乃亜 shir...@galapagossoftware.com wrote:
 On 2013/03/17, at 11:37, Flávio Etrusco flavio.etru...@gmail.com wrote:
 Daniel, I find this hack as ingenious as atrocious ;-)
 But thinking about it a bit, when FPC gets generic methods you can
 make this kind of workable!

I was thinking about this, not specifically generic methods, but some
new generic resource.


 No comment, but the fact that he replied with his solution so quickly makes 
 me wonder if he has actually used it before!

I never used it, but indeed I have thought before about a way to do this.

I would like to have option to use a kind of self in with statement,
but I understand the compiler team that it is a superfluous resource.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpcup for FreeBSD

2013-03-16 Thread Marcos Douglas
On Sat, Mar 16, 2013 at 1:07 PM, Reinier Olislagers
reinierolislag...@gmail.com wrote:
 (Cross posted: FPC+Laz lists)

 Hi all,

 I've updated the fpcup automatic FPC+Laz installer from svn for FreeBSD.

 Tested on PC BSD, (similar to FreeBSD 9 x64 but with built in x11).

 A quick test showed a clean box with just fpcup will install Laz
 trunk+FPC fixes_2.6 well. Of course fpcup can be adjusted to get FPC
 trunk etc.

 Source code as usual at
 https://bitbucket.org/reiniero/fpcup

 Download for x64 FreeBSD via
 https://bitbucket.org/reiniero/fpcup/downloads

 General changes in the dev version:
 - apart from svn download support, I've added mercurial and git support.
 (@Graeme: fpcup can download the new tiopf repo but will probably need
 to switch branches for it to be useful)
 - fpcup can now create the Lazarus setup.exe if you are on windows (or
 presumably wine) if you have the Inno Setup Compiler installed. Thanks
 to Martin Friebe for improving the Laz build batch scripts which made
 this possible!

 As usual, Ludo Brands  I would appreciate comments, patches, as well as
 in this case an x86 build ;)


 Thanks,
 Reinier

Good job.

BTW, I added a link to fpcup in the Greyhound's page.
https://github.com/mdbs99/Greyhound/blob/master/README.markdown
Thank you for added Greyhound in your project.

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


Re: [fpc-pascal] a proposal about with syntax

2013-03-16 Thread Flávio Etrusco
On Sun, Mar 17, 2013 at 12:16 AM, Daniel Gaspary dgasp...@gmail.com wrote:
 On Sun, Mar 17, 2013 at 12:07 AM, 印場 乃亜 shir...@galapagossoftware.com wrote:
 On 2013/03/17, at 11:37, Flávio Etrusco flavio.etru...@gmail.com wrote:
 Daniel, I find this hack as ingenious as atrocious ;-)
 But thinking about it a bit, when FPC gets generic methods you can
 make this kind of workable!

 I was thinking about this, not specifically generic methods, but some
 new generic resource.

Indeed. What I was thinking would actually need generic functions,
bounded generics and generics with type-erasure ;-)
So you'd write, say:

  type generic TAlias1T: TObject = class(TObject)
function Alias1: T;
  end;

 functionT: TObject Alias1(Source: T): TAlias1T;


And yet you wouldn't be able to name the alias...

-Flávio

PS. I can't believe Embarcadero went for : instead of = for
declaring bounded/restricted generics :-/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal