freenode/#lisp - IRC Chatlog
Search
17:27:02
Xach
random-nick: I have never heard of kawa common lisp and i really like to learn about common lisps.
17:28:05
random-nick
Xach: it doesn't really have a website, it's just mentioned of the features page of Kawa Scheme
17:32:06
jmercouris
has anyone investigated using a distributed package manager for CL? https://github.com/whyrusleeping/gx
17:33:15
aeth
There's a lot of things beyond the standard that libraries assume, too. For instance '(unsigned-byte 8) and 'single-float and 'double-float arrays are de facto standard even though the standard only requires bit and character. And there's probably a dozen portability libraries that express parts of the de facto standard, like bordeaux-threads and cffi.
17:34:26
aeth
Someone should probably make a complete list for implementors, if it doesn't already exist.
17:41:51
aeth
dlowe: CDR isn't up for me (did it move?), but I don't think that ever took off. Just a list of portability libraries and a test suite for some simple things libraries always assume like the array types would probably be better.
17:45:00
aeth
Portability libraries would cover most things. I don't think there's a popular Unicode one, though.
18:07:25
makomo
if i have a list bound to x and do something like (mapc (lambda (x) <body>) x), what x does "x" refer to within the body?
18:09:42
jmercouris
has anyone investigated using a distributed package manager for CL? https://github.com/whyrusleeping/gx
18:13:49
MichaelRaskin
beach: Yes, because it is a natural extension of what I did with wrapping local variables
18:14:38
beach
MichaelRaskin: Can it be done automatically or does the programmer have to put the wrapping code in manually?
18:16:11
specbot
Congruent Lambda-lists for all Methods of a Generic Function: http://www.lispworks.com/reference/HyperSpec/Body/07_fd.htm
18:19:27
Ukari
i could specify parameter's type in defmethod's parameter, is it possible to specify a function with it's accept and return type?
18:20:39
MichaelRaskin
beach: well, you might expect that clordane with Cleavir's first-class support wille be obviously better.
18:22:35
MichaelRaskin
I could write the form wrapper part, but I prefer navigating traces to hand-stepping, so I am not a likely Clordane user… If you can give me a spec for low-level functionality, I might consider writing it just to show off Agnostic Lizard.
18:24:29
beach
MichaelRaskin: I'll think about it. Right now I am off to spend time with my (admittedly small) family.
20:33:36
imjacobclark
Hello - I am trying to hook cl-json and MAKE-ARRAY up to get a JSON object printed to screen, however I keep running into Value #2A((("hello" . "world"))) is not of a type which can be encoded by ENCODE-JSON.
20:33:43
imjacobclark
This is the code I am trying... (print (json:encode-json (make-array '(1 1) :initial-contents '( (("hello" . "world") )))))
20:38:06
imjacobclark
Bike: so my main problem really is when passing encode-json a list that has a variable in it, the variable isn't evaluated, the variables name ends up in the JSON
20:38:15
imjacobclark
For example the following code... (json:encode-json '#( ((foo . (1 2 3)) (bar . path) (baz . #\!)) "quux" 4/17 4.25 ))
20:38:55
imjacobclark
Sorry, I'm learning Lisp and this is me trying to solve a real world problem in it
20:39:38
imjacobclark
Right I see - is there a way to get it to be evaluated? I was thinking make-array could do that
20:39:38
Bike
You could do, e.g., (json:encode-json (list foo 14)), and then encode-json will be passed a list with two elements, the first of which is whatever value the variable FOO has
20:41:37
Bike
'(a b) is the constant version of (cons 'a (cons 'b nil)), while '(a . b) is (cons 'a 'b)
20:42:29
jmercouris
imjacobclark: this will be a very useful chapter for you: http://www.gigamonkeys.com/book/they-called-it-lisp-for-a-reason-list-processing.html
20:42:56
imjacobclark
Still fighting with this example though, can't settle my mind until I get it working
20:43:04
imjacobclark
I've tried converting it to a list... (print (json:encode-json (list (("test" . (1 2 3))))))
20:44:00
Bike
You realize that "test" is a string, and not a symbol, so it doesn't mean a variable in any context?
20:44:05
imjacobclark
(json:encode-json '#( ((foo . (1 2 3)) (bar . path) (baz . #\!)) "quux" 4/17 4.25 ))
20:45:43
imjacobclark
yes variable, e.g in javascript I would do... let myvar = "test"... {"myKey": myvar};
20:46:28
White_Flame
man, sometimes the array types can be annoying. clack wants a (simple-array (unsigned-byte 8)), and flexi-streams output returns a (vector (unsigned-byte 8)). Simple-vector always uses element type T, so there's no "simple-vector" type that can be specialized to (unsigned-byte 8)
20:47:17
imjacobclark
a dotted pair - right... goes to read up on dotted pairs via http://www.gigamonkeys.com/book/they-called-it-lisp-for-a-reason-list-processing.html
20:47:43
Bike
White_Flame: i think the conversion is just (coerce flexi-streams-output 'simple-array), though.
20:56:47
White_Flame
Bike: yeah, I have the coerce in there; not sure if it actually performs a data copy. i would nope not, but the extra type checking is annoying in the inner core of I/O
20:59:15
_death
it does copy.. maybe flexi-streams should be fixed to return a (simple-array (unsigned-byte 8))
21:00:42
White_Flame
well, which "more defining" of a datatype, the fact that it's simple, or the fact that it's a vector?
21:33:57
whartung
while I can dispatch a generic function on a structure type, I can’t “inherit” from a structure, I need to recode them all as classes first in CLOS, right? (I have a bunch of structs and am just lazy enough to not convert them into defclass if I don’t have to)
21:54:45
whartung
so if I have (defstruct xxx a b c) and (defstruct (yyy (:include xxx)) x y z) and (defmethod m1 (arg1 xxx)) and (defmethod m2 (arg1 xxx)) and (defmethod m2 (arg1 yyy)), will those work as expected? Is there a relationship between xxx and yyy or is it simplty structural?
21:57:34
whartung
ah cool! Well, that makes it easy then — I don’t have to class-ify them then…Because I mostly want to specialize behavior, not structure. So I should be able to (defstruct xxx a b c) and then simply (defstruct (yyy (:include xxx))) and method dispatch should Just Work.
0:19:28
mfiano
Does anyone know how to use the type pattern in trivia, on arguments of a list, and also bind the arguments for use in the clause body?
1:24:08
jack_rabbit
Ahh, I see: https://github.com/pkhuong/string-case/commit/718c761e33749e297cd2809c7ba3ade1985c49f7
2:54:38
White_Flame
of course, for erlang-style mailbox based asynchronous message passing, there are libs in quicklisp
3:06:33
White_Flame
in the simplest case, (defmacro send (obj message) `(,(first message) obj ,@(rest message))), where the first element of the message is a generic function name
3:38:46
loke
I recall having an extended debate with someone on social media where it was claimed to me that “message passing” was a fundamentally different way to do object orientation. I desperately tried to get this person to explain exactly how it was different, other than a superficial syntactic different (and a difference in the way the actual technical working were explained to the programmer), but I never got any proper answer.
3:55:21
pillton
I am not sure about that. Alan Kay said "I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages ..." (http://www.purl.org/stefan_ram/pub/doc_kay_oop_en). I am probably misquoting.
3:58:42
pillton
Anyway, I'll shut up because I don't really know and because I have to go to a meeting.
4:01:54
mfiano
Is anyone really familiar with the trivia library? I cannot seem to figure out how to compose the 'struct/class' and 'place' patterns, such that I can match a struct and define symbol macros for their slots in the process. Thanks.
4:09:30
beach
MichaelRaskin: I don't know how feasible your idea of hooking Clordane up to SBCL is, but you gave me a similar, but different, idea. I can create a Cleavir-based compiler for SBCL that propagates source information to executable code and that adds the interaction code required by Clordane. Again, it won't be as fast as native SBCL, but it will me much easier than to wait for a native SICL executable.
4:15:28
beach
MichaelRaskin: It would still take some time to create Clordane and this Cleavir-based SBCL compiler, of course. But such a thing would allow me to debug SICL code in a very comfortable environment without having to deal with the additional problems of a native SICL executable.
4:16:27
beach
MichaelRaskin: So I will probably move Clordane closer to the top of the list of projects to work on.
5:12:55
asarch
bar and baz both have the foo function. How could I shado baz::foo instead of bar::foo?