Johnny_Brahms
Joined 12 years ago
Joined 12 years ago
And dynamic-wind is the price you have to pay for call/cc. UNWIND-PROTECT is not the same thing. Multi-shot continuations is he reason. One way would be having explicit one-shot continuations and escape continuations. Those are faster and will make UNWIND-PROTECT work.
I am more in favour of delimited continuations though.
Delimited continuations makes that a bit simpler (since you can easily implement something like dynamic wind using them).
On a more general note, I am still waiting for the world to fall for lisp in general.
I managed to walk/ski (one ski was still on me, but badly broken ) to a nearby village and driven on a stretcher to the hospital.
I am lucky to be alive. It is amazing though how clear you can think in life threatening situations. the moment I noticed the avalanche I knew exactly what to do and where to go. When I was buried I remember rocking back and forth to get some wiggle/breathing room and when it stopped I waited until my mind cleared up, struggling hard to defeat the panic and pain, until assessing g the situation.
Managing that, but still being flexible enough to be useful, is a huge amount of work, at least if you want to do more than just "call this c function".
There is also a srfi for an improved hygiene low level macro facility that is rather elegant. Can't remember the number though. 70-something.
I like that they are lgpl as well. I am a believer in that kind of freedom definition, and I hope you can dual-license it successfully.
(define-syntax nest
(syntax-rules ()
((nest x) x)
((nest x ... (y ...) z) (nest x ... (y ... z)))))
That one is quadratic according to the author, but for 1050 expands of a nest with 6 levels it is less than 10% slower. Whereas in chez scheme, the difference is even less (for more than 2000 expansions)Edit: Decided to stress test the chez scheme macro expader. for 30000 expansions, it was under 1s using the syntax-case version. I'd say that is very much good enough.
The upsides are the same as for a piece table (really simple undo/redo) but with the downside of not being able to just mmap a file. You also get basically zero memory usage when you do cut and paste (you can paste a file into itself until it is bigger than RAM without problems, since you are actually not copying the contents, just the pointer)
Look at the YouTube video as well. It is all very cool, at least if you are not already spoiled by using clojure :)
https://github.com/arximboldi/immer/blob/master/README.rst
Edit: Forgot to mention: Ewig can be found among Immer's author Arximboldi's repos. On my phone right now on GPRS connection, so maybe another friendly soul can provide the link.