freenode/#lisp - IRC Chatlog
Search
20:31:47
Josh_2
So I downloaded CLX with quicklisp, and slime is saying that (clx:open-display .. ) isn't recognized. What's the package name?
20:52:20
Josh_2
When (open-display .. ) asks for host it's asking for my computers hostname or localhost I assume?
20:53:50
Xach
Josh_2: in the past I've used (xlib:open-default-display) to have it try to connect to the display set in $DISPLAY
23:13:51
borei
trying to find more or less detailed documentation on VOPs, but failed. Only couple articles. Any hint is more then welcome
2:35:43
White_Flame
although that's equivalent to (+ 3 3), so having a function there that's called doesn't make a lot of sense
2:37:58
White_Flame
asarch: you can either evaluated (defun foo ...) right in the REPL, or you could edit a source code file by inserting that DEFUN with emacs/SLIME and load it in. Both methods will immediately have your function available to call.
2:38:51
White_Flame
and you don't need to type in uppercase. The reader auto-upcases text internally when reading symbols
2:39:29
White_Flame
there's also the #clnoobs channel, which might be more appropriate for this level of question
2:42:58
White_Flame
you can just do a plain (let ((a 1) (b 2)) (format t "~a ~a~%" a b)) to scope in Lisp
2:44:23
asarch
Because I could do in the first 5 lines of my code: (defun foo () ...) (foo), and then later in the line #1000 recall foo: (foo)
2:45:03
White_Flame
you can call (foo) after (defun foo ...) has been executed, and you can manually mung with ordering
2:45:52
White_Flame
JS is a very, very weak language when it comes to scoping & controlling source code ordering
2:46:02
White_Flame
so you really don't have to worry about a ton of stuff that JS makes you worry about
2:46:33
White_Flame
(of course, later versions of JS are cleaning things up, but your examples are kinda oldschool JS)_
2:47:15
White_Flame
so a lot of "How do I do <some JS thing>?" will be answered with "You don't need to"
4:02:13
JuanDaugherty
on the debian vs slime, the time came when all the debian cl things were completely removed
4:13:06
krwq
hey, why does this code produce warning that *foo* is undefined? (defun foo () (defvar *foo* 0) (incf *foo*))
4:14:49
Bike
the defvar is not run at compile time, so the compiler doesn't know that *foo* is special as it compiles the incf
4:15:57
Bike
if you need a special variable that's only used in one place, you don't need to use defvar, either
4:17:44
krwq
scenario is following: I want a macro which makes a non complicated place thread safe, i.e.: (defun pformat (control-string &rest args)
4:20:05
Bike
(with-gensyms (lock) `(let ((,lock (load-time-value (bt:make-lock)))) (bt:with-lock-held (,lock) ,@body)))
4:20:58
Bike
now, if you just had (let ((,lock (bt:make-lock))) ...), that wouldn't work since it would make a new lock for each time you execute it
4:21:17
Bike
load-time-value is a special operator that makes its operand be evaluated only once, when the fasl is loaded, and reused thereafter
4:21:42
krwq
Bike: I assume this will work also when I just load a file (ok if it redefines it then)
4:23:01
Bike
but then, if you're just loading the macro could be expanded more than once, giving it different gensyms anyway
4:23:49
Bike
(incf x) is just (setf x (1+ x)), it doesn't modify the value of x, just changes what it's set to
5:36:02
iqubic
I have a few questions about slime. There are a few places where the docs are woefully inadequete. 1) What does the STRING argument do in (slime-eval-print-last-expression STRING) and 2) What does the PREFIX argument do in (slime-eval-last-expression-in-repl PREFIX). I'm trying to call these from my init.el, but I can't because these are required arguments.
5:38:16
drmeister
If I have three lists '(a b c) '(d e) '(f g) and I want every combination of the first, second and third lists - what is that called? Outer-product? Cross-product? Is there a CL function to do this?
5:40:23
beach
I don't know what it is called, and there is no standard function to do that. You will have to write it yourself.
6:49:31
asarch
In PCL, chapter 8 there is a paragraph: "Common Lisp doesn't support macros so every Lisp programmer can create their own variants of standard control constructs any more than C supports functions so every C programmer can write trivial variants of the functions in the C standard library." Is it correct?
7:02:43
stacksmith
Nah, it's like "I don't work hard so my kids will waste my money" - does not mean that I don't work hard. Just unfortunate turn of phrase.
7:03:39
stacksmith
The point is that although you could change standard constructs, it does not mean that that's what macros are for.
7:53:02
panji
I am wondering what advantage using funcallable instead using method like in this sample https://gist.github.com/epanji/c93fea8ed9f7adaafb0a782f877dcc1b
7:53:23
panji
My understanding about metaclass is not that good, so i always wondering when the right time to use metaclass?