<Regenaxer>
Hmm, perhaps it is good that freemint brought up the issue of 'return'
<Regenaxer>
In fact, 8kLisp had a 'return' statement
<Regenaxer>
but in PicoLisp the situation is more complicated
<Regenaxer>
Such a function is still possible, but would have some restrictions
<Regenaxer>
Which might be unfriendly
<Regenaxer>
Restrictions about what it could handle, so it would result in possibly surprising effects if called in the wrong environment
<Regenaxer>
Still, a quick and fast 'return' is indeed desirable
andyjpb has quit [Ping timeout: 244 seconds]
<Regenaxer>
But it possibly opens a pandora box
<razzy>
\me could think of only about very expensive ways how to do return function in picolisp.
<razzy>
huh, my device is not compatible with penti. cannot load from store. :(
<razzy>
device is perfectly capable of multi touch.
<Regenaxer>
In fact, if I disallow 'return' in catch/throw and I/O frames, it is quite simple. I elaborate
<Regenaxer>
Do you have pre-5.0 Android?
<Regenaxer>
oops, MINSDK=23
<Regenaxer>
so you need at least 6.0
<Regenaxer>
In my mind 'return' was more difficult than it is, because it is hard to do in C (pil32). So I do it only in pil64
razzy3 has quit [Ping timeout: 268 seconds]
razzy has quit [Ping timeout: 272 seconds]
razzy has joined #picolisp
razzy has quit [Changing host]
razzy has joined #picolisp
<razzy>
just to be sure. step back function is still hard/expensive in 64bit picolisp.
<razzy>
hmm none of my two decices are compatible with penti play store.
<Regenaxer>
Did you see my messages?
<Regenaxer>
Android 6.8
<Regenaxer>
6.0
<Regenaxer>
There is software-lab.de/pentiKeyboard-23nov18.apk for Android 5 IIRC
<Regenaxer>
Outdated version
<Regenaxer>
I forgot what you meant with "step back"
orivej has quit [Ping timeout: 272 seconds]
<razzy>
sorry i thought android version update with updates. i have old version. i need android 5 version.
<razzy>
thx.
<razzy>
by "step back" i mean step back in debugger. or making every step reversible/two-way.
<Regenaxer>
That's nearly impossible. How ti reverse rm -r * ?
<beneroth>
by logging all data changes :P
<beneroth>
Good morning :)
<razzy>
Regenaxer simple very expensive version is to keep before-state for everything.
<razzy>
good morning.
<beneroth>
Regenaxer, I'm unsure about return. On one hand, yes, sometimes it would be handy, and it bothered me in the beginning. On the other hand, now I'm used to the current picolisp way, and it often forces you to think functions through and sometimes to re-arrange things, and usually this results in a clear improvement.
<razzy>
beneroth i am interested in question is the improvement worth thinking time?
<beneroth>
exactly that is my point :)
<razzy>
i take it as yes. i am not sure
<beneroth>
I believe so. Cannot be sure.
<beneroth>
take it as a: yes probably
<beneroth>
My point is: there must be additional benefit beside offering more choice to add a functionality to picolisp. choice is nice, but the problem of programming is that there is too much choice...
<beneroth>
Regenaxer, Related: It took me ages to get that the two functionalities of (catch) have nothing to do with each other! (throw) in picolisp is not much about error handling, more about event handling. this we need to stress more in the documentation, maybe. this separation makes sense but does not exist so strongly in most other languages.
<Regenaxer>
beneroth, right ;re-arranging one's mind)
<Regenaxer>
Whats closest is perhaps long_jmp() in C
<Regenaxer>
i.e. a non-local goto
<Regenaxer>
(throw) was traditionally this way in Lisp
<beneroth>
I only know goto :D
<Regenaxer>
pil32 uses longjmp() internally for (throw)
<beneroth>
yeah. problem is, nowadays most people know (throw) from exception/error handling, not from goto context, I think. so people (or at least me, at beginning) only use it for error handling, mixing up the (catch 'str ...) and the (catch 'sym ...)
<beneroth>
and they're not well mixed...
<beneroth>
well they can be mixed, but (catch 'sym ...) is not meant for error handling.
<beneroth>
right?
<beneroth>
(not to catch 'quit)
<Regenaxer>
right. It is a more a non-local "return"
<Regenaxer>
normal program flow
<Regenaxer>
the only way to get out of deeply nested structures or function calls
<Regenaxer>
A good example is @lib/ed.l
<Regenaxer>
razzy, you can't keep the state
<Regenaxer>
needs to copy the whole heap perhaps
<Regenaxer>
as it may have triggered a gc
<Regenaxer>
or modified files
<razzy>
it will explode afk.
<razzy>
most likely. but possible.
clacke_movim has left #picolisp [#picolisp]
<beneroth>
Regenaxer, benefits of return over throw? better readable lists of (ifn) calls when doing many checks... what else?
<Regenaxer>
It is more efficient. No catch frame needs to be set up
<beneroth>
what probably would be nice would be a restart feature, kinda saving a stable state, and when an error occurs you can reroll from that point. Common lisp has that feature, though I don't know how exactly it is used nor how it is implemented.
<Regenaxer>
Doesn't catch do that?
<beneroth>
hm
<Regenaxer>
"stable" in which sense?
<beneroth>
T
<beneroth>
app-specific afaik.
<beneroth>
you are right.
xkapastel has joined #picolisp
<Regenaxer>
I will investigate 'return' a litle
<beneroth>
yeah good thinking
<Regenaxer>
In 8kLisp it worked well
<Regenaxer>
and I just stopped it cause it was nasty in pil32
<Regenaxer>
No way in C to manipulate the stack
<beneroth>
I'm wondering if forcing the programmer to think might be better than having return. But yeah I missed return a lot...
<Regenaxer>
T
<beneroth>
why didn't you implement pil32 using forth ? :P
<beneroth>
everything non-stack being a mess?
<Regenaxer>
Forth is toi slow
<Regenaxer>
too
<beneroth>
oh, okay
rob_w has joined #picolisp
orivej has joined #picolisp
<razzy>
Regenaxer i can copy whole heap. and in principle i can keep state of everything that is happening inside pil. if i could rollback changes on heap.
<Regenaxer>
Amazing that you can do that! ;)
<razzy>
i mean in theory.
<Regenaxer>
You need of course to copy the whole stack too
<Regenaxer>
and all system file structures, poinyers etc.
<Regenaxer>
*pointers
<Regenaxer>
CPU registers are most important of course
<razzy>
i would say very naive thing. i would create some incremental roll-back-able data-structure (list). than put all state-holding variables into looong list. and increment or roll back changes there. or put error if state came from outside and i am unable to roll back.
<Regenaxer>
OK, great! Please do!
<razzy>
sorry for rant. it is deep in to do list.
xkapastel has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
andyjpb has joined #picolisp
orivej has quit [Ping timeout: 248 seconds]
<Regenaxer>
I give up. 'return' cannot be implemented in the current interpreter. There is not enough information about the calling environment available at runtime
<Regenaxer>
In fact I got it working for normal function calls, but then those functiins will not work with 'apply' or mapping functions, or method calls
<Regenaxer>
So I revert the changes
orivej has joined #picolisp
<beneroth>
Regenaxer, okay
<Regenaxer>
:)
<beneroth>
I spoke with Morris about the change, he was against return :)
<Regenaxer>
Good :)
<beneroth>
I say: (catch) and (throw) is good enough, we just need to stress the difference of (catch 'str) and (catch 'sym) more, I think.
<beneroth>
Making programmers think (because return is not available) is good, I believe :)
<beneroth>
less typing, more thinking
<Regenaxer>
I noticed I implemented return almost identically in 2015, gave up, and obviously forgot about it :D
<beneroth>
:D
<beneroth>
I cannot remember you mentioned trying to implement return before :)
<Regenaxer>
Gabage collected
<beneroth>
good :)
<beneroth>
this way you re-validated the factual objective state of reality :)
<beneroth>
good science
<Regenaxer>
yeah
<Regenaxer>
never trust one's results
<beneroth>
aye
ubLIX has joined #picolisp
rob_w has quit [Ping timeout: 246 seconds]
xkapastel has joined #picolisp
<aecepoglu[m]>
this is one of the more active rooms I've been in that is dedicated to a programming channel
<Regenaxer>
Good to hear :)
<beneroth>
:)
<Regenaxer>
despite we are a really tiny group of crazy guys
<Regenaxer>
... and (at least me) sleepy
<Regenaxer>
Good night!
<beneroth>
Good night Regenaxer
<beneroth>
<Regenaxer> despite we are a really tiny group of crazy guys
<beneroth>
T :D
clacke_movim has joined #picolisp
<rick42>
hi peeps!
<rick42>
is Regenaxer still in the far east?
<rick42>
Regenaxer: i have *never* needed a `return` in 20 years of lisp programming. nice of you to look at the application possibiities though.
<rick42>
i agree with beneroth: "less typing, more thinking" (and his other comments on this topic).
<beneroth>
rick42, he is
<rick42>
Regenaxer garbage-collected his 2015 `return` experiments. lol
<beneroth>
:)
<rick42>
beneroth: o/
razzy has quit [Ping timeout: 244 seconds]
razzy has joined #picolisp
razzy has quit [Changing host]
razzy has joined #picolisp
jibanes has quit [Ping timeout: 244 seconds]
jibanes has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
xkapastel has joined #picolisp
orivej has quit [Ping timeout: 245 seconds]
orivej has joined #picolisp
freemint has joined #picolisp
razzy2 has joined #picolisp
razzy has joined #picolisp
razzy2 has quit [Changing host]
razzy2 is now known as razzy
ubLIX has quit [Quit: ubLIX]
razzy has quit [Read error: Connection reset by peer]
razzy has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
<Regenaxer>
rick42, "*never* needed": Good to hear
<Regenaxer>
Yes, still Sapporo, we fly back tomorrow