freenode/#lisp - IRC Chatlog
Search
9:42:01
on_ion
i am not even sure if i could even have SDL running in a loop in the background with C, hrm
13:29:50
nowhere_man
But still, when I do my (defun eval () ...), I get the error about SBCL's package lock on CL
18:15:20
puchacz
hi, when starting a new thread, what happens to special variables (I think it is the correct term) in the new thread please?
18:16:17
puchacz
by special variables I mean declaring something first in source code with (defparameter *foo* nil) and then binding them dynamically with (let ((*foo* :new-value)) .... (bt:make-thread (lambda ())))
18:17:01
puchacz
so 2 questions really, (1) am I using the term "special variables" correctly and (2) what will new thread see and is it guaranteed or implementation specific?
18:25:58
Bike
puchacz: https://trac.common-lisp.net/bordeaux-threads/wiki/ApiDocumentation see make-thread documentation
18:29:12
puchacz
Bike - "Local bindings are local to the thread they are introduced in," - does it mean that if I want to "copy" a special variable, I need to create a local variable with let first (i.e. normal lexical scope, not rebinding global variable) and then use these variable values in new thread to rebind global variable in the new thread?
18:30:12
puchacz
(defparameter *foo* nil) (let ((*foo* :value)) .... and then (let ((my-foo *foo*)) (bt:make-thread (lambda () (let ((*foo* my-foo)) ... ?
18:32:19
jackdaniel
(bt:make-thread (lambda () (break "~s" *foo*)) :initial-bindings (list (cons '*foo* 3))) ;is an alternative
18:34:11
puchacz
btw, what I called "special variables" are really called special variables, aren't they?
18:37:18
jackdaniel
http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_d.htm#dynamic_variable ; http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#special_variable
18:39:30
puchacz
the key thing for me that "special" really refers to the sequence of defparameter/defvar and let rebinding
18:43:55
puchacz
Bike: there is a property or something stored under the symbol naming the variable, isn't it?
18:44:43
Bike
also you shouldn't think of the symbol-value as being an intrinsic part of the symbol. you're worried about threads, well, generally each thread has its own storage of symbol values
18:46:14
aeth
Bike: What about functions? If I recompile a function in one thread it eventually shows up on the other in its redefined state when the part of that loop comes around. It might not be immediate though, I'm not sure.
18:46:16
Bike
it's symbol. if you (declare (special whatever)) in a scope, whatever will be a special variable in that scope.
18:53:28
puchacz
sometimes I feel Lisp is too complex, but then I remind myself that other languages usually leave these problems as "gray areas" :-)
19:00:36
aeth
What languages have healthy multi-implementation communities? C and C++ and JavaScript immediately come to mind.
19:01:11
aeth
Languages like Python have multiple implementations but there's one true implementation above the rest.
19:02:20
aeth
Schemes might as well all be one-implementation languages. Lua is an interesting case in that LuaJIT might have replaced the one true implementation in most places because of performance.
19:06:39
aeth
SQL might be like Scheme, I don't know enough about it. And I think that's literally it, unless including old languages with competing commercial implementations (Fortran, COBOL, Pascal, etc.)
19:11:16
q1999
anyone developing in sbcl on emacs using slime who is willing to help with a (probably setup) problem?
19:11:33
aeth
If you went into #haskell how many people are using the GHC vs. other implementations? Here, the CCLers are a vocal minority and pretty much every SBCLer who writes libraries tests on at least CCL
19:13:04
aeth
I think ECL is #3 here. It might not be #3 in the Lisp community in general. It's probably really hard to determine a #3
19:17:26
q1999
ok. installed sbcl, using emacs 24.5.1 on windows 7, using slime from elpa. when I create a new package using quicklisp, I can quickload the package and use in-package to move the reple from cl-user to package. but when I close emacse, go to the root, start slime and try to quickload the same package, all I get is SYSTEM-NOT-FOUND. It is driving me up the wall. uninstalled and reinstalled everything except emacs, but still no go.
19:20:38
q1999
I start slime from dired buffer or test.lisp buffer, the package asd and lisp are one folder (named after the package) down. starting slime from within that folder results in the same pesky SYSTEM-NOT-FOUND.
19:22:36
Xach
q1999: not at all. you can put stuff anywhere. but you do have to teach asdf how to find it (or put it in a place asdf already knows about).
19:23:07
Xach
q1999: one easy way to teach asdf is (push "c:/Users/.../path/to/project/" asdf:*central-registry*)
19:23:32
Xach
q1999: quicklisp also extends asdf by making it search <quicklisp-directory>/local-projects/ specially.
19:24:04
Xach
there are ways to teach asdf to scan directory trees. i find the asdf config syntax too complicated to remember so i don't use it much.
19:25:20
q1999
ok. I'll first try the push. (I was following Baggers on youtube and there was no mention of this. probably should have rtfm, right?)
19:27:08
Xach
q1999: I'm not sure - it's something that you internalize fairly early, so maybe it wasn't on his mind to explain
19:31:36
q1999
I tried a quick and dirty, but for now no success with the push. think I need to mess about a bit, read about the manual about push.
19:36:13
pjb
q1999: in general, I would advise to use #P"" instead of strings for paths, notably if they contain system specific notations (eg. ~/ on unix, C: on ms-dos).
19:36:43
Xach
q1999: what do you get if you try (probe-file "c:/Users/SENNAC/Desktop/Fotos/Nieuwe map (5)/bit-stream.asd")?
19:38:57
pjb
Now, with *central-registry*, you may want to use pushnew: (pushnew #P"c:/Users/SENNAC/Desktop/Fotos/Nieuwe map (5)/" asdf:*central-registry* :test (function equalp))
19:39:23
pjb
q1999: probe, like open, merges the path with *default-pathname-defaults*, not with the paths in asdf:*central-registry*.
19:40:13
pjb
(find-if (lambda (*default-pathname-defaults*) (probe-file #P"bit-stream.asd")) asdf:*central-registry*)
19:46:10
q1999
tried the pushnew but am now on a merry go round, lol. there is a bit-stream.asd in the dir.
19:48:12
q1999
after the pushnew and a ql:quickload :bit-stream, slime came back with: (ql:quickload :bit-stream)
19:58:59
q1999
thanks for now Xach and pjb. I'm parting to have a closer look at asdf registry docs and your feedback. If you don't see me back soon, your input helped to solve my problem.
20:03:35
aeth
Is there a way to print a CLOS object and all of its slots? The debugger is not a good solution because there are just so many objects. I have to dissect them programatically.