freenode/#lisp - IRC Chatlog
Search
14:41:20
jackdaniel
I'm not going to track changes in ASDF 3.2 and later - changes are too vast and backporting changes would require reimplementing things introduced in this line
14:54:03
jackdaniel
no, adding make-build could be done outside asdf. I don't that it changes in a way, that makes older systems obsolete
15:09:42
FareTower
I could reinstate a mostly-compatible make-build, as in a mail I sent earlier (or was it a gitlab thread?)
17:08:02
jackdaniel
no, as I've said I don't like where asdf is heading (i.e placing itself in place of the standard addendum without clear spec instead of being a build system)
17:49:22
minion
amop: The Art of the Metaobject Protocol, an essential book for understanding the implementation of CLOS and advanced OO. See the sepcification of MOP at http://www.alu.org/mop/
17:59:30
beach
easye: Notice that the copyright of the mop.lisp.se site is totally contrary to the wishes of the authors of the book: "This HyperText version is copyright 1997 by Elwood Corporation, and permission is granted to use it and reference it as a normal HTML document, and to make and distribute copies provided the copies are complete and unmodified."
18:00:04
beach
easye: That is why I felt obliged to start from the TeX source of the book to make a better version.
18:00:50
easye
beach: Much better. Thank you. We should figure out how to get stastats to update minion.
18:01:10
minion
There are multiple help modules. Try ``/msg minion help kind'', where kind is one of: "lookups", "helping others", "adding terms", "aliasing terms", "forgetting", "memos", "avoiding memos", "nicknames", "goodies", "eliza", "advice", "apropos", "acronyms".
18:01:21
minion
To add a term, say something like ``minion: add "term" as: the definition''. I will remember the definition.
18:03:06
easye
What "add" means in the context of revision will take some experimenting. But point taken, beach.
18:10:53
minion
amop: amop: The Art of the Metaobject Protocol, an essential book for understanding the implementation of CLOS and advanced OO. See <http://metamodular.com/CLOS-MOP>
18:56:30
sebboh
Hi all. Suppose I want to do something like (foo "stuff!" :color "grey" :fontcolor "light grey") ... but I have a bunch of nodes that are going to be grey. Can I make a macro (or something) that would enable me to just do (foo "stuff!" (grey)) ?
19:26:56
sebboh
I tried something like (defmacro grey () :color "grey" :fontcolor "light grey"), and I was able to execute that (thus defining my macro).
19:29:30
sebboh
Maybe I'm just thinking of c-preprocessor macros when I try to use macros to address this particular situation.
19:30:05
sebboh
I think I could make (grey-foo ...) which just calls foo, but with some grey stuck in there.
19:30:34
sebboh
This is why I don't know macros, btw, and anybody with a far reaching channel log can confirm that. ;)
19:31:06
oleo
and you have a base construct you want to get literal with the parts in it changeable at runtime so to say.....
19:31:17
sebboh
I know what those words template and polymorphic mean, generally speaking, but I don't know if you're using them in a general sense or not.
19:33:47
oleo
and then arrange the parts which should be changeable at run-time given the arguments (you unquote them via , or ,@ (if it's a mpv argument like a list or so) with just , it gets evaled with ,@ the arguments gets spliced at the point you specify
19:40:52
Bike
or you could do (apply #'foo :fontcolor "light grey" defaults) where defaults = '(:color "grey")
19:41:31
sebboh
emaczen: your terminal emulator may have a setting that specifies what to do when it encounters a #\bell (ASCII 7).
19:44:41
oleo
emaczen: can you hear a sound with it in your normal konsole or terminal in your Desktop Environment ?
19:45:30
sebboh
emaczen: I don't know what emacs does with bell characters. I dunno if (beep) uses the bell character.
19:46:26
oleo
yes but emacs may change stuff on the fly as to not bother with system settings etc....
19:48:43
sebboh
emaczen: if you set a buffer to emacs-lisp-mode you may find it works there, too. I dunno.
19:50:06
sebboh
If your goal it to make a noise happen, if it doesn't have to be an ascii bell character, then you could just make sbcl play a sound.
19:58:02
emaczen
sebboh: It would be cool to do something like: (ffi: "println(7)") -- apparently 7 is the code for #\bell
20:01:16
_death
interestingly, the emacs ding function appears just before a function called bitch_at_user, that also beeps in certain circumstances
20:18:46
emaczen
I'm following this example: http://stackoverflow.com/questions/30799084/where-is-the-text-printed-by-c-printf
20:20:38
sebboh
the thing is emaczen, where are you going to print to? What is your target stream? I think slime has grabbed some (all?) of your streams. If you go into a shell and do an echo $ascii_bell_character and it beeps, it is your terminal emulator that makes the noise.
20:21:32
sebboh
Is there some package available via quicklisp that has common file operations such as copy and rename?
20:36:46
sebboh
regarding my question about file operations, I'm just going to use trivial-shell and call /bin/cp :P
21:32:08
rumbler31
sebboh: I believe UIOP, usually bundled with ASDF, covers file system operations in a cross platform way
21:36:01
easye
rumbler31: realistically, I don't think ASDF is ever distributed *without* UIOP at this point.
21:38:26
rumbler31
I didn't want to make too many affirmative statements. I was under the impression that UIOP was written by the author of asdf to solve this problem in a portable way
21:48:59
John[Lisbeth]
If I am forming an entire list that needs to be reversed is it more efficient to form it then reverse it or is it more efficient to forming it by appending the value to the end of the list each time?
21:58:50
pjb
John[Lisbeth]: on some old architectures, it was more efficient to push and nreverse it.
21:59:53
pjb
John[Lisbeth]: but nowadays, I would say that if your list is bigger than your cache (depending on the level? VM, L1, L2?), it will be faster to build it in order, but if the list is smaller, then it will be faster to nreverse.
22:13:47
sebboh
rumbler31 was right: (uiop:copy-file "/media/sf_projects/diagrams/work-todo.png" (format nil "/media/sf_projects/diagrams/work-todo/~A.png" (get-unix-time)))
22:14:28
sebboh
internally I guess it uses a syscall and is probably an order of magnitude faster than my previous method, calling /bin/cp
22:19:17
jasom
didi: because nth only operates on lists, and traditionally going past the end of a list returns nil
22:29:39
minion
phoe, memo from pjb: in CLUS, it would be nice if the parts that are identical to CLHS were distinguishable from the part that you re-phrased.
22:30:23
phoe
pillton: and AFAIK taking a 10th element of a 4-element array is an error, therefore undefined.
22:39:47
_death
the clhs gives hint as to why nth works that way, with its equivalence to (car (nthcdr ...))
22:40:01
pillton
phoe: Which falls back to 'Except as explicitly specified otherwise, the consequences are undefined if these type restrictions are violated.' in clhs 1.4.4.3.
22:43:59
pjb
however, both are accessors, and (let ((l (list 1 2))) (setf (nth 42 l) 0) l) #| ERROR: 42 is too large an index for SETF of NTH. |#
22:46:00
_death
(setf (car nil) 42) is also an error.. it's just the implementors doing you a favour with a nicer reason
22:50:51
_death
(actually, there's no need for it to be a place, since (car ...) designates a place.. yet another indicator that I need to go to sleep ;)
22:57:06
azzamsa
found good random pic Lisp https://i.warosu.org/data/g/img/0435/14/1407753601833.jpg
23:10:46
sebboh
Is there some reason (let ((multi-return (fun-that-does-multi-return))) (log:debug (nth-value 1 multi-return))) doesn't seem to be storing the multiple return items into multi-return and then letting me access them at my leisure?
23:11:26
sebboh
I'm willing to accept "you don't know how to use let" as the root cause, but I-- ok.
23:15:39
didi
If you are designing a queue data type, popping from an empty list: 1. errors 2. returns nil 3. returns (values nil nil), like `gethash'?
23:17:19
aeth
There are two common ways to do a queue, one uses lists and the other uses vectors. You don't need to use lists.
23:17:31
rme
In (prefix) dylan, you could say (bind ((foo bar baz) (values 1 2 3))) ...). I've seen at least a couple of attempts at fancy alternative binding macros that try to unify let/m-v-b/etc.
23:18:28
didi
aeth: Thanks, but the implementation is not an issue right now, but how the function should behave when receiving an empty queue.
23:19:28
aeth
didi: If you want to make it parallel stacks (which are built-in), they just return NIL when empty, e.g. (let ((foo (list 1))) (pop foo) (pop foo))
23:21:22
didi
I am abstracting the underlying implementation, so I feel I can choose another way. I am not sure which one tho.
23:22:09
aeth
The other stack in CL errors with "There is nothing left to pop": (let ((foo (make-array 3 :adjustable t :fill-pointer 3 :initial-contents '(0 1 2)))) (vector-pop foo) (vector-pop foo) (vector-pop foo) (vector-pop foo))
23:39:36
sebboh
pjb, I see. I am not aware of a situtation where I'd rather use multi-vals than a list. Probably a common use case is so that the extra values are there if you need them, but you want access to the first value by default. Seems like a job for a quick (car ...) or (first ...) to me, but obviously there's some reason.
23:41:27
pjb
sebboh: building lists is slow (you have to store them in memory). multiple values stay in the registers.
23:44:23
aeth
sebboh: Ime, multiple values are a good way to represent a small number of things, better than even arrays, let alone lists.
23:49:26
aeth
I would hesitate returning more than 4 values, though. I'm sure at some point, implementations become inefficient, but I'm not sure where the modern limit is.
2:24:32
defaultxr
is it possible to change a readtable only while a specific function or macro is being read? i have a function like (defun foo (&rest bar) ...) and i would like to be able to split the 'bar' parameter up by newlines, without affecting how newlines behave for other functions.
2:25:21
defaultxr
additionally i don't want to have to change the readtable manually before and after each invocation of 'foo'
2:28:25
defaultxr
yeah, i'd like to be able to differentiate whitespace from newlines, so i know where the newlines are in the arguments, rather than them just being treated as normal whitespace
2:29:12
defaultxr
so if it's called like (foo 5\n4\n3 2 1) i would be able to split it up to get something like '((5) (4) (3 2 1))
2:30:20
Bike
yeah, that's not possible. it would be difficult even allowing for changing the reader between calls.
2:30:53
Bike
the reader reads whole forms, so if you have (+ (foo 5 4 3 2 1) 7) that whole expression is read at once. and for the inner call, the whole (foo ...) list is read before it could possibly be acknowledged that the car is FOO.
2:32:09
defaultxr
that's unfortunate. so it also wouldn't be possible to selectively replace \n with another symbol if the current form's car is FOO?
2:32:41
Bike
when the reader sees a ( it basically just recursively calls itself a couple times until it hits a ), and puts the results in a list.
2:32:52
pillton
What are you trying to do? Why are you interested in differentiating whitespace from new lines? Are you writing a document?
2:33:48
Bike
personally i'd find it extremely confusing if calls to this one function parsed completely differently