freenode/#lisp - IRC Chatlog
Search
7:46:11
on_ion
whoa, cant do underscores in function/symbol names? (defcfun "XT_Alpha" :void) => XT-ALPHA
7:56:04
edgar-rft
on_ion: yes, you can, but defcfun is not part of the ANSI standard, so its behaviour is implementation-dependent
8:00:36
on_ion
i dont understand this, however: name ::= lisp-name [foreign-name] | foreign-name [lisp-name]
8:10:58
beach
on_ion: I strongly recommend you program in Common Lisp rather than in some other language.
8:12:12
on_ion
just because the libraries i am interfacing are trying to be their own utopian api system platform environment
8:14:36
on_ion
i have been having troubles with SDL and the REPL, SDL wants to take over the world and be its own exclusive thing, and i just want to lisp
8:15:08
beach
Yes, more often than not, using foreign code creates problems rather than solving them.
8:15:52
on_ion
yea.. and its driving me bonkers. just decided today to stuff everything ugly into C because i need lisp
8:17:01
on_ion
SDL has its own thread stuff and whatnot, ive seen countless ways of dealing with it in CL, amongst the various SDL1/2 bindings for CL, and i'm accustomed to doing SDL/opengl by hand and C anyhow. it feels really good also, which is the most important to me
9:28:23
ludston
It's working pretty great for me though. I wound up hacking on slime a little though
9:30:11
ludston
Step two, pop (swank:handle-requests swank:*emacs-connection* t) somewhere in your (:idle) so that you can still use the emacs repl
9:31:28
on_ion
there were threading quirks and input event handling anomolies , works good right now though by using a C lib
9:32:57
on_ion
i want to evaluate code and type stuff in repl while the SDL window is rendering its loop
9:33:18
ludston
Yes, I don't think you understood what I mean by pop (swank:handle-requests swank:*emacs-connection* t) somewhere in your event loop
9:34:35
ludston
And also, any changes that you make via slime will be evaluated at a safe time during the event loop
9:38:25
on_ion
https://github.com/quakerquickoats/hoovy/blob/master/nova-cl/nova.lisp <-- stuff on the bottom here
9:40:55
on_ion
hmm =) i wonder if its similar to that lisp file there, or how a simple "thing" could be distributed for anyone to use
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.