freenode/#lisp - IRC Chatlog
Search
16:43:39
_death
boeg: huh, we were talking about lists and cons cells, and Joe Marshall just put out a post about it (check planet lisp)
17:25:51
vivit
Is it possible to define a single method specializer across, for example, all types (SIMPLE-VECTOR N) where N is a positive integer?
17:28:57
Bike
i'm not sure what you're going for with the original question. the union of all (simple-vector n) types is just simple-vector. or do you want to use N in the body?
17:31:04
mfiano
There are libraries to emulate what you want, however. specialization-store comes to mind.
17:42:14
vivit
Bike: I was confusing classes and types; I thought that methods were specialized on types and since (simple-vector 1) is a different type from (simple-vector 2) there would be some special syntax for writing a definition across all simple-vector types. I blame Haskell.
17:46:34
_death
usually functions have a single "target audience", the callers.. with generic functions, there are now two distinct possible audiences, callers and extenders.. if you feel the need to specialize on &rest or &key, that means it may be beneficial not to conflate the two audiences, by defining a separate function for each
17:48:12
_death
(of course you still call the "extenders" function, but you can think of these particular callers as yet another audience)
18:03:01
vivit
trying to define a package-local function called +, but I'm getting the error "The variable + is unbound" when I try to compile the defun. What's up with that?
18:05:11
Bike
What does your defpackage look like? Maybe it doesn't :use :CL, so the compiler is reading your-package::defun and treating it as a function name.
18:12:20
vivit
Now I'm getting "Lock on package COMMON-LISP violated when defining + as a function while in package LRL". How do I indicate that I want to define LRL::+, not cl:+?
18:13:06
Bike
so to be clear, you did your defpackage lrl, and then (in-package #:lrl) or such, and so it's reading things in the LRL package?
18:15:00
_death
you should also know that cl:+ has more roles than a function name, which your:+ may not be able to fulfil
18:27:10
earl-ducaine
phoe: I haven't contacted the Hemlock developers re: the :qt dependancy. But as far as I can tell there's been no active development for over a decade, so I wouldn't expect anyone to take action on it.
19:25:50
jasom
I'm writing some software for an rpi; any tips or gotchas for using lisp to develop for it? Will swank and tramp-mode just work similar to how I would do between two x86oids?
19:36:10
boeg
Is it possible to have an optional argument (with or without default value) as *not* the last parameter. So say a function takes argument (a b &optional (c "") d), and the function can then be called with 3 argument (where c will get default value) or 4 arguments?
19:37:33
_death
you could implement your own arglist parsing, though that's a good sign you should rethink the interface
19:39:48
pjb
boeg: you can either 1- use &key arguments they are optional! or 2- use &rest and parse the list of arguments yourself!
19:41:38
pjb
(defun foo (a b &rest args) (let (c d cp dp) (ecase (length args) ((0)) ((1) (setf d (car args) dp t)) ((2) (setf c (car args) cp t d (cadr args) dp t))) (list a b cp c dp d))) (foo 1 2 3) #| --> (1 2 nil nil t 3) |# (foo 1 2 0 3) #| --> (1 2 t 0 t 3) |#
20:39:08
eeeeeta
jasom: you'd want to use CCL on a pi if you want threading; I was able to get swank working that way
2:02:16
asarch
Is there any way to get the PNG file of the (com.informatimago.common-lisp.picture.cons-to-ascii:draw-list *values*)?
2:04:53
pjb
asarch: otherwise, there are ascii-art web services that will convert that into a svg and png…
2:06:59
no-defun-allowed
pjb: Well yes, screenshotting text is annoying, but no need to hang people who do that.
2:13:32
pjb
You can use: (progn (with-open-file (*standard-output* "/tmp/aa.txt" :direction :output :if-does-not-exist :create :if-exists :supersede) (com.informatimago.common-lisp.picture.cons-to-ascii:draw-list *values*)) (uiop:run-program "ditaa /tmp/aa.txt") (uiop:run-program "open /tmp/aa.png"))
2:44:31
LdBeth
It seems to be the only comprehensive book on macro assemblers http://www.davidsalomon.name/assem.advertis/AssemAd.html