[fpc-pascal] Use a procedural type for declare a procedure\function

2017-04-19 Thread Andrey M, Zubarev
Hi All, Why can't use procedural type for declare a procedure\function? Why ever allow the exact same signature? It's uncomfortable Maybe it makes sense to introduce into the language such a possibility? For example such code: [code] type TMyCommand=function(arg1:TMyArg):TMyCommandResult begin ...

Re: [fpc-pascal] *** GMX Spamverdacht *** Re: WebAssembly Target

2017-04-19 Thread Michael Schnell
On 14.04.2017 12:56, Jürgen Hestermann wrote: Why is it scripting needed to display a calendar? Most obviously: (OK. I do know that there is a timed reload instruction in HTML, that I malevolently ignore in this post, but it would be a PITA to use same in a more complex example, as it would re

Re: [fpc-pascal] WebAssembly Target

2017-04-19 Thread Michael Schnell
On 14.04.2017 10:41, Jürgen Hestermann wrote: I can't understand why scripting is needed for a web page. Regarding the discussion here, the term is "Rich Internet Application" ("RIA") -> https://en.wikipedia.org/wiki/Rich_Internet_application Here, a server based application (e.g. done in Pasc

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-19 Thread Michael Schnell
On 14.04.2017 09:36, Sven Barth via fpc-pascal wrote: A process definitely is less "light" than threads even on Unix systems: a process has its own address space Not really true (see below). Why do you think the concept of threads was introduced in Unix? Early Unix systems only had proce

Re: [fpc-pascal] fpc code for Java class and Android.

2017-04-19 Thread Paul Breneman
On 04/19/2017 09:48 PM, Jon Foster wrote: On 04/19/2017 06:01 AM, Paul Breneman wrote: On 04/18/2017 07:38 AM, Paul Breneman wrote: On 04/17/2017 08:42 PM, Jon Foster wrote: ... You have to copy the app to "/data/tmp" as that is usually the only place on Android with a Linux file system that a

Re: [fpc-pascal] fpc code for Java class and Android.

2017-04-19 Thread Jon Foster
On 04/19/2017 06:48 PM, Jon Foster wrote: On 04/19/2017 06:01 AM, Paul Breneman wrote: On 04/18/2017 07:38 AM, Paul Breneman wrote: On 04/17/2017 08:42 PM, Jon Foster wrote: ... You have to copy the app to "/data/tmp" as that is usually the only place on Android with a Linux file system that a

Re: [fpc-pascal] fpc code for Java class and Android.

2017-04-19 Thread Jon Foster
On 04/19/2017 06:01 AM, Paul Breneman wrote: On 04/18/2017 07:38 AM, Paul Breneman wrote: On 04/17/2017 08:42 PM, Jon Foster wrote: ... You have to copy the app to "/data/tmp" as that is usually the only place on Android with a Linux file system that all users have access to. You can't look in

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Marco van de Voort
In our previous episode, Daniel Gaspary said: > So.. > > Any chance of an Official implementation ? I don't know. Such effort should chiefly come from the people interested in it I guess. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Daniel Gaspary
So.. Any chance of an Official implementation ? On Wed, Apr 19, 2017 at 10:50 AM, Marco van de Voort wrote: > In our previous episode, Ryan Joseph said: >> > Your example is simply broken. A few points: >> >> Thanks for the description. Yeah, I assumed the stack would be restored but >> that is

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Marco van de Voort
In our previous episode, Ryan Joseph said: > > Your example is simply broken. A few points: > > Thanks for the description. Yeah, I assumed the stack would be restored but > that isn?t the case apparently. > > I think the coroutine implementation in the link below tries to manage the > stack fr

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
> On Apr 19, 2017, at 5:37 PM, Karoly Balogh (Charlie/SGR) > wrote: > > Your example is simply broken. A few points: Thanks for the description. Yeah, I assumed the stack would be restored but that isn’t the case apparently. I think the coroutine implementation in the link below tries to man

Re: [fpc-pascal] fpc code for Java class and Android.

2017-04-19 Thread Paul Breneman
On 04/18/2017 07:38 AM, Paul Breneman wrote: On 04/17/2017 08:42 PM, Jon Foster wrote: ... You have to copy the app to "/data/tmp" as that is usually the only place on Android with a Linux file system that all users have access to. You can't look in there so you kind of have to fly blind. :-) "T

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Karoly Balogh (Charlie/SGR)
Hi, On Wed, 19 Apr 2017, Ryan Joseph wrote: > yes, I?d like to see that so I know why my example doesn?t work as I > expected. Everything I?m hearing makes me think ?i? should keep > incrementing after I call SetJmp and then return with JongJmp but > there?s something I?m missing obviously. Your

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
> On Apr 19, 2017, at 5:17 PM, Michael Van Canneyt > wrote: > > It's a variable which the compiler does not put on the stack, it exists just > in a register. That kind of defeats the purpose then if you can’t rely on function scoped variables to be restored. Maybe that’s what the code in the

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Michael Van Canneyt
On Wed, 19 Apr 2017, Ryan Joseph wrote: On Apr 19, 2017, at 4:33 PM, Michael Van Canneyt wrote: Your reasoning contains a wrong assumption, namely that I is on the stack. If I is a register variable, then it is not on the stack, and will be reset with each longjmp. I thought all variabl

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
> On Apr 19, 2017, at 4:33 PM, Michael Van Canneyt > wrote: > > Your reasoning contains a wrong assumption, namely that I is on the stack. > > If I is a register variable, then it is not on the stack, and will be reset > with each longjmp. I thought all variables declared inside a function (l

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
> On Apr 19, 2017, at 4:57 PM, Mark Morgan Lloyd > wrote: > > SetJmp records the current state, LongJmp reverts to it. There's some > common-sense limitations. > > I've got an example program of about 100 lines that would demonstrate what > I've hacked together, I could tack it onto a messag

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Mark Morgan Lloyd
On 19/04/17 09:30, Ryan Joseph wrote: On Apr 19, 2017, at 3:28 PM, Mark Morgan Lloyd wrote:> > It is possible to partially-simulate coroutines with setjmp/longjmp, but you need to store state outside the function. The key thing about coroutines, at least as implemented by Wirth in Modula-2, i

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Michael Van Canneyt
On Wed, 19 Apr 2017, Sven Barth via fpc-pascal wrote: Am 19.04.2017 11:26 schrieb "Ryan Joseph" : On Apr 19, 2017, at 4:14 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: Those functions simply store (setjmp) and restore (longjmp) register values (and setjmp als

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Sven Barth via fpc-pascal
Am 19.04.2017 11:26 schrieb "Ryan Joseph" : > > > > On Apr 19, 2017, at 4:14 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > Those functions simply store (setjmp) and restore (longjmp) register values (and setjmp also returns the value passed to longjmp if it had bee

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Michael Van Canneyt
On Wed, 19 Apr 2017, Ryan Joseph wrote: On Apr 19, 2017, at 4:14 PM, Sven Barth via fpc-pascal wrote: Those functions simply store (setjmp) and restore (longjmp) register values (and setjmp also returns the value passed to longjmp if it had been reached by a longjmp). Nothing more, noth

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
> On Apr 19, 2017, at 4:14 PM, Sven Barth via fpc-pascal > wrote: > > Those functions simply store (setjmp) and restore (longjmp) register values > (and setjmp also returns the value passed to longjmp if it had been reached > by a longjmp). Nothing more, nothing less. So while the stack regis

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Sven Barth via fpc-pascal
Am 19.04.2017 06:35 schrieb "Ryan Joseph" : > > > > On Apr 19, 2017, at 2:34 AM, Daniel Gaspary wrote: > > > > Using SetJmp and LongJmp? > > > > I believe some months ago it was a discussion on the list on why this > > was not really the way to implement coroutines. > > > > Searching for longjmp/

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
> On Apr 19, 2017, at 3:28 PM, Mark Morgan Lloyd > wrote: > > It is possible to partially-simulate coroutines with setjmp/longjmp, but you > need to store state outside the function. The key thing about coroutines, at > least as implemented by Wirth in Modula-2, is that you can transfer > ar

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Mark Morgan Lloyd
On 19/04/17 05:00, Ryan Joseph wrote: On Apr 19, 2017, at 2:34 AM, Daniel Gaspary wrote:> > Using SetJmp and LongJmp?> > I believe some months ago it was a discussion on the list on why this> was not really the way to implement coroutines.> > Searching for longjmp/setjmp you can find the thre

Re: [fpc-pascal] fpc code for Java class and Android.

2017-04-19 Thread Graeme Geldenhuys
On 2017-04-18 18:13, Jon Foster wrote: > I can't think of any terminal based programs I use > that offer mouse support. No idea what this thread is about really, but as for the above statement. I use plenty terminal apps that have mouse support. Midnight Commander (2 panel file manager), Free Pas

Re: [fpc-pascal] fpc code for Java class and Android.

2017-04-19 Thread Marco van de Voort
In our previous episode, Paul Breneman said: > > they've added some nice touches. I had been using "Pascal Develop" since > > I could download the source and alter its compile target. But it doesn't > > provide proper terminal emulation and came packaged with FPC 2.6 pre v3 > > beta, which was good