freenode/#lisp - IRC Chatlog
Search
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.
16:59:07
pjb
And trying (disassemble (compile nil '(lambda () (let ((a 42)) (let () (declare (type fixnum a)) (the fixnum (truncate a 2))))))) in ccl and sbcl shows that the declaration is correctly taken into account.
17:02:16
pjb
Now, since we're already inside a LET, (let (locally)) and (let (let ())) will be strictly equivalent, since there's no toplevelness there.
17:05:53
Josh_2
Just figured out that (write-byte ..) literally writes the integer as an entire byte, I actually do feel stupid now.
17:09:05
pjb
(with-open-file (out "/tmp/21-bit-bytes.bin" :direction :output :if-does-not-exist :create :element-type '(unsigned-byte 21)) (write-sequence (map 'vector 'char-code "Здра́вствуйте!") out)) #| --> #(1047 1076 1088 1072 769 1074 1089 1090 1074 1091 1081 1090 1077 33) |# ; (uiop:run-program "od -t x1 /tmp/21-bit-bytes.bin")
17:12:06
pjb
Josh_2: now, assuming 8-bit-byte-based POSIX file-system, and assuming reasonable CL implementations, and assuming you use (unsigned-byte 8), it is expected that you can write files that can be read back by different implementations on the same 8-bit-byte-based POSIX file-system.
17:12:58
pjb
Josh_2: We can even expect being able to transfer those files to other POSIX systems wiht 8-bit-byte-based POSIX file-systems, and be able to read them back using reasonable CL implementations, and assuming you use (unsigned-byte 8).
17:13:55
pjb
But that's really the most we hope for. Don't try signed-byte, don't try other byte sizes. Don't try other systems (certainly not 36-bit-word-based systems, they often use 6-bit or 9-bit bytes…).
17:16:07
pjb
The only problem with clisp is when your byte size is not a multiple of 8, it needs a header to indicate how many bits are used in the last octet.
17:16:53
pjb
But the advantage is that if you have to write small bytes (1 to 7 bits), it gives smaller files. You can read and write files bit by bit :-)
17:17:27
_death
beach, Bike: ok, after reading http://www.lispworks.com/documentation/HyperSpec/Issues/iss096_w.htm (which also says the LEXICAL proposal passed), I now believe that such declarations are ordinary "free declarations" and are allowed
17:18:24
pjb
Josh_2: well, clisp ensures it can read its files on all the platforms it runs on. So notably it always write binary files in little-endian, so you can exchange them between MS-Windows and Linux or Darwin.
17:19:52
pjb
Well, I assume you could design a custom declaration where its semantics would be different in let let than in let locally…
17:21:00
pjb
Basically, a declaration applies on the whole form. So if the whole form is different, the declaration may apply differently.
17:30:14
jmercouris
hey everyone, I just wanted to say, thank you for the support you've given me these past few months
17:30:35
jmercouris
with that I've released v0.02 of nEXT, which I've posted about it in the lisp subreddit: https://www.reddit.com/r/lisp/comments/71kpzu/next_browser_ver_002/
17:57:11
jmercouris
jasom: I thought it would be too much work to make the chrome as well as the rendering engine
17:57:38
jasom
ACTION didn't know QT had a webview; I assume it uses the OS'es native webview on mobile?
17:59:07
jmercouris
jasom: I'm not sure what it does on mobile, but nEXT is designed for OS X, Linux, and Windows, mobile support is kind of out the door because it relies on the keyboard
18:12:08
cgay
Hi folks. Anyone know the status of EuLisp these days? Any active work on it? Use of it? For some reason I never really took notice of it before but it looks very appealing.
18:15:28
dlowe
The topic of #lisp is Common Lisp, while ##lisp is for discussion of the lisp family as a whole.
18:18:03
cgay
But it looks so similar to Dylan (from a glance at the wikipedia entry) that I'm shocked I never looked at it before.
18:21:50
cgay
Probably silly to have even asked, given "There is an FTPable copy [of the spec] available [in .ps and .dvi]"
18:49:17
jasom
Xach: is that the one where someone from the US intentionally started bikesheding on the name?
19:05:52
shka_
any reason why alexandria:emptyp is defined only for sequences and not for hash table?
19:11:30
francogrex
(setf (test-age *test-inst*) "aavc") is acceptable and make-array gives elements 0 ?
19:12:30
shka_
dlowe: that misses the point, i wanted to write library that integrates nicely with the rest of the world
19:12:57
mfiano
type declarations in Common Lisp are not enforced...they are merely a suggestion to the compiler.
19:13:46
dlowe
shka_: name it empty-hash-table-p or send a change to alexandria to have it changed to a method. Or send a change to alexandria to add hash table support.
19:15:30
mfiano
You would have to loop over the array. It is unclear exactly what you expect that code to do though.
19:16:53
_death
shka: it's unlikely to be incorporated.. alexandria is meant to be conservative, and I never saw an emptyp function that cares about hash-tables
19:17:16
_death
shka: nor do I remember the last time I needed to know if a hash-table is empty or not..
19:19:56
mfiano
common lisp has hash-table-count too i believe, but i don't think i've used this more than a handful in a decade of use
19:23:10
francogrex
let's try this for illustration: (let ((array (make-array 3 :element-type 'testclass))) (setf (aref array 0) *TEST-INST*))
19:23:14
shka_
in fact i would say that majority of languages actually have some sort of check if this thing is empty function
19:26:46
Fare
beach: are you here? vyzo & I would like to add features to Gerbil's object system, hopefully getting it on par with CLOS (though maybe with C3 linearization by default).
19:31:32
shka_
interface passing style is very useful when implementing data structures (very nice way to separate abstract and concrete data types) but I consider it to be cumbersome for library user
19:32:44
shka_
so although i am doing lil-like stuff under the hood, actual API is rather conventional object oriented code