Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
> On Apr 12, 2017, at 9:24 PM, Jürgen Hestermann > wrote: > > SetLength(Array,Length(Array)+1); > > You will get an additional element (filled with zeros). > Then you can set > > Array[High(Array)] := whateveryouwant; Well sure, but this kind of code is exactly what programmers abstract and

Re: [fpc-pascal] Bls: WebAssembly Target

2017-04-12 Thread Michael Van Canneyt
On Thu, 13 Apr 2017, Mr Bee via fpc-pascal wrote: Pada Sabtu, 18 Maret 2017 0:54, Michael Van Canneyt menulis: You'll design a web app in the lazarus IDE (or Delphi IDE, for that matter). The app will be compiled to Javascript. Current thinking is that that there will be 2 "modes": -

[fpc-pascal] Bls: WebAssembly Target

2017-04-12 Thread Mr Bee via fpc-pascal
Pada Sabtu, 18 Maret 2017 0:54, Michael Van Canneyt menulis: You'll design a web app in the lazarus IDE (or Delphi IDE, for that matter). The app will be compiled to Javascript. Current thinking is that that there will be 2 "modes": - "Free" Mode, where the CSS will determine the actual r

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Michael Van Canneyt
On Wed, 12 Apr 2017, Ryan Joseph wrote: On Apr 12, 2017, at 9:25 PM, Michael Van Canneyt wrote: Adding a pop/push requires compiler magic, and could be implemented; but the question is whether it is worth it, given the plethora of other options at your disposal. Why magic? It seems sil

Re: [fpc-pascal] SpVoice.GetVoices returned exception class EOleSysError

2017-04-12 Thread fredvs
> I suppose if you just call the Exe and do piping this is not a violation of the GPL according to Richard Stallman Yes, it is what answered the author when I asked it by email. About using the library directly (with loadlib(espeak.so) or statically) he answered that ... the license is clear, you

Re: [fpc-pascal] Constants in generics

2017-04-12 Thread Ryan Joseph
> On Apr 12, 2017, at 10:06 PM, nore...@z505.com wrote: > > The only way I can think of extending the functionality of a array is to put > it into an old borland object (on the stack) but that may not be what you are > looking for. Then you can give the array methods, effectively, possibly > r

Re: [fpc-pascal] Constants in generics

2017-04-12 Thread Sven Barth via fpc-pascal
Am 12.04.2017 17:06 schrieb : > > On 2017-04-09 06:32, Ryan Joseph wrote: >>> >>> On Apr 9, 2017, at 6:13 PM, Maciej Izak wrote: >>> >>> sure, but not directly. Try this: >> >> >> Thanks, that’s a seriously funky hack but it works. :) The only >> downside is you need to define types every time you

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Sven Barth via fpc-pascal
Am 12.04.2017 16:51 schrieb "Ryan Joseph" : > > > > On Apr 12, 2017, at 9:25 PM, Michael Van Canneyt wrote: > > > > Adding a pop/push requires compiler magic, and could be implemented; but the question is whether it is worth it, given the plethora of other > > options at your disposal. > > Why mag

Re: [fpc-pascal] WebAssembly Target

2017-04-12 Thread Sven Barth via fpc-pascal
Am 12.04.2017 16:10 schrieb : > Why run webgl through javascript if you could just make something like a flash plugin object (like youtube videos) that plays opengl scenes using some native format similar to how flash uses SWF files, or whatever? Because the point is not to need some strange, obsc

Re: [fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread Sven Barth via fpc-pascal
Am 12.04.2017 14:32 schrieb : > In a way, this is a form of garbage collection or RAII sort of. And reduces the obnoxious free's required in non garbage collected programming languages... So it's a nice feature/trick to have ownership. But at the same time you can think there is a memory leak since

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Jürgen Hestermann
Am 2017-04-12 um 16:36 schrieb Ryan Joseph: > Why magic? It seems silly the operator += doesn’t exist Well, are we using Pascal or C? ;-) > or even a basic operation set like “add”, “remove”, “insert” that every array implementation in every language has. > Aren’t those just function around th

Re: [fpc-pascal] Constants in generics

2017-04-12 Thread noreply
On 2017-04-09 06:32, Ryan Joseph wrote: On Apr 9, 2017, at 6:13 PM, Maciej Izak wrote: sure, but not directly. Try this: Thanks, that’s a seriously funky hack but it works. :) The only downside is you need to define types every time you need a different size. Is this a known feature request

Re: [fpc-pascal] *** GMX Spamverdacht *** Re: Array clearing

2017-04-12 Thread Jürgen Hestermann
Am 2017-04-12 um 16:47 schrieb Michael Van Canneyt: >> Type MyType = record >> A : Integer; >> B : array of char; >> C : array of Float; >> end; // of record >> ArrayA = array of MyType; >> ArrayB = array of ArrayA. >> >> What would

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
> On Apr 12, 2017, at 9:25 PM, Michael Van Canneyt > wrote: > > Adding a pop/push requires compiler magic, and could be implemented; but the > question is whether it is worth it, given the plethora of other > options at your disposal. Why magic? It seems silly the operator += doesn’t exist or

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
> On Apr 12, 2017, at 9:43 PM, Jürgen Hestermann > wrote: > > "clear" is not very clear to me ;-) > IMO SetLength(array,0) is clearing too. SetLength resizes memory so there’s that distinction. The fact there is an API is what’s important because there’s at least a reference point. > > Th

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Michael Van Canneyt
On Wed, 12 Apr 2017, Jürgen Hestermann wrote: Am 2017-04-12 um 16:17 schrieb Ryan Joseph: > SetLength resizes the array in memory and “clear” means setting all values to default() for that type. "clear" is not very clear to me ;-) IMO SetLength(array,0) is clearing too. The function you wa

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Jürgen Hestermann
Am 2017-04-12 um 16:17 schrieb Ryan Joseph: > SetLength resizes the array in memory and “clear” means setting all values to default() for that type. "clear" is not very clear to me ;-) IMO SetLength(array,0) is clearing too. The function you want should be called "Fill". For example a function

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Michael Van Canneyt
On Wed, 12 Apr 2017, Ryan Joseph wrote: On Apr 12, 2017, at 8:05 PM, nore...@z505.com wrote: Since fillchar is not a general way to clear an item it almost seems like pascal needs a way to clear things generically, such as Array.clear But I guess this would be reinventing OOP, or Ruby wher

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Jürgen Hestermann
Am 2017-04-12 um 15:46 schrieb Ryan Joseph: > I agree. Dynamic arrays only advantage is they are managed by the compiler but they’re missing obvious functionality like adding/removing elements so they’re usually pretty useless. > Why was the functionality of appending an element to the end never

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
> On Apr 12, 2017, at 8:05 PM, nore...@z505.com wrote: > > Since fillchar is not a general way to clear an item it almost seems like > pascal needs a way to clear things generically, such as Array.clear > But I guess this would be reinventing OOP, or Ruby where everything is an > object and can

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
> On Apr 12, 2017, at 9:07 PM, Jürgen Hestermann > wrote: > > What exactly does it do when "clearing" a dynamic array? > There are multiple ways to "clear" it. I see your point but there could be a good API to make this clear. SetLength resizes the array in memory and “clear” means setting al

Re: [fpc-pascal] WebAssembly Target

2017-04-12 Thread noreply
On 2017-03-17 09:57, Reimar Grabowski wrote: On Thu, 16 Mar 2017 11:14:17 + Graeme Geldenhuys wrote: And I am pleasantly surprised! :) That demo worked perfectly on my system. Sound, animation, graphics all silky smooth. Impressive indeed. If running a 3 year old iOS Demo in a browser

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Jürgen Hestermann
Am 2017-04-12 um 15:05 schrieb nore...@z505.com: > Since fillchar is not a general way to clear an item Define "clear". There are many things that can be named "clearing" (see below). > I've never been a fan of things like fillchar as it seems like a reinvention of something more like Clear()

Re: [fpc-pascal] Hash List

2017-04-12 Thread Michael Van Canneyt
On Wed, 12 Apr 2017, nore...@z505.com wrote: On 2017-03-17 19:06, Giuliano Colla wrote: Il 18/03/2017 00:29, African Wild Dog ha scritto: Ia there any hash list implementation in free Pascal? The IniFiles unit (fpc/packages/fcl-base/src/inifiles.pp) provides a THashedStringList (descendant

Re: [fpc-pascal] Hash List

2017-04-12 Thread noreply
On 2017-03-17 19:06, Giuliano Colla wrote: Il 18/03/2017 00:29, African Wild Dog ha scritto: Ia there any hash list implementation in free Pascal? The IniFiles unit (fpc/packages/fcl-base/src/inifiles.pp) provides a THashedStringList (descendant from TstringList) which I'm using reliably since

Re: [fpc-pascal] WebAssembly Target

2017-04-12 Thread noreply
On 2017-03-16 06:14, Graeme Geldenhuys wrote: On 2017-03-16 10:56, Graeme Geldenhuys wrote: I’ll be pleasantly surprised if it works - after all, so many browser features often only work for OSX and Windows, even though the browser and web is supposed to be “cross-platform”. I’ll report back la

Re: [fpc-pascal] Array clearing

2017-04-12 Thread noreply
On 2017-04-01 02:39, Sven Barth via fpc-pascal wrote: Am 01.04.2017 05:42 schrieb "Ryan Joseph" : As far as the compiler is concerned what’s the difference between clearing an array using a for-loop vs. FillChar? It seems like iterating the array would be slower but what does FillChar do exact

Re: [fpc-pascal] SpVoice.GetVoices returned exception class EOleSysError

2017-04-12 Thread Lukasz Sokol
On 12/04/17 13:37, nore...@z505.com wrote: > On 2017-04-12 07:01, fredvs wrote: >> Hello. >> >> There is also a free-open-source project : espeak : >> http://espeak.sourceforge.net >> >> The licence is GNU General Public License so you may use the >> executable like you want. > > The GPL is a r

Re: [fpc-pascal] TSQLQuery and buffering.

2017-04-12 Thread noreply
On 2017-03-24 14:42, Gary Doades wrote: Hi everyone, Firstly, I realise this is an old subject, but I still can't find any easy answer. Really, the question is simple: Is there ANY way of TSQLQuery NOT reading the entire result set into memory? What about making multiple queries and setting s

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread Lukasz Sokol
On 12/04/17 12:54, Lars wrote: > On Wed, March 29, 2017 4:26 pm, fredvs wrote: >> @Karoly Balogh (Charlie/SGR) >> >> >> Perfect, I have now all the arguments to defend the "Dinosaur Threading" >> choice. >> >> Thanks. >> >> >> Fre;D >> > > Methinks that programs should be designed or programmed in

Re: [fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread Michael Van Canneyt
On Wed, 12 Apr 2017, nore...@z505.com wrote: On 2017-04-12 05:03, LacaK wrote: Yes, example should be adjusted. Please report bug to not forget. Thanks -Laco. It is not a bug, I just wanted to clarify the magic going on behind the scenes - which, is "ownership". That's all I needed to k

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread noreply
On 2017-03-30 11:29, Jon Foster wrote: On 03/29/2017 01:15 PM, Michael Van Canneyt wrote: On Wed, 29 Mar 2017, Dimitrios Chr. Ioannidis via fpc-pascal wrote: Hi, On 29/3/2017 9:57 μμ, fredvs wrote: Hello. Some developers treat me as dinosaur because I use threads in place of doing para

Re: [fpc-pascal] SpVoice.GetVoices returned exception class EOleSysError

2017-04-12 Thread noreply
On 2017-04-12 07:01, fredvs wrote: Hello. There is also a free-open-source project : espeak : http://espeak.sourceforge.net The licence is GNU General Public License so you may use the executable like you want. The GPL is a restrictive license, so you may not use it like you want.. LGPL wo

Re: [fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread noreply
On 2017-04-12 05:03, LacaK wrote: Yes, example should be adjusted. Please report bug to not forget. Thanks -Laco. It is not a bug, I just wanted to clarify the magic going on behind the scenes - which, is "ownership". That's all I needed to know. The key to seeing this trick/magic is in th

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread Giuliano Colla
Il 30/03/2017 00:26, fredvs ha scritto: Perfect, I have now all the arguments to defend the "Dinosaur Threading" choice. When I'm charged of not using the most cool and new technology, my favourite argument are the tombstones. They're made out of stone, which is a stone-age technology. But, a

Re: [fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread LacaK
Yes, example should be adjusted. Please report bug to not forget. The example is correct. All objects are freed. No need for a bugreport. Yes, correct. -Laco. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/c

Re: [fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread Michael Van Canneyt
On Wed, 12 Apr 2017, LacaK wrote: Yes, example should be adjusted. Please report bug to not forget. The example is correct. All objects are freed. No need for a bugreport. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:/

Re: [fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread Michael Van Canneyt
On Wed, 12 Apr 2017, Lars wrote: The sql query object and transaction object are created but not freed: http://www.freepascal.org/docs-html/fcl/sqldb/usingsqldb.html I think the docs should mention that the objects need not to be freed, as this violates normal programming practice of freeing

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread Lars
On Fri, March 31, 2017 4:32 am, Michael Schnell wrote: > On 31.03.2017 10:18, Tony Whyman wrote: > >> Neither of the above implies multiple CPUs or processing units. >> > Regarding the view of the application (disregarding execution speed) or > of the application programmer, there is no difference

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread Lars
On Thu, March 30, 2017 1:56 am, Mark Morgan Lloyd wrote: > On 29/03/17 22:30, fredvs wrote: > >> @Karoly Balogh (Charlie/SGR) >> Perfect, I have now all the arguments to defend the "Dinosaur >> Threading"choice. >> Thanks. >> > > I'd second Charlie's point, and add that a very small change to a > s

Re: [fpc-pascal] SpVoice.GetVoices returned exception class EOleSysError

2017-04-12 Thread fredvs
Hello. There is also a free-open-source project : espeak : http://espeak.sourceforge.net The licence is GNU General Public License so you may use the executable like you want. If you want to use the espeak library only, there is a fpc header here: https://github.com/fredvs/sak/blob/master/sak_d

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-12 Thread Lars
On Wed, March 29, 2017 4:26 pm, fredvs wrote: > @Karoly Balogh (Charlie/SGR) > > > Perfect, I have now all the arguments to defend the "Dinosaur Threading" > choice. > > Thanks. > > > Fre;D > Methinks that programs should be designed or programmed in such an abstract way that you do not care or kn

Re: [fpc-pascal] Call function in shared library from multiple threads

2017-04-12 Thread fredvs
>> TDummyThread.Create(True) > Huh, I have memory leak with this. > Should it not be: --> TDummyThread.Create(false) ? (because with this, no > memory leak) Hello. Sorry to come back with this but without answer I am still full of doubt. Is TDummyThread.Create(True) wanted and so the du

Re: [fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread LacaK
Yes, example should be adjusted. Please report bug to not forget. Thanks -Laco. The sql query object and transaction object are created but not freed: http://www.freepascal.org/docs-html/fcl/sqldb/usingsqldb.html I think the docs should mention that the objects need not to be freed, as this vi

Re: [fpc-pascal] SpVoice.GetVoices returned exception class EOleSysError

2017-04-12 Thread Lars
Do you know about fpu issue, described on wiki? http://wiki.freepascal.org/SAPI Is it an fpu exception or something else? And stackoverflow http://stackoverflow.com/questions/3032739/delphi-sapi-text-to-speech Regards Toppost On Mon, April 10, 2017 12:58 am, misabov wrote: > The project has gene

[fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread Lars
The sql query object and transaction object are created but not freed: http://www.freepascal.org/docs-html/fcl/sqldb/usingsqldb.html I think the docs should mention that the objects need not to be freed, as this violates normal programming practice of freeing all objects you create. P.s. how is