freenode/#lisp - IRC Chatlog
Search
16:41:22
Nilby
letrec etc is not needed for this, cons-stream is just a macro. you just have to make delay/force which could most simply be quote/eval or quote/symbol-value.
16:46:16
kevingal
Howso? My stream-cons / scons macro expands to a cons with both of the elements wrapped in a lambda.
16:47:53
kevingal
I initially tried using quote, but that didn't capture surrounding variables so this gave an error: (let ((a 1) (b 2)) (scons (/ a b) the-empty-stream).
16:51:00
pjb
kevingal: but yes, there's no let form in CL that evaluate the initialization form in a scope where the variable is defined. We'd have to write a letrec macro…
17:20:39
pjb
shka_: (loop for i below 10 do (with-simple-restart (continue "continue") (if (zerop (random 2)) (invoke-restart 'continue)) (princ i))) #| 25679 --> nil |#
21:29:56
jmercouris
there is no way to safely call C right? because CFFI relies on the C code returning successfully right?
21:30:50
White_Flame
maybe launch a C thread and wait for its return as a side effect somewhere, with a timeout that blows away the thread?
21:32:20
moon-child
if the c lib allocates, you need some way to figure out what it allocated and copy it through
21:32:50
White_Flame
all depends if the C return value is standalone, or if you need C's side effects
21:33:23
White_Flame
even in a separate process, C could kill the lisp process, unless you make it under another user with low permissions etc
21:37:20
Nilby
It's just difficult. You have to setup up memory barriers, page tables, processor rings, interrupt tables, etc.
21:39:04
jmercouris
I'm talking about within the realm of realistically possible for a single programmer to achieve
21:41:08
Nilby
Right. I think that's the nicest way for Lisp to call C, since then you can use the Lisp debugger and tools.
21:44:44
Nilby
I think the free Lisps could do a better job of making calling C safe. The commerical Lisps seem to do better.
21:50:26
moon-child
I think there was another c compiler written in lisp. Not sure how much progress it had made. The mezzano thing I know was mature enough to run quake
22:08:00
moon-child
I think that was it. Given some of the TODO items, it looks less far along than I thought
1:29:10
pjb
Josh_2: well, I don't know about sly, but if a swank server is running, you connect to it with M-x slime-connect RET
1:30:12
pjb
Of course, if there's no swank server listening, the only solution would be to do a gdb attach to the frozen emacs process, and to try to locate and use the socket connected to the image.
1:31:31
pjb
Josh_2: if this problem occurs often, you could prepare by running multiple swank servers in the lisp image, or some other listening server.
1:39:33
pjb
If it's still connected to emacs, as I said above, you can use gdb to attach to the frozen emacs, try to locate the socket and close it.
1:42:08
pjb
Instead, launch your lisp images separately, run a swank server in it, and use slime-connect instead of slime.
1:42:54
Josh_2
pjb: I will do that, I have been meaning to create a deploy system for this. Lesson learned
2:13:10
Josh_2
I export a macro called 'pkv' from my main package and in a sub package, I use this macro extensively, this package has (use <main package>) in its defpackage, why am I getting an error telling me that pkv isn't defined?
2:16:00
Bike
well, from that description it should work, so clearly there's some devil in the details
2:55:40
White_Flame
if you just C-c C-c an expression, instead of C-c C-k'ing the entire file, it might not have actually run the in-package. I've hit that on simple files
2:59:07
White_Flame
it's weird not to load the full contents of a package before loading another one, though
3:13:10
White_Flame
restarting fixes a lot, but doesn't always tell you where the problem is, especially if it's dynamically munged