freenode/#lisp - IRC Chatlog
Search
23:11:17
jasom
quick poll. I'm about to publish my YAML parser. cl-yaml parses "[[],false,null]" to (nil nil nil). I prefer it to parse to #(#() nil :null). My parser is configurable to do it both ways, but which should I default to?
23:12:40
jasom
Reason for my preference: I want to know which of the 3 values was in the actual YAML, so I'm only allowed to parse one value to nil. #() is an empty sequence already and I'm more likely to want to do (if boolean ...) than (if maybe-null ...) so null has to lose out and become a keyword.
23:13:31
jasom
I will provide a convenience function for parsing like cl-yaml if I don't default to the cl-yaml way
23:23:00
jasom
I don't need to be convinced the latter is better in a vaccum, I need to be convinced that it's enough better for the default to be incompatible with existing libraries
23:28:35
jasom
|3b|: if the documentation is correct then there is no way to sepcify variable arguments in defcallback
23:29:48
Bike
the va_list operators are macros and seem to usually involve some weird complicated shuffling, so lisp implementations might not wanna bother
23:30:22
jasom
It's actually fairly easy to implement for 1 ABI, but multiply that by how many ABIs are out there...
23:31:21
jasom
usually the first N values are passed identically to a function of N arguements, and then the rest are done with fancy stack tricks.
23:34:45
Nilby
many C APIs that have variable arguments, also have a version where it passes the va_list, e.g. vprintf, which I assume you could, perhaps unportably, use in a callback
23:43:03
|3b|
i guess i can try to redirect stderr to a file or something and look at the default logging there
23:43:36
Bike
could you write a little wrapper that gets an actual string with vsprintf and then passes that to the lisp callback?
23:44:09
Nilby
I think in practice you can do it, but it's not portable, so CFFI doesn't offer it. The va_list arg tend to be just as stack pointer, so with a stack pointer you can pull out the C args if you know exactly what they are.
23:44:47
|3b|
(not completely trivial since i'm not actually working at the tty on which the code is running, but not too horrible)
23:45:04
jasom
It's entirely possible that if you treat va_list as a void * you can pass it along opaquely to sprintf, but that's ugly...
23:51:22
jasom
|3b|: a quick test on x64 shows that va_list is indeed treated like a void *. Writing a quick cffi test now...
23:54:36
|3b|
ah, guess it only works when loaded as a dependency from other things that depend on osicat... i'll send some more PRs and get you to try again once it loads in a clean image for me
0:17:39
asarch
If you are in the BASH prompt and press the ↑ key, it will show the last command entered, however, in the Slime REPL, the cursor (the blink block) will go up in the buffer, how could you "emulate" the ↑ key function in Slime?
0:19:33
jasom
|3b|: for arm64 take a struct like this, and you can pass it along unmodified: https://github.com/ARM-software/abi-aa/blob/f52e1ad3f81254497a83578dc102f6aac89e52d0/aapcs64/aapcs64.rst#122the-va_list-type
0:30:25
jasom
|3b|: actually do to the way structs are passed by value on arm64, the void pointer should work
1:02:32
White_Flame
if you want local utility functions for your macrolet compile-time bodies use, is that possible?
1:03:19
Bike
macrolet expander functions aren't allowed to refer to the runtime lexical environment, so you can't refer to flet/labels definitions, if that's what you mean
1:05:05
Bike
you can use flet/labels within the expander itself, of course, or refer to local definitions in expansions
4:31:52
markasoftware
is there any way with MOP to change add-method so that you can add multiple methods with the same specializers and qualifiers?
4:32:22
markasoftware
the method objects themselves contain extra information that I will use in the discriminating function to determine which ones should be part of the effective method
4:33:31
Bike
i'm not sure add-method allows that, but even if it does, you'd probably have to override large portions of the machinery
4:33:36
beach
You would just have to subclass STANDARD-GENERIC-FUNCTION and provide a method on ADD-METHOD, specialized to your new class.
4:42:07
markasoftware
yeah, my plan right now is to wrap the methods with extra parameters that my library's users won't know about
6:24:57
iskander
hi all, i have a problem with SBCL startup, for some reasons it takes sometimes 2 minutes for the prompt to appear, if i interrupt it, then the debuggger says it is in quicklist/setup.lisp. Any idea what could be wrong ?
6:58:14
jackdaniel
asdf is quite heavy, quicklisp calls (require 'asdf) - but I don't think that this would account for 2 minutes on a sensible machine
7:03:28
iskander
sometimes it is quicker, maybe a minute, but in the past i didn't notice any delay at all, maybe setup for quicklisp has changed in the meantime
7:16:21
kpoeck
iskander Try (ql:update-client), I believe Xach said version 2021-02-11 has a performance problem scanning the local-projects directory. Version 2021-02-13 should fix that
7:17:09
iskander
Already did :( The most up-to-date client, version 2021-02-13, is already installed.
7:17:09
Colleen
iskander: kpoeck said 11 minutes, 38 seconds ago: Try (ql:update-client), I believe Xach said version 2021-02-11 has a performance problem scanning the local-projects directory
7:18:35
iskander
hmm, my local repositories dir contains 49 git repos, not all of them LISP, maybe if i point my repo to a subdir for LISP
10:28:02
asarch
If I: (let (a (b '(1 2 3 4 5))) and then (setf a b) and then (setf b (delete 4 b)) then a is '(1 2 3 5) and b is '(1 2 3 5), how could I a is '(1 2 3 4 5) and b just '(1 2 3 5)?
10:56:05
frodef
I'm thinking to start using github (with emacs, slime etc), any tips on tools or techniques I might find useful?
11:03:22
heisig
frodef: I'm not sure I understand your question. But my two pieces of advice would be to use Magit for managing Git from Emacs, and to prepare for leaving Github as soon as Microsoft starts acting weird.
11:04:47
scymtym
frodef: if you are not already using it, the magit package for emacs is a great interface to git. it requires a time investment to reach "fluency", but that is well worth it in my experience. if you want to go further down that road, there is the forge package which adds github-specific information and actions to magit (it also supports gitlab and other "forges")