freenode/#lisp - IRC Chatlog
Search
17:55:33
markasoftware
How might I simplify (setf (nth (third node) to-return) (nconc (nth (third node) to-return) (list i))) ?
17:56:10
markasoftware
to-return is a list. I want to append the element i to the end of a certain sub-list of to-return
17:56:55
markasoftware
i can't just use nconc and rely on its mutation, because if (nth (third node) to-return) is null, it obviously can't modify nil.
17:58:07
pjb
markasoftware: you write an appendf modifier macro (or use one from a library, but since it's a one-liner…)
18:12:11
markasoftware
is there any reason i should use (append) instead of (nconc) as the function passed to define-modify-macro?
18:12:51
pfdietz
Safety? A common source of bugs is destructive modification of things that share structure with other things.
18:22:16
antonv
hi, is there a way to run a lisp in rowsell in non-standard readtable case? Like modern Allegro mode.
18:36:46
markasoftware
is the lambda-list for define-modify-macro exclusively for the purpose of limiting the number of arguments?
18:55:28
markasoftware
when a global variable is bound, what exactly is it bound to? Does it have its own name, or is it simply bound to a symbol, and uses the symbol's name?
18:58:16
jackdaniel
markasoftware: when you have the object with slots, some of them may be not bound
18:59:24
jackdaniel
also please see the glossary entry for "unbound variable" here http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_u.htm#unbound_variable
19:00:31
jackdaniel
I've mixed slots and variables here because I was looking for an examples of unbound places
19:04:52
markasoftware
if a variable can be directly bound to a value, why do we need a value cell on symbols?
19:29:35
peey
Is there any syntax in lisp which lets you use a symbol before its definition? e.g. something like (where (set-union s1 s2) (define s1 ....) (define s2 ...))
19:31:21
Bike
(defmacro where (form &rest bindings) `(let (,@bindings) ,form)), then (where (set-union s1 s2) (s1 ...) (s2 ...))
19:33:44
peey
Bike: Good enough. This should be a package. I think I'm remembering this because it's a standard way to write things in haskell
20:24:35
Shinmera
I recommend writing code in the conventions established in that language. Trying to carry over conventions from other languages will only prevent you from truly learning the new one, and will hinder others reading your code.
20:47:43
White_Flame
markasoftware: when a variable is bound to a global's value, it copies that value from the symbol-value into your local variable. The symbol-value is the canonical container for that named value
20:48:03
White_Flame
specifically, I'm describing (let ((my-var *some-global*)) ...), as that seems to be what you're describing
20:49:19
p_l
antonv: you'd probably need to prepare such a lisp yourself as an application. Not sure about reusing mlisp itself
4:26:12
beach
In the past, I imported lots of stuff from the host, so a REPL was reasonable in that it had most of the Common Lisp standard stuff in the environment.
4:28:31
beach
In particular, since those instructions were written, I decided to incorporate the compiler in the initial executable, so the last environment needs to contain the compiler, which is a big step.
4:30:53
beach
And the reason for that decision was that I decided to use a printed version of the AST as the FASL format.
4:32:38
fiddlerwoaroof
Cool, I've been pretty busy recently, so I haven't written all that much CL lately
4:33:36
fiddlerwoaroof
I've been picking up my code for using the Mac's UI toolkit from CL to hopefully get it to the point where I can create a McCLIM backend
5:02:18
fiddlerwoaroof
I also came up with this little modification to the pprint dispatch table to make the printed representation of hash-tables more useful: https://fwoar.co/pastebin/95a292289ca0477ac0d29e070165c82222dd5ddc.lisp.html
5:04:40
fiddlerwoaroof
The output looks like this: https://fwoar.co/pastebin/25fa31be1332c7e8461a1785e48017de1bf460ca.nil.html
5:29:10
fiddlerwoaroof
I probably should, it was something I put together quickly that's proved to be useful
5:31:37
fiddlerwoaroof
Yeah, that (or just paying attention to *print-length*/*print-level*) would be a good idea
5:31:57
fiddlerwoaroof
It's a bit mitigated by the fact that this only applies when *print-pretty* is T (in LW, at least)
5:33:23
fiddlerwoaroof
I originally put it together for formatting the results of org-mode code blocks
5:34:12
fiddlerwoaroof
And I've been copying it into new projects and tweaking it to be more featureful