freenode/#lisp - IRC Chatlog
Search
13:49:01
beach
shangul: There is no widely agreed-upon definition of "Lisp", so we avoid the issue by only dealing with Common Lisp, which *is* well defined.
14:12:32
shangul
beach, I'll be thankful if you upload it somewhere and give me the link to download :)
14:13:19
beach
Just ask frodef. He comes to #sicl regularly. Or send him email. I don't know how up-to-date my code is.
14:17:59
edgar-rft
shangul: I think https://gitlab.common-lisp.net/movitz is what you're looking for
14:22:49
edgar-rft
Sorry, I don't have a prebuild image, but here's a description how yow you can make one yourself https://trac.common-lisp.net/movitz/wiki/FromNothingToImage
14:25:24
edgar-rft
But *sigh*, again dead source-code links. This seems indeed a thing only frodef can solve.
17:14:33
interruptinuse
hey #lisp, does anyone know of a way to use GNU readline with (read-line) (clisp, mainly)? if I use (read-line) in a REPL, it supports line editing, but doesn't in batch mode
17:16:29
asarch
Is it really bad to do (defclass my-window (glut:window) ...) and then (defmethod glut:display ((w my-window)) ...)?
17:17:35
asarch
I've tried with (defmethod display ((w my-window)) ...) but the main process cannot use it
17:17:59
interruptinuse
Josh_2: i don't need completions or whatnot, but clisp batch-mode (read-line) by itself doesn't support line editing, which would be comfy
17:21:16
interruptinuse
file.lisp is a standalone program which has a small REPL of its own, and will likely be executed in batch mode as `clisp file.lisp`. it evaluates strings which are read by read-line. how can I use line editing with this setup?
17:23:16
interruptinuse
my last resort atm is ffi-ing readline, which is not that bad, but i was wondering there's something built-in i could exploit
17:29:20
Bike
read-line itself doesn't have line editing, it's just waiting for your terminal, i think
17:30:00
interruptinuse
the first one is in batch mode, when you go `clisp file.lisp`, and it doesn't do anything except read stdin
17:30:47
grewal
According to this, https://clisp.sourceforge.io/beta/impnotes/readline-mod.html, clisp has builtin support for calling readline
17:31:27
Bike
interactive read-line isn't different. it's just waiting for an actual line to appear on stdin. i think.
18:01:18
pjb
Then the description insists: "readline will read a line from the terminal and return it"
18:01:36
pjb
"from the terminal" = interactive. There's no batch here. And in batch, there's no terminal!
18:03:23
pjb
later, it says about bash: "The editing mode may be switched during interactive use by using the -o option to the set builtin command. "
18:03:48
pjb
Notice that they don't say that the editing mode may be switched during *batch* use. But explicitely during *interactive* use!
18:08:19
interruptinuse
pjb: my understanding of clisp's "batch mode" phrase is that it means compiling or running files without a REPl
18:12:16
interruptinuse
so the answer to your question is "read from stdin with appropriate termios, hopefully with the help of readline, which makes that easier", which to my understanding isn't forbidden by laws of nature
18:14:58
interruptinuse
(also also, what do you mean by "where do you get keycodes from"? you specify the interpreted file on the cmdline, so stdin is still available)
18:50:48
pjb
Well I cannot test it, it looks like my clisp has been compiled without readline anyways.
18:51:21
pjb
I guess you could just use rlwrap: rlwrap clisp -norc -q -ansi -x '(read-line *terminal-io*)'
18:55:17
interruptinuse
m clisp's behavior differs between -x and passing a file, for what it's worth
18:59:25
interruptinuse
(read-line *terminal-io*) actually works without rlwrap in batch for me, not sure how portable that is
19:04:11
interruptinuse
pjb: i was going to go with using clisp's ffi readline module, but with having to configure it to disable completion (because common lisp completion doesn't make sense for a dsl)
19:04:40
interruptinuse
but on second thought, actually offloading all that to rlwrap and running with -disable-readline might be easier and more portable
19:05:34
pjb
That said, I don't understand why you want to do that in batch mode anyways. This is not how to use clisp interactively.
19:31:26
asarch
If I have: (defparameter *pos* (make-instance 'point :x 0 :y 0 :z 0)), is there any shorthand for the C++ pos.x += delta;?
19:35:11
Bike
if you want something other than +, you can use define-modify-macro, or alexandria comes with a few
19:42:11
asarch
Also, chapters 16 and 17 of "Practical Common Lisp" by Peter Seibel: http://www.gigamonkeys.com/book/
21:00:08
asarch
How is better when you have an if-else with several lines of code? Is it (if (foop) (progn ...) (progn ...))?
21:05:04
asarch
Well, this is a simply condition to initialize the OpenGL scene: if (antialias) { /* do the operations for anti-alias */ } else { /* do operations for a normal rendering */ }
21:37:36
aeth
The only time you need not null or not not or whatever to get the actual value t is if you're storing the value.
21:39:42
aeth
because a lot of the time the truthy value could be anything, including e.g. a database connection that disconnects in a finalizer (and you just added a reference if you store it)
21:54:21
stylewarning
yes it's equivalent to (if x ...) but I think sometimes the emphasis is good to bring you from the type (OR NULL X) to the type BOOLEAN.
21:55:06
stylewarning
(you get used to it when you program in a strictly typed language for a little while, which I think is positively hygienic for Lisp code)
22:31:03
aeth
asdf_asdf_asdf: if that's a question, that means an integer that is at least 3, but it does nothing because you didn't actually declare any variable to be of that type like e.g. (let ((x 42)) (declare (type (integer 3) x)) x)
22:31:44
aeth
The syntax is a bit awkward. Most people with declaration-heavy code write (or use) macros to generate it
23:29:53
dim
phoe: as you said you're interested in contributing to pgloader, I made myself a Pull Request rather than just pushing on master as I would usually do, so that you can review some CL refactoring of the code: https://github.com/dimitri/pgloader/pull/970
23:30:22
dim
it's moving some copy/pasted parts into a generic function API with a common implementation, now that I have 3 copies of the same thing lying around
23:31:03
dim
if you feel like reviewing that PR is useful for you, let me know, otherwise I'll just squash-merge it ;-)
23:40:31
dim
as you see fit, there's no timing that I care very much about here, and it's only if you find it fun/interesting of course
0:24:33
mr_yogurt
is my emacs not indenting correctly or is the else part of an if supposed to be indented less than the then part
0:26:30
no-defun-allowed
in elisp, IF is defined like (defmacro if (test then &body else) ...) when in CL it is (defmacro if (test then else) ...)
1:09:22
anamorphic
In ACL there's a feature of the inspector that shows the objects that reference the object you're inspecting. Is there anything like that for SBCL or CCL?
1:20:58
no-defun-allowed
Typically, you just mark a trace with a bit in mark-sweep, or you just copy it.
1:21:22
no-defun-allowed
And the data wouldn't be around till you GC too, and in the case of copying it would be invalidated quickly.
1:22:50
no-defun-allowed
Then I think there would be another mark step needed too, but this is above my pay grade.
1:22:50
p_l
no-defun-allowed: special region that isn't GCed with normal algorithm (for example ZL:DEFRESOURCE or essentially a large unboxed array)
1:23:01
aeth
It would be cool if it was more than just working with the heap. It would be fun to see what objects have "42" in them.
1:25:05
anamorphic
I can't put much on the heap to really try it out. It's the "express" edition of ACL and has memory limits
1:25:50
aeth
You have to pay close attention, but I'm sure you can notice that sort of thing. And 700 definitely
1:26:04
White_Flame
ah. Well, my guess is that it's a heap scan. SBCL has a heap scanner, but maybe not something to detect references like that
1:26:28
aeth
It's weird when you make yourself pay attention to lag, e.g. move your mouse one pixel and see the delay.
1:29:13
p_l
of course this varies, these days I might move from happy go lucky to "stop blocking the isle you ......" in 700msec ;)
1:29:42
anamorphic
Oh cool, CCL does seem to have something similar: map-heap-objects, find-references ...