freenode/lisp - IRC Chatlog
Search
11:30:24
shka
filwisher: and when i'm using, i'm kinda doing it manually, without extra tools like grovel
11:32:45
shka
then cffi:load-foreign-library (or something like that, i can't remember function name) should work
11:32:53
filwisher
I can recompile to .so but I'm unclear about integrating shared libraries with common lisp
11:33:46
shka
i'm not sure if asd is handling this, but what i do is to use this: https://common-lisp.net/project/cffi/manual/html_node/load_002dforeign_002dlibrary.html
11:35:45
shka
(cffi:load-foreign-library (asdf:system-relative-pathname :overmind "lib/libqmlisp.so"))
11:37:20
shrdlu68
It seems to me ironclad's sha512 isn't right. Could someone try hashing something and compare it to sha512sum's output?
11:56:37
phoe
On my machine, it sha512s to "6308d8f6a7ccc9f77e41be5331a52c71c0bb28ecbd4669b960d60dd505dfde9ddd7a30cd26bb308010b3819699daba7caeb791bf6a4153605fe56d1fd3d5df41"
12:03:00
shaftoe
http://www.method-combination.net/blog/archives/2017/03/07/nibbles-and-ironclad-releases.html
12:03:06
shrdlu68
Wait, they released a new version recently, and last time I opened an issue on github (hardly two weeks ago), I got a response.
12:03:08
shaftoe
This is also an appropriate time to announce that I will no longer be maintaining nibbles, ironclad, nor any of my other Common Lisp packages.
12:50:33
chrnybo
An around-method modifies an argument, stores the rest of the arglist in REST. How to splice the arguments stored in REST into call-next-method?
12:54:28
chrnybo
Thanks! I got confused by only quoting the call-next-method, which gave the runtime error "UNDEFINED-FUNCTION: CALL-NEXT-METHOD is called outside the body of a method.".
15:44:29
Ukari
(funcall ((lambda (f) (lambda (&rest x) (apply f x))) (lambda (a &key x y z) (+ a x y z))) 5 :x 1 :y 2 :z 3)
16:00:01
beach
Ukari: Not in general, no. EQL can not be used to compare lists, other than for identity.
16:06:15
shka
so stuff like (let ((l (list 1 2 3))) (flet ((l (a) (elt l a))) (call-me-maybe l) (l 1)) is complete crap in lisp-1
16:19:02
beach
jusss: Furthermore, a "lambda form" is just data. Perhaps you mean "a function"? They are not the same.
16:21:23
beach
jusss: When READ has processed the first one, it is a list with the CAR being another list. But when READ has processed the second one, it is a list with the CAR being the symbol LAMBDA.
17:19:49
jdz
shrdlu68: there is split-sequence in quicklisp, and cl-ppcre can also split strings (using regular expressions).
17:38:22
presiden
question, what does the code snippet in this channel topic means. #1=(programmable . #1#)
17:40:54
whiteline
it is the description of a circular list containing only the symbol PROGRAMMABLE, this list being a single cons cell where CAR points to PROGRAMMABLE and CDR points to the cons cell itself
18:10:31
KZiemian
(defun plot (fn min max step) (loop for i from min to max by step do (loop repeat (funcall fn i) do (format t "*")) (format t "~%")))
18:15:01
phoe
in other words, you can put function objects in a FUNCALL call, and this function will be called. You can also put symbols in a FUNCALL call, and whatever function is bound to that symbol will be called then.
18:15:35
phoe
for standard functions you can use the #' notation, because you expect that the function will never change.
18:16:04
phoe
but for functions that you actually expect to change as the program runs, such as some callbacks that you might modify, you might want to put a symbol there instead of a function object.
18:16:30
phoe
this way, the symbol will be resolved to a function each time the FUNCALL is executed, and it will take into account changes of the symbol's function definition.
18:26:53
beach
"required" is a strong word. It is something I want to do so as to make source tracking available and precise.
18:27:52
beach
Since it is the first time something like this has been done, I am bound to make several design mistakes on the way.
18:31:09
shka_
anyway, idea is that i will be able to bootstrap and use SICL with sbcl even on my own?
18:32:25
beach
First-class global environments are tricky though. For performance reasons, they must be part of the core system. The compiler needs to know what to do.
18:33:44
shka_
i just wanted to figure out when i will be able to implement smalltalk style version control
18:34:41
beach
I might make it easier to set up this SICL-inside-SBCL environment so that people can try it out. But I have other things I need to work on too.
18:37:11
phoe
...I really dislike how CL:ASSOC and ALEXANDRIA:ASSOC-VALUE have their arguments swapped around
18:42:02
shrdlu68
I mean by updating emacs code, for example to adopt the same indentation as slime does.
18:49:49
Ukari
i see "a variable defined using defglobal with a proclaimed type of fixnum" in this document
18:51:28
phoe
I have realized that I can fix so many issues with SETF by simply replacing LET with SYMBOL-MACROLET
18:54:13
pjb
phoe: (mapcar (function funcall) (list #'elt #'alexandria:assoc-value) '(#(a b c) ((a . "a") (b . "b") (c . "c"))) '(1 b)) #| --> (b "b") |#
18:56:05
pjb
phoe: the point is that you have functions to find elements in collections, and some of them have the element as first argument, others have the collection as first argument. If you want to use those function in an homogeneous way, it's bad, you need the arguments in the same order.
18:58:08
Ukari
shka_, thank you, it looks like that i don't know things about declare and declaim so i went wrong
19:01:43
pjb
Also, assoc returns an entry while assoc-value returns the value of the key-value pair in the a-list.
19:44:15
phoe
All it says is, "Wait until THREAD terminates. If THREAD has already terminated, return immediately."
19:51:02
shka_
i had code for you that essentially spawns thread, executes function on it and returns value (blocks if it is not ready yet)
19:58:35
shka_
phoe: join-thread follows posix semantics and posix join-thread will just return status
19:59:15
phoe
and from what I see, SBCL, CCL, ECL and ABCL all return the return values of the function
20:02:01
Bike
it's not totally simple, it means thread objects have a slot for them to store values in. which i guess is like a promise.
20:05:13
phoe
if implementations provide a way to fetch return values from threads, then this should be leveraged in a compatibility library.
20:06:54
phoe
the moment a thread becomes a promise, the programmer has one abstraction less to think of.
20:07:06
shka_
this is fundamental, low level library for interacting with OS, not abstraction layer
20:07:54
phoe
because what you say is, BT is a fundamental, *low-level* library for interacting with OS that accidentally makes use of *high-level* functionality offered by implementations
20:08:40
phoe
good, then BT on some implementations is high-level and I am free to leverage that fact.
20:09:05
phoe
and perhaps state that the implementation was able to fetch a return value through returning a secondary T/NIL value.
20:10:46
phoe
if an implementation's join-thread actually makes sure to return the thread's value, then I'm free to use that fact
20:13:44
phoe
https://github.com/Clozure/ccl/blob/003917cbbce90b7a7b5fa4bf90e9fe424e5637e9/level-1/l1-processes.lisp#L739
20:14:37
aeth
I rely on this in one of my unpublished libraries that I wrote to help me with Project Euler code, with something that could only go under 1 sec when parallelized
20:16:08
phoe
minion: memo for sionescu: I need to work on a JOIN-THREAD-VALUE function that returns two values: the value of JOIN-THREAD and T/NIL depending on whether BT determines that the value of JOIN-THREAD is guaranteed by the implementation to be the return value of the function the thread was called with.
20:17:39
aeth
Hmm... Run something in one second. Oh the good old days. What's funny is that I then went on lowered my impatience standards. Now I have to do *everything* in under 1/60 seconds or precompute it ahead of time.
20:19:43
aeth
Both SBCL and CCL have impressed me with their performance. (I mostly used scripting languages before CL, though.)
20:23:55
phoe
I want to iterate over a list using LOOP and do something extra on every 5th element. What is the simplest way of achieving that?
20:24:38
pjb
(loop for item in list for i from 0 do (something item) when (zerop (mod i 5)) do (something-extra item))
20:25:28
aeth
I do something similar and I have with counter = -1 do (incf counter) instead of for i from -1
20:26:04
pjb
Yes, depends on whether you want to do the extra on the 0th 5th 10th, … or on the 4th 9th 14th …
20:28:53
aeth
right, so it's "for i from 0" instead of "with i = -1 do (incf i)", saves some complexity
20:43:40
phoe
(do () (t) loop for x = 42 and foo being equal to the value of (+ 4 20) finally return nil)
20:43:55
_death
aeth: the other day I implemented multiple-value DO (reading On Lisp again nowadays) before reading PG's attempt.. my style is quite different, but there is at least one nontrivial point, which PG ignored and mine implements poorly
20:50:27
aeth
I have probably written more declarations in the past year than everyone here combined :-p
20:53:21
aeth
I'm considering writing a define-function that uses defmethod style syntax like e.g. (define-function foo ((x fixnum) y (z single-float)) (+ x y z)) but the issue would be how to handle &optional and &rest. Iirc, defmethod's solution is to not handle them.
20:58:28
aeth
&rest would be trickier. Might not be possible. Can you even type a list? I had to make sure a &rest was all of one type once, and I got around that by essentially (map nil (lambda (x) (check-type x foo-type)) rest-args)
21:00:07
pjb
(defstruct typed-list type list) (defun push-typed-list (x l) (etypecheck x ((typed-list-type l) (push x (typed-list-list l))))) (defun pop-typed-list (l) (pop (typed-list-list l)))
21:01:01
aeth
pjb: like with lazy lists and a few other things, built-in support would be much better than building it.
21:01:51
aeth
And, imo, queues. I use a struct for vector queues, but it is a bit strange that queues aren't supported in vectors or lists when stacks are supported in both.
21:06:33
aeth
Oh, you're right, it's trivial if you're writing them with lists, but not trivial to add to all lists, unless you want to increase overhead of lists by tracking the last cons.
21:06:34
pjb
Well, this is the fundamental criticism of Common Lisp: it freezes the implementations (theorically), so you cannot easily add this kind of stuff. Now on the other hand, we're using open source implementations, so you can always add those extensions.
21:07:07
pjb
Notice also that clisp can be compiled with the option of a 3-slot cons cell, and you could use this third slot to store a type for the car…
21:08:20
aeth
pjb: Imo, CL with a robust set of collections built into the language would be amazing. Immutable sequences, lazy lists, typed conses, etc.
21:10:52
aeth
pjb: If someone could get some optional extensions into SBCL, CCL, and ECL (and maybe some up and coming ones like Clasp and SICL), then someone could get a de facto standard going.
21:11:25
_death
there are many ways in which it shows its age.. some are desirable, others less.. different people disagree on what falls where
21:11:31
pjb
But then also, CL was designed after the Internet, and even after GNU; it's harder, in the context of easily shared software sources over the Internet, to deploy your own extensions in your local implementation: now it may become incompatible with shared software!
21:12:14
pjb
aeth: of course, (and let's remember the AI winter occured at that time too), as long as you have enough resources to implement your extensions in a few implementations.
21:12:41
aeth
pjb: Right, but if you get extensions into the major FOSS implementations, and come up with a portability library, then within 5 years or so you'll probably be able to actually use those extensions. So the Internet slows progress here, but doesn't prevent it.
21:13:43
pjb
notice that extensible sequences implemented in sbcl still don't exist in the other implementations.
21:14:16
aeth
Extensions need to be (1) designed, (2) agreed upon, (3) implemented in at least 3 major FOSS implementations, (4) have their quirks wrapped over via a portability library, (5) and then people need to update to the latest version
21:15:46
pjb
No, I'd say you need almost all implementations. Again, extensible sequences in sbcl only exist in sbcl. Relative package names only exist in allegro (I've got a conforming implementation in cesarum).
21:16:20
pjb
What I mean, is that we're underpowered to integrate them enough implementation for them to become "standard".
21:17:19
aeth
pjb: I disagree. I think if you got the code in SBCL, CCL, and ECL, you probably have enough support to just assume it's going to be there. Other implementations can then add the features or not be able to use libraries that depend on those features.
21:17:42
aeth
That's not "almost all", it's less than half, but it's probably a majority of FOSS-implementation users.
21:19:24
pjb
on the other hand, you can call pathname on a file-stream, so you can get its length by other ways.
21:19:56
_death
I think it was my first sbcl patch.. though I've not used it since I played with Gray streams
21:20:47
aeth
pjb: I think the big issues are how you could extend the type system and collections in a way that implementations will agree on and how to get that into enough major FOSS implementations.
21:21:26
aeth
In the long run, I think those are existential threats to CL. It wouldn't take that much for people to switch to other Lisps or Schemes that *do* have types and collections that are much better.
21:21:41
aeth
One of the main reasons I am using CL over Scheme is because of its rich (relative to Scheme) way of handling collections.
21:23:52
aeth
There are a lot of collections missing from CL or only available in CL without being able to guarantee the type of the elements. And none (afaik) are immutable and FP-friendly (although I think literals are treated as immutable like #() and '() and "").
21:24:44
Posterdati
I've got a problem with sbcl 1.3.16 quickloading iolib: OPERATION instances must only be created through MAKE-OPERATION
21:24:51
pjb
But then, I just consider CL as a kernel language, and implement whatever I want over it…
21:26:04
aeth
pjb: I mostly agree, but there are certain things that can only be (portably) efficiently implemented (at least in a language like CL) by the implementation.
21:27:00
aeth
pjb: Two solutions are to implement them in the language implementations themselves or to portably provide a way to implement them efficiently. The proper solution is probably a mix of both.
21:31:35
_death
aeth: this reminds me of tcr's named-readtables.. he wanted a with-readtable-iterator operator.. I ended implementing it for clisp (some .d code, heh).. so you can start learning about your implementation by making small changes like that
21:38:49
phoe
Inside the SLIME debugger, how can I go to the source location that signaled an error?
21:49:52
phoe
look at https://github.com/sionescu/iolib/blob/master/src/grovel/asdf.lisp <- the last commit from Fare actually fixes this
21:52:58
phoe
XachX: we seemingly need to update iolib to take an ASDF patch into account. https://github.com/sionescu/iolib/commit/63ebc989219cd257511caeb7c8e9a067179be39f
21:53:24
phoe
Posterdati: basically - pull the github master instead of the quicklisp version and it should work, or apply my patch
22:10:42
gendl
Hi, does anyone happen to know where would be listed the UTF-8 external-format designator for various CLs? Or is there a library which abstracts this?
22:10:55
Posterdati
I pulled it in quicklisp/local-projects, but it downloaded one in quicklisp/dists/quicklisp/software
22:11:35
gendl
but I think that :utf8-base name is allegro-specific, it would be different in different CLs...