freenode/#lisp - IRC Chatlog
Search
1:17:44
_death
if, say, TITLE is not supplied, its default value is NIL, so the alternative branch of the IF is evaluated, in this case the form T, which evaluates to T, which is not NIL therefore true
1:17:56
HiRE
the `t` is in the false half of the if statement, so if it isn't supplied it just defaults true
1:23:13
HiRE
usually I'll learn a language by doing practice problems but since lisp is so different I figured learning from first principles was the best idea
1:24:02
gabc
I use it now as a reference when I want something clear for details (like &key and &optional or `loop')
1:26:45
aeth
HiRE: Imo tThe main distinction besides the syntax that makes it different is that nearly everything is an expression that returns a useful value
1:27:25
HiRE
aeth: yeah its a really nice idea. The result is very clean. At least as far as I've seen from chapter 3 the code is remarkably clean.
1:30:45
gabc
Just keep in mind that the cleanliness is not actually true and that you need to know when it isn't as to avoid pitfalls
1:39:41
Odin-
The Lisp 1.5 manual makes for some ... interesting reading when your chief exposure to Lisp is modern CL code.
2:02:32
Xach
clothespin: I think you can do that by doing (setf (sb-ext:bytes-consed-between-gcs) <some very large number>)
2:10:41
HiRE
clothespin: you could also look at the programming language benchmark game. They use SBCL and iirc they run it without a gc
7:58:35
smokeink
https://paste.ofcode.org/kYr5SRgtsJsAP56jnSYTC7 adventures in debugging in slime and without slime. Any idea how to solve this mystery ?
8:00:02
pjb
HiRE: it wasn't such a stupid question. Some older lisp systems would have given a better error message, suggesting you use :supersede instead…
8:13:50
smokeink
; the issue: stepping when break is reached in (bt:make-thread #'f) doesn't work in SLIME and doesn't work in the console either. How to make it work?. theoretically it should work because (f) in SLIME (a non-main thread), as well as in the console (main thread), works (can be stepped). there is no -apparent- reason (bt:make-thread #'f) shouldn't be steppable
8:41:47
ym
Is there Emacs mode for showing car (function/macro name or just first element) of a list, when point (cursor) is after closing parenthesis?
9:08:28
jackdaniel
maybe when break is caught outside the swank debugging environment it should create one?
10:55:23
smokeink
I want to write a function that transforms some code (checks the cdr of each subtree and when it encounters certain symbols, replaces them with some data). Should I write it all by hand or should I use a code walker? what are code walkers used for?
10:56:51
no-defun-allowed
A code walker is used when one has to respect lexical scoping while replacing code.
10:56:54
pjb
(defun foo (some-code) (subst '(some data) 'certain-symbol some-code)) #| --> foo |# (foo '(if certain-symbol (print 'certain-symbol))) #| --> (if (some data) (print '(some data))) |#
10:57:38
no-defun-allowed
For example, it might be okay to substitute X in (+ x 2) but the client would expect a their own value for X in (let ((x 4)) (+ x 2))
10:57:44
pjb
smokeink: yes, you need to code walk. (foo '(list certain-symbol (let ((certain-symbol 2)) (+ certain-symbol certain-symbol)))) #| --> (list (some data) (let (((some data) 2)) (+ (some data) (some data)))) |#
10:58:21
no-defun-allowed
And, yeah, as pjb says, for respecting the meanings of symbols in special forms too.
11:12:48
smokeink
I need to replace only symbols at certain positions, for example in (* * *) I'd like to replace only the 2nd and 3rd '* . I was thinking to improve #'trec from http://lib.store.yahoo.net/lib/paulgraham/onlisp.lisp , to make it record the current position for each leaf
11:14:49
smokeink
Then i want to make something more complicated : for symbols starting with i! to add (declare (ignorable ...)) at the right position , so I need this ability to modify things at certain positions in the tree
11:18:48
smokeink
I was curious if there are utilities to assist such tasks. why do people write so many macroexpand-dammit, macroexpand-all code walkers?