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

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

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

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

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. :-)

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

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

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

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.

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

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] 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

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

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

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

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

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

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

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,

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)

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

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

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