freenode/#lisp - IRC Chatlog
Search
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.
21:35:13
rpg
Xach: There are no :AROUND methods already there, so you could just handle any ASDF:COMPONENT, if you have a way to look at an arbitrary component (possibly by looking at its parent), and decide whether you want to meddle with it.
21:37:52
Xach
rpg: I'll give that a try, thanks. I worry about clashes if someone else wants to do the same thing.
21:39:04
rpg
Xach: Yeah, I hear you about that. You'd be really busting the API, and doing a thing that no one just building a system should be doing, though.
21:40:50
Xach
it sounds much more likely to do what i want than anything i've heard about before, so thank you very much, can't wait to mess with it.
21:41:00
rpg
TBQH, I don't fully grok what this thunk is supposed to do. Reading the code, it looks like ASDF normally FUNCALL's compile-file*, and what you do is write a function that replaces FUNCALL, so setting up whatever context you want, and (probably) then calling FUNCALL. But I have never done this myself, so you'd have to take that with a grain of salt.
21:41:57
rpg
Xach: Great. Please drop me a line and let me know how it goes. If it works for you, I'd like to learn from what you've done, and if it doesn't, I can help you figure out what's going wrong.
21:44:54
Xach
rpg: the context is that i'd like to suppress a lot of output for quicklisp-provided systems, and don't suppress it for other systems, to get rid of the problem that your code has warnings and other stuff you don't know about.
21:48:00
rpg
Just out of curiosity, how do you know when a system is provided by quicklisp and when not?
22:07:06
Shinmera
rpg: You can look at the system source directory and check if it's within ql's dist directory.
22:08:07
rpg
Probably something you would want to memoize, if that check has to be done for every operation x component pair.
22:08:32
Xach
One easy way is to establish a dynamic table that is populated by the quicklisp system-definition search function as it returns things.
22:11:11
rpg
Yes, that sounds better! I was trying to figure out if you could have a quicklisp-system-mixin, and use ensure-class and change-class. That would be simpler to integrate with method dispatch, but would probably involve considerable hair
0:01:18
Oladon
loke`: hehe, thanks -- I ended up getting _something_ working, so just in the "tweaking" phase now. If whatever you were doing with detach-socket is public, I'd love to take a look
1:19:47
thrashdin
acsessing slots of a class within the class definitionI wanna know if thats possible or not ( I think not)
2:04:10
pjb
thrashdin: note that classes don't contain code. Only generic functions have methods that contain code. So accessing the slot of a class or of an instance in a defclass form doesn't make a lot of sense.
2:20:00
Xach
thrashdin: you usually access slots in methods of the (re)initialization protocol generic functions.
2:39:27
aeth
I tend to treat CL as more of a Java sort of thing (don't access slots directly) than Python (access slots directly). It's not as annoying as Java because the getters/setters are automatic so there's not a lot of boilerplate. This is a case where I'd have a bit of boilerplate, though. You can do fancy things with slots using the meta-object protocol (MOP), but if you do that, then you're going to lose all weekend learning about it just to w
2:41:36
aeth
i.e. I don't know what you want to do, but I'd probably wrap slot access in methods and require the use of those methods, assuming that it can't just be done in the DEFMETHOD INITIALIZE-INSTANCE :AFTER constructor of the class