freenode/#lisp - IRC Chatlog
Search
14:53:22
boeg
ah that works, I had been trying with normal "list" but it just wanted the "cons list" and i'm not sure I understand why, but "list*" works
14:54:29
beach
boeg: You will understand why when you read the Common Lisp HyperSpec page for LIST*.
14:55:36
decent-username
The list section from the book "ANSI Common Lisp" by Paul Graham helped me a lot.
14:58:17
boeg
yeah, I think I know the difference - the dotted list it just "the items" where as a proper list is composed of a dotted list with an element and a pointer to another dotted list, and so on, and the last dotted list will have a nil as its last element? And in this case, the function i'm calling wants a dotted list with elements all the way through, and not a nil at the end
15:01:34
boeg
right - but am I wrong or? a List say (list 1 2 3) is actually (cons 1 (cons 2 (cons 3 nil))) right whereas (list* 1 2 3) is (1 . 2 . 3) or?
15:03:48
phoe
(list* 1 2 3 4 5 ...) == (list 1 2 3 4 5 ...) as long as you only care about the first five elements
15:04:05
dlowe
boeg: lists in CL are standard singly linked lists of two-field structures called conses. all this other stuff is notation
15:04:34
boeg
dlowe: yes, I had just gotten confused - i knew lists were linked lists, but I thought for some reasons conses wasn't
15:05:58
boeg
I am trying to up my common lisp game, but now that i am trying out (next browser) I guess i'll get a lot more practical experience with common lisp since it's configured in common lisp
15:06:28
dlowe
I mean, a linked list is an arrangement - conses are just a convenient standard to build lists out of
15:10:27
boeg
boeg: no done with that for a first pass, right now I'm reading that paradigms of artificial intelligence programming
15:13:25
jdz
jmercouris: there are quite a few more keybindings with C-c C-v prefix, Press C-c C-v ?.
15:25:34
pjb
boeg: note the names: proper-list, dotted-list, circular-list. proper-list implies that the other types of lists are IMproper. This is quite negative. Why would you want to create and use IMproper lists? This will lead to all sorts of difficulties, given that most CL functions are not prepared to deal properly with IMproper lists. They will in general fail on dotted-list, and enter infinite loops on circular-lists.
15:25:53
pjb
boeg: so you have to have a strong justification to use improper lists such as dotted-lists…
15:29:12
luis
I think I'm holding ironclad wrong. https://pastebin.com/nXu6ch1e Can anyone tell me what I'm doing wrong? The encrypted message is unchanged. %-)
15:34:15
gabc
If it returns a value you're throwing it out and not saving it, which would explain what you're describing
15:40:07
_death
for padding, you can use ironclad::add-padding-bytes (for some reason it's not exported?)
15:40:51
luis
_death: seems like I can pass :padding :pkcs7 (or whatever) to the cipher and :handle-final-block t to encrypt.
15:41:03
_death
and for key, you will likely want to use key derivation.. and if you're actually plan on using it rather than learning, you shouldn't use blowfish, and shouldn't use ECB :)
15:42:27
luis
_death: I'm just porting some code, so I think I have to stick to blowfish and ECB since I have encrypted messages floating around that way
15:43:21
luis
_death: but the wikipedia article about ECB illustrates why ECB is a bad idea very eloquently :)
15:50:15
_death
I guess.. personally I like CTR mode (+ authentication) so I don't need to pad or steal from ciphertext :)
15:50:52
_death
there are other useful ironclad operators whose symbols should be exported.. e.g., ironclad::modular-inverse
15:57:22
_death
pkcs7 padding will always add at least one byte.. if the message size is an exact multiple of block size, it will add another block
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