freenode/#lisp - IRC Chatlog
Search
11:09:11
flip214
splittist: my HR asked me a few times already, too... but I'm convinced that Shinmera will keep us updated ;)
11:10:36
Shinmera
splittist: as for how it works, it'll work the same as two years ago; there'll be a registration form on the website and you can pay through credit card directly (via stripe).
11:18:19
Shinmera
I did those a long time ago though and Didier never got around to testing it. I think.
11:24:47
Shinmera
Ugh, once again annoyed at the poor support for streams in Lisp (where's my poll/select/etc?)
11:26:59
Cymew
I remember seeing that sentiment once in a while, and I remember thinking I see lot of stuff about grey streams and other kind of streams. I don't think I've ever seen it exemplified like that before, mentioning poll/select.
11:34:43
flip214
Shinmera: https://github.com/fukamachi/woo is a fast non-blocking HTTP server built on top of libev
11:35:30
flip214
Shinmera: if you're thinking about high-performance IO, I'm afraid that CL streams are already a major hurdle...
11:35:44
no-defun-allowed
(lparallel:psome (lambda (stream) (peek-char stream) stream) streams) ; I am truly sorry for this pretend select.
12:00:56
flip214
mop:slot-definition-readers only works on direct slots, but mop:class-slots returns the effective slots only - which are incompatible. What am I missing here?
12:16:12
jackdaniel
Shinmera: at least two implementations have an extension called serve-event, is that what you are looking for? that works fine only for file streams though
12:19:26
jackdaniel
writing something working any kind of streams would probably require some kind of busy waiting based on listen
12:23:32
Shinmera
Hmm, listen doesn't seem to work right under Swank. At least (loop until (listen)) seems to just loop forever no matter what I enter.
12:28:27
jackdaniel
according to spec yes. if you want to understand what's going under the hood you need to check swank's gray stream implementation
12:28:40
jackdaniel
afaik it has some internal buffer which is lazily filled when you call read on the stream
12:30:21
flip214
when using xcml:parse with a cxml-xmls:make-xmls-builder, can I tell it to ignore the whitespace in the XML?
13:59:38
flip214
No package form found while trying to define package-inferred-system lil/interface/monad from file /home/marek/.quicklisp/dists/quicklisp/software/lisp-interface-library-20180430-git/interface/monad.lisp
13:59:42
flip214
[Condition of type ASDF/PACKAGE-INFERRED-SYSTEM:PACKAGE-INFERRED-SYSTEM-MISSING-PACKAGE-ERROR]
14:39:39
jcowan
Does anyone know why tokens composed of two or more dots are illegal? No reason is given either in the CLHS or in CLtL1. If there are a lot, it's hard to read, but no harder than ____________ (as distinct from _____________), both of which are valid symbols. Certainly ... is not hard to read.
14:42:34
jcowan
Of course such names can be used tastelessly, but why go to the trouble of forbidding them specially when all-underscore names are not.
14:47:32
jcowan
Yes, hunks are interesting. The syntax chapter of the Pitmanual, however, only explains the special cases, not the defaults.
14:47:41
jackdaniel
(a joke) multiple dots may mean multiple zeros, invoke (format t "~0,0f~0,0f~0,0f" 0.0 0.0 0.0) for instance ;)
14:49:24
pjb
jcowan: It's just that the standard reader doesn't parse this syntax, and there's no easy way to read the dot. It's not a first class lisp object! It's pure syntax. To be able to read several dots, a user program would have to implement a reader macro for #\(, and cannot use just READ or READ-DELIMITED-LIST.
14:49:58
pjb
jcowan: moreover, the standard leaves it to implementations to provide meaning for multiple dots, as well as multiple colons.
14:50:20
pjb
(foo . bar . baz) foo::bar::baz or foo:::bar could mean something, implementation dependent.
14:51:30
pjb
Note that you could also write a reader macro for #\(, that would read them eg. as ranges, or something else.
14:57:14
jcowan
AFAICT the CLHS is silent about such tokens: they are not potential numbers, and they are not required to be symbols, but every token is a symbol or number, so that says to me that they are invalid.
14:58:14
jcowan
_death: ... is used in a limited context in macros, but is otherwise an ordinary identifier, as are all other all-dots symbols other than the consing dot.
15:00:03
_death
jcowan: so maybe they wanted to reserve ... for the possibility of future CL extension.. if you use a nonstandard readtable as pjb suggests, it's easy to allow that
15:01:29
jcowan
Odin-: Thanks, that's definitive. So reading .. etc. has a defined behavior and can't be extended by an implementation.
15:02:06
Odin-
At least not using the standard readtable. Aren't all bets off once you start messing with that?
15:03:34
jcowan
Sure. If you change the readtable, then making your favorite CL also accept Algol 60 is just a SMOP.
15:03:55
scymtym
it says "If a token …" which implies that the characters are not interpreted under the control of a reader macro
15:07:05
pjb
Well, it has the defined behavior of signaling an error if the implementation doesn't extend it: (read-from-string "..") #| ERROR: Reader error on #<string-input-stream :closed #x3020028BEA7D>: Illegal symbol syntax in "..". |#
15:09:03
_death
in cl-su-ai Steele writes "I find I can't easily write myself something akin to READ-DELIMITED-LIST that handles dotted lists because of the problem of recognizing all-dots tokens. PEEK-CHAR can only peek one ahead, so I can't tell whether there is a space after a dot before calling READ recursively." .. there are responses mentioning the issue more generally
15:09:26
Odin-
http://www.lispworks.com/documentation/HyperSpec/Body/02_aac.htm <-- Specifically, here.
15:10:16
pjb
Hmm. Conforms to the standard syntax, but can be distinct frmo the standard readtable !
15:11:08
Bike
and you can always call (copy-readtable nil) to get a new copy of the standard readtable
15:11:09
pjb
The fact is that in ccl, in clisp, and probably other implementations, the initial readtable contains non-standard reader macros.
15:11:19
_death
specifically, Moon says "How about a way (a special variable?) to turn off the somewhat silly restriction that you can't have a symbol named .?"
15:13:56
pjb
_death: it's a little complex, since the internal data structure of the lisp reader is a sequence of pairs (character character-trait). There are several ways to represent it. One would have to define an agreed API, or a specific representation for a token to lisp-object parametrable function.
15:14:33
pjb
See readtable-parse-token in https://github.com/informatimago/lisp/blob/master/common-lisp/lisp-reader/reader.lisp
15:15:19
Odin-
pjb: I wonder if the idea is that "standard syntax" means "don't mess with the syntax types", and not "don't define any macro characters".
15:15:50
pjb
and https://github.com/informatimago/lisp/blob/master/common-lisp/lisp-reader/reader.lisp#L1179
15:16:07
Odin-
pjb: Because the section on sharpsign explicitly notes which undefined characters are verboten to the implementation ... implicitly saying that certain ones are fair game.
15:16:30
pjb
Odin-: yes, the reasonable interpretation is that the initial readtable contains the standard readtable and only "extends" it, still allowing all valid standard syntax.
15:17:10
pjb
_death: and https://github.com/informatimago/lisp/blob/master/common-lisp/lisp-reader/reader.lisp#L1156
15:20:33
Odin-
pjb: Technically the standard only specifies the status of the standard characters, so unless you're going to prohibit a wider range of characters - which the standard very obviously doesn't intend - clearly extension that doesn't conflict with the specified syntax is allowed.
15:21:50
Odin-
Since . is defined as a constituent and not a macro character, I'd say the implementation is _not_ free to define a reader macro on it in the initial readtable.
15:22:55
splittist
But it would be a non-standard / extended implementation of the #\( reader macro, for example
15:24:14
pjb
(quote (foo · bar · baz)) #| --> (foo · bar · baz) |# works perfectly in all unicode implementation.
15:24:37
pjb
Even all 8-bit implementation using iso-8859-1 or iso-8859-15. (char-code #\·) #| --> 183 |#
15:27:22
jcowan
Hunk syntax like this is interesting, but separate from my original issue, which was why .. and ... etc. aren't identifiers. Thanks for the Steele quote, btw.
15:28:05
jcowan
UTFs are only relevant at the bit-bashing level: at the character level they implement exactly the same character repertoire.
15:28:13
_death
pjb: I meant, did you use readtable-parse-token for something specific.. all these URLs you gave are for the reader implementation, not for user code that makes use of it.. but there is user code in your repo as well, so the answer is yes
15:28:21
pjb
jcowan: basically, because of scheme, CL wanted to reserve them for future extensions such as ... like in scheme.
15:29:02
pjb
_death: oh, right. Somebody used my lisp reader to read lisp source files to generate documentation. They definitely used it to avoid interning symbols as normal symbols.
15:32:28
Odin-
jcowan: Yes and no. UTF-16 can and does make things complicated for code points above U+FFFF, because if the internal representation is UTF-16, then the lisp-level functions give you surrogates.
15:35:29
splittist
Before we switch into our regular #lispunicode programming, can anyone suggest a replacement key-chord for emacs' kill-region (since it is stolen by the browser through which I am manipulating the terminal on which I am running emacs)?
15:45:40
Odin-
jcowan: I won't disagree, but that exact brokenness is also in Java, JavaScript, and pervasive in Windows land.
15:47:26
jcowan
Java at least has character-oriented as opposed to codepoint-oriented methods, and on recent Javas strings in the Latin-1 range are stored 8-bit rather than 16-bit, which makes both sets of APIs equally fast.
15:49:03
pfdietz
I have wanted lisps to use adaptive representations that use less space for Latin-1 strings (even if the type is formally (vector character)).
15:49:47
Bike
i wrote a thing with lisp utf-8 strings to see if i could, and i could, but linear time random access kinda blows
15:50:08
pjb
jmercouris: how do you use those strings in C? Don't you call some API expecting some specific encoding?
15:53:56
pfdietz
I also want the adaptive representation to work well if the string is "almost" Latin-1.
15:55:37
jmercouris
maybe, I was thinking about gensym'ing symbols in some package to store some data
15:56:18
jmercouris
I'm not sure how bad of a idea it is (defparameter x (make-hash-table)) in a top level library form...
15:56:49
pjb
jmercouris: for example: https://github.com/informatimago/patchwork/blob/2cc6e94929d47a5b4ac8a2d136cba4c264378146/src/pw-lib/cl-midi/pw-midi.lisp#L421
15:57:43
jmercouris
there are many callbacks taking place here, and I want absolutely 0 performance penalty
15:58:28
pjb
jmercouris: if you can manage the range of your refnums, you can use a vector instead of a hash-table.
15:58:46
pjb
jmercouris: this is the advantage of using small integers as handles. Like unix file descriptors.
16:04:05
pjb
(let ((object (make-hash-table))) (values object (cffi:make-pointer (read-from-string (com.informatimago.common-lisp.cesarum.utility:object-identity object))))) #| --> #<hash-table :test eql size 0/60 #x302002B1820D> ; #<A Foreign Pointer #x302002B1820D> |#
16:04:22
Bike
you can use with-foreign-object to stack allocate an integer, if t hat's what you mean?
16:04:33
pjb
(com.informatimago.common-lisp.cesarum.utility:object-identity (cons 'a 'd)) #| --> "#x302002B3E883" |#
16:05:20
_death
it's unlikely that you want to stack allocate it.. since that pointer will likely be stashed somewhere and passed back at a different time
16:06:16
pjb
jmercouris: of course: (cffi:make-pointer (expt 2 100)) #| ERROR: The value 1267650600228229401496703205376 is not of the expected type (unsigned-byte 64). |#
16:07:07
_death
pjb: that's why I said in theory.. there are architectures that will care, but x86/amd64 are quite lenient
16:09:37
_death
also, providing an actual lisp object's address would be worse, then you have to worry about pinning
16:45:08
jmercouris
I want the user to be able to invoke my function (defun my-fun (some-fun) ...) (my-fun (lambda (xyz) ...)) or (my-fun #'potato)
16:53:31
pjb
jmercouris: see Image Based Development http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html
16:55:14
_death
another kind of image based development: https://i.imgur.com/piCKqJd.png the image tells how to develop
16:55:19
pjb
jmercouris: if you want the function object, of course, just (symbol-function 'symbol) or (function fname).
19:39:52
rpg
If someone around can set the topic, would you mind mentioning that I have just released ASDF 3.3.4, a bug fix release?
19:41:41
rpg
Xach: BTW, Mark E and I are going to have a conversation about how to improve the way ASDF and QL work together. I gather you talked about it at ELS.
19:44:40
Xach
And that's, as a third party, establishing some environment around the compilation of a system based on some property of the system, without interfering with any first-party stuff.
19:46:11
rpg
Xach: the key thing to remember is that ASDF is *not* hierarchical, so that wrapping PERFORM on, say, LOAD-OP, on the system will not work -- that will only wrap post-processing. I think Fare made a kind of clunky method for dealing with this. Let me have a quick look.
19:53:43
rpg
ACTION waits while the "your message to implementation development list awaits moderator approval" emails flood in. Would it really hurt so badly to add me to the accept list?
21:01:16
rpg
Reading the ASDF manual, this hook is something you use like a hook in emacs-lisp, rather than a generic function to which you add methods.
21:26:44
rpg
Xach: Yes, it is. But using it correctly seems to assume that you know how `uiop:compile-file*` works and how the perform method interacts with it. That's why I was offering to help you navigate the issue. Also, I'd like to know for personal use and to give an example.
21:29:36
Xach
i wannt to have verbose loading in some contexts and silent loading in others. the preference depends on a property of the system.
21:30:31
rpg
Xach: I think one might be able to get that done by interfering with the around-compile-hook, but you might have to do some checking in there.
21:31:53
rpg
I think you could write a method on AROUND-COMPILE-HOOK, but it would have to *return* an AFTER-COMPILE-HOOK, and one that would wrap around anything put there by the user.
21:32:59
rpg
So probably an :AROUND method that would first CALL-NEXT-METHOD, catch the return, and then give back either your THUNK or your THUNK applied to the THUNK returned by CALL-NEXT-METHOD.