freenode/#lisp - IRC Chatlog
Search
19:18:02
sea
(defun bar (x) (+ x (foo))). How can I make it evaluate that foo once, and store 42 in bar instead?
19:22:08
sea
I have a macro that compiles code to lisp, and I have a function I'm defining with one of those macros in it. I realized that every time I run the function, it re-compiles the code in it for no reason, and I wanted to avoid that
19:28:56
ealfonso
how can I avoid an undefined variable warning when using (cffi:defcvar ("my_var" my-var) :int) and then referring to my-var?
19:32:57
ealfonso
Bike https://pastebin.com/H8SEkxL4 I'm simply referring to the defcvar variable with setf
19:33:48
Bike
ealfonso: i believe defcvar is intended to be used at top level. the compiler won't be aware of the definition while compiling init-lib.
19:35:24
Bike
since defcvar just establishes a symbol macro it's largely pointless to do it at runtime, anyway
19:39:27
pierpa
sea: maybe you can do the computation at read time? (defun foo (x) #.(compute-something x))
19:40:16
sea
That's just the example code. I wanted something slow to take up time, so I could figure out if the macro was being run at compile-time or run-time
19:41:00
Bike
if you just evaluate it it could go either way, but in most implementations now it'll still be expanded just the once.
19:46:17
sea
Hrm, it's still slightly slower than it should be. I took the macro bit out altogether and put it as a global variable it can reference
19:51:25
sea
Maybe it's down to how I write my macros? Is there a better way to do this: (defmacro foo (x) (list 'quote (f x))) ?
19:55:53
ealfonso
any idea why something simple like this causes my sbcl instance to run out of memory and crash when it works fine in C: (cffi:with-foreign-object (g :pointer) (cffi:foreign-funcall "my_alloc_new_very_small_struct" :pointer))
20:12:23
ealfonso
Bike I was calling a binary function with zero args, so there was probably uninitialized data causing a huge malloc
20:59:14
Xach
rme: Sorry to bug you, but ccl.clozure.com is not working for me - what does :SHARED mean in make-hash-table?
21:01:02
Xach
rme: Trying to adapt some sbcl code which uses `:synchronized t` to mean "concurrent writers are safe", so that's my real question - how to get safe concurrent writers for ccl hash tables.
21:04:16
rme
They use a lock-free algorithm which is good for typical access, but slower for rehashing or growing the table.
23:33:53
jasom
Any hints for a fully-remote slime debug; I can connect to slime remotely and use tramp for opening the remote files, but do I need to do anything to get them all to play nicely together?
23:34:13
jasom
also if someone has a script for setting up a slime-over-ssh tunnel easily that would save me some time
0:16:39
cgay
Somehow never saw this before. Fun read. https://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-style.pdf
5:29:37
drmeister
::notify shiho Pull the latest clasp 'dev' and start building it again. I had introduced a problem in the previous version that only showed up when building quicklisp. The new 'dev' fixes it.
6:14:59
phoe
before I connect to the slime, I mount my Lisp projects directory using sshfs on the same location, so /home/phoe/Projects/Lisp/ refers to the same directory with the same contents both on the remote machine and the local one.
6:15:28
phoe
this way I avoid problems with translating names from local to remote ones, because they are the same.