freenode/#lisp - IRC Chatlog
Search
5:27:34
beach
Yesterday, I think I figured out how to do partial inlining of local functions using local graph rewriting.
5:31:59
beach
It is a graph of HIR (High-level Intermediate Representation) instructions in Cleavir.
5:32:22
minion
iqubic: Cleavir: A project to create an implementation-independent compilation framework for Common Lisp. Currently Cleavir is part of SICL, but that might change in the future
5:32:28
minion
iqubic: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
6:02:39
jasom
"I thought real hard about it and then I drew some figures." minion has a quote db, right? I think that's deserving
6:18:39
beach
In fact, that inlining technique creates functions with multiple entry points. Such functions can not be expressed as Common Lisp source code, but there have been languages that allow such functions of course.
6:25:51
beach
https://www.ibm.com/support/knowledgecenter/en/SSY2VQ_2.0.0/com.ibm.aix.pli.doc/lsh-procedure.htm
6:27:49
beach
I think I must stop posting links. Freenode gave me a warning that my behavior looks like spam.
6:52:10
beach
loke: In fact, the exception handling of Multics PL/I inspired the Common Lisp condition system.
6:56:20
beach
shka_: On the left, you have a caller that does (car x). On the right, you have the code for CAR.
6:57:11
beach
In fig4, the code for CAR has been partially inlined, so that the test CONSP is done in the caller, as well as the CONS-CAR (which is like CAR but must be given a CONS cell).
6:58:16
beach
So the caller now tests for CONSP, and if it is a CONS it does the CONS-CAR. Otherwise it calls the remaining CAR function that will test for NULL, etc.
6:58:39
beach
But I see an error in fig4. The caller should not RETURN. Just continue to the next instruction.
6:58:52
loke
beach: You're right. I recall reading about how Multics handled errors. It never dawned on me just how similar in concept CL is.
6:59:40
beach
loke: It is documented by Kent Pitman. He explicitly mentioned that PL/I is the inspiration for Common Lisp condition system.
7:00:28
loke
They do seem to setill market the products: https://www.ibm.com/ms-en/marketplace/pli-compiler-zos
7:11:36
beach
shka_: I updated the figures, fixing a bug and adding a variable to be assigned to the result of the call to (CAR X).
7:16:15
fouric1
I'm attempting to read from a character special file (representing a keyboard I have attached to my machine), and READ-BYTE appears to be...buffering? my reads
7:17:08
fouric1
That is, running the given snippet yields blocks of several hundred bytes at a time, which only occur after I've pressed several keys on the keyboard, and not as soon as I press a key.
7:17:27
fouric1
This *suggests* buffering, but I'm not sure how to confirm that it is, how to determine *what* it is, or how to get around it.
7:58:42
fouric
Bike: thank you for the suggestion; however, that appears to actually *clear* the buffer, instead of flushing it.
9:12:26
beach
I improved those figures and added three more. I won't give the links again, because I am now targeted by some freenode bot that has decided I am a spammer. So now it is fig1.pdf ... fig7.pdf.
10:57:48
Posterdati
please II need to pretty print an object into a string without line feed or return inside the result. I used (format nil ...) but it adds #\Newline in the string
11:13:13
_death
fouric: like you want to use an fd-stream, which allows control of buffering, for that
12:19:50
michipili
Hi @Xach, @rumbler31 and all that helped me yesterday! Unfortunately I have been banned by the server because of posting error logs, which was recognised as a flood. :)
12:54:02
michipili
Admins at chat.freenode.net encouraged me to use pastebin for error logs. I also could solve the issue by adding the following to my ~/.sbclrc
12:54:49
michipili
(load "~/quicklisp/setup.lisp") (ql:quickload :cffi) (pushnew #P"/opt/local/lib/" cffi:*foreign-library-directories* :test #'equal)
14:40:12
shrdlu68
Why does this with-output-to-string return an empty string? http://paste.lisp.org/display/356394
14:50:31
didi
Bike, beach: Sorry, I was AFK. So you wouldn't use `defsetf'? And sorry, but what do you mean by "define the setf function yourself"?
14:52:01
shrdlu68
I see, the length is indeed non-zero. But what's going on here? How is the ansi escape code preventing the value from printing properly?
14:56:17
shrdlu68
Oh, the output is a complete ansi code, so when it's printed it get's "interpreted" by the terminal emulator.
15:12:38
didi
(defun (setf ...) ...) worked like a charm. Now, is it possible to `setf' multiple values to the same place?
15:16:03
didi
Say I want to store A, B, and C in the place P. I could call (setf P (list A B C)), but the receiving end wouldn't know if it is a single value (a list) or 3 values (A, B, and C).
15:56:36
didi
Thank you all. One more: Can I write an elaborate `incf'? I have an CLOSS object that has a complex structure, but it makes sense to (incf obj) it.
15:57:15
pjb
didi: Bike: ok, so the problem is that you can accept a pre-determined number of multiple value, but there's no way to know (exactly) how many values you will be given! It's implementation dependent how setf is implemented and how it stores the multiple value. eg. in ccl, it (setf (mv x) (values 1 2 3)) will expand to a (multiple-value-bind (…) (values 1 2 3) …) so you cannot know how many values there are. You can only fil
15:57:15
pjb
trailing NILs, but this could reduce the number of values (values 1 2 nil nil) are 4 values.
16:05:37
|3b|
ACTION would expect INCF to break on the + part rather than the SETF part for arbitrary objects :)
16:12:01
Josh_2
Is there a Lisp alternative to uint_8 from C? I can make my own but I haven't written any lisp in a while so I'm struggling to remember anything
16:18:04
Josh_2
Okay, so I've got this C++, and I'm wondering if there is something with similar functionality already available. Where I don't have to set each value manually.
16:19:16
pjb
(let ((width 330)) (make-array 3 :initial-content (list 0 2 width))) #| ERROR: Incorrect keyword arguments in (:initial-content (0 2 330)) . |#
16:19:22
pjb
(let ((width 330)) (make-array 3 :initial-contents (list 0 2 width))) #| --> #(0 2 330) |#
16:29:41
beach
Can (LOCALLY declaration* form*) always be replaced with (LET () declaration* form*)?
16:32:11
_death
(let ((a 42)) (locally (declare (type integer a)) ...)) ; here (let () (declare (type integer a)) ...) is bad
16:35:16
beach
didi: The question is what happens when the variable in the declaration is free in the form.
16:42:21
pjb
locally says: Sequentially evaluates a body of forms in a lexical environment where the given declarations have effect.
16:43:52
specbot
Processing of Top Level Forms: http://www.lispworks.com/reference/HyperSpec/Body/03_bca.htm
16:44:29
pjb
beach: indeed. That seems to be the only difference. With respect to declarations themselves, it's the same.
16:45:08
dlowe
the magit dev made his kickstarter goal. i wonder if this is a sustainable way to make a living.
16:45:18
kenanb
is there a format directive or a compound one that can justify (monospaced) text in typographical manner?
16:47:35
dlowe
I have a *lot* of monospace text formatting stuff that I made for my MUD. I should package it up into a library
16:47:36
kenanb
dlowe: yeah, I think I need to do way more than some math to make ~t justify like that :D
16:48:26
dlowe
kenanb: you might like this, though: https://github.com/TempusMUD/cl-tempus/blob/master/src/support/editor.lisp#L157
16:50:04
kenanb
dlowe: hmm, that is cool, yet I guess I will still need to implement it myself, this is standard word wrapping, doesn't actually do the stretching.
16:50:05
pjb
beach: My opinion is that if they had took the pain of writing some formal semantics, they would probably have unified those semantics. For example,e clhs let repeats that the body is in an implicit progn, but this leaves out the declarations. It's not too explicit on the scope of the declarations… Formally, they could have used bindings+locally and then (let () …) could have been equivalent to locally. (unless the wanted to
16:52:44
kenanb
dlowe: yeah, I kinda agree. I once thought I might come up with a better full justification algorithm, I guess I will try that now.
16:53:19
dlowe
If you want it to look really nice, you'd be better off implementing Knuth's word wrap that he uses for TeX
16:53:58
dlowe
full justification is just accumulating fractional error and inserting spaces at integer bounds.
16:54:07
kenanb
dlowe: you know, that is indeed a good idea, I am a huge sucker for TeX output. (not the TeX language tho)
16:54:31
pjb
In the differences between LET and LAMBDA: (let ((a 42)) "foo" (declare (type integer a))) is an error; ((lambda (a) "foo" (declare (type integer a))) 42) returns nil.