Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-01 Thread Ryan Joseph


> On Jun 2, 2018, at 5:19 AM, Nitorami  wrote:
> 
> Are you serious ? I have been using dynamic arrays a lot for processing of
> vectors and matrices containing floating point values, and implemented the +
> operator to do the obvious, add the elements of two vectors, NOT to concat
> them. This is just natural for floating point vectors, similar as with other
> basic mathemetical operators as *,-, /.  
> Even if the "+" has always been used to concat strings, I find it a really
> really bad idea to extend that to danymic arrays.

Why are you using dynamic arrays for vectors/matricies? If what you have is an 
actual array you wish to grow then + would likely be an append operation.

var
  v: TVec2;
begn
  v := V2(1,1);
  v += 10; // add 10 to x/y  and get: v = 11,11

var
  v: array of float;
begn
  SetLength(v, 1);
  v[0] := 1;
  v += 10; // append 10 and get : v = 1,10


Regards,
Ryan Joseph

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

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-01 Thread Nitorami
> ## "+" operator
> The compiler now implements a "+" operator for arrays which is the same
> as if Concat() would be called on the arrays.
> Note regarding backwards compatibility: existing "+" operator overloads
> for dynamic arrays no longer compile. 

Are you serious ? I have been using dynamic arrays a lot for processing of
vectors and matrices containing floating point values, and implemented the +
operator to do the obvious, add the elements of two vectors, NOT to concat
them. This is just natural for floating point vectors, similar as with other
basic mathemetical operators as *,-, /.  
Even if the "+" has always been used to concat strings, I find it a really
really bad idea to extend that to danymic arrays.



--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Realtime and freepascal???

2018-06-01 Thread Marc Santhoff
On Thu, 2018-05-31 at 14:34 +, Mark Morgan Lloyd wrote:

> It's notable that the Boeing "Dreamliner" uses Ethernet heavily for both 
> control and passenger entertainment, allegedly with the various 
> subsystems both firewalled and airgapped (which raises the question: 
> would one really need both if one were confident in what he was doing?).

They most probably use industrial ehternet for the important things. There are
approaches doing both, tcp/ip and industrial protocols on one cable, but I
personally would not set one foot into a plane doing so. ;)

-- 
Marc Santhoff 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Realtime and freepascal???

2018-06-01 Thread Marc Santhoff
On Wed, 2018-05-30 at 22:27 +0200, Darius Blaszyk wrote:

> My project is planned to do data acquisition, either storing data to flash
> memory or sending it over RF, not decided yet. Later on video should be
> incorporated, also over RF. There are also multiple analogue controllers
> planned to be implemented. Some "simple" bus system (such as CAN??) should
> allow easy extension with modules (for data acquisition as well as for the
> controllers). The response time should be in the order of 10ms ideally.

Normally this would not be done on one Machine. If so it is a big one, having
enough power for running (parts of) the OS in real time. My suggestion would
be to use a small embedded SoC and a OS or programming technique doing hard
real time and another one, RPi would fit here from 15$ or so upward, recording
and / or streaming video.

Regarding data acquisition it is really hard to decide which bus or
communicaation port to use if the target measuring hardware isn't known. Many
industrial installations use modbus on RS485.

> Hoping for some useful replies. Thanks in advance for all the tips and
> pointers!

http://wiki.freepascal.org/Operating_Systems_written_in_FPC
http://wiki.freepascal.org/ARM
https://en.wikipedia.org/wiki/Comparison_of_real-time_operating_systems

Have fun,
Marc

-- 
Marc Santhoff 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal