libera/#commonlisp - IRC Chatlog
Search
13:52:07
jackdaniel
haa, this is funny, ecl has similar syntax, but first two arguments are reversed
13:56:16
Nilby
just the basic serialization problem. if you print values and try to re-read them, in a different impl, but of course even a different image
13:57:56
jackdaniel
ah, I see - so its about reader/writer; I thought that something repl specific and I couldn't think what (admittedly repl is haf about read and print)
14:00:08
jackdaniel
#< enables a secret language that common lisp doesn't understand - it's just in case when it revolts
14:02:16
Nilby
I feel like a lot of these problems could potentially be solved by more CLOSification of the built-in things
14:03:20
jackdaniel
you may have hash-table as a standard class, but how do you serialize it? it is not that hash table maintains an assoc list
14:21:26
phoe
you can always write a custom macro and have custom lambda lists in it, you don't really need a library for that
14:22:02
phoe
as for existing lambda lists defined by the specification, there's no way to extend them and you'll have to modify your implementation in order to support them
14:22:29
jackdaniel
(defmapckage better-cl (:use)) (in-package better-cl) (cl:defmacro defun (name args cl:&body body) go!))
14:24:41
emacs-dwim
let+ combines several binding forms, multiple-values. It's user-extensible. So I added ppcre & trivia to it for example. I want to write defmacros that &match trivia patterns and bind them.
14:25:41
beach
emacs-dwim: The current idea with some of us is that the s-expression-syntax library provides parsers for various standard expressions. And it should be possible to define custom parsers for extended lambda lists.
14:26:23
phoe
as for the lambda list in DEFMACRO, there is no portable way to extend its lambda list other than supplying your own variant of DEFMACRO that can do this.
14:26:39
beach
emacs-dwim: It is tricky stuff because custom lambda-list keywords must also come with a description that says where they can appear, if and how many arguments they take, if they can appear several times, etc.
14:34:06
beach
emacs-dwim: It is not quite ready for widespread use, so you might run into some issues. But it would be good to start experimenting with it.
15:22:57
beach
nij-: Of course, you are somewhat out of luck, because BOUNDP doesn't really tell you what you want. There is some annoyingly ambiguous language in the standard. Sometimes "bound" means "has a value", and sometimes it means "has a binding that may have no value".
15:24:22
beach
Like if you do (DEFVAR XYZ) and then (BOUNDP 'XYZ) you get NIL. Yet, XYZ is a variable.
15:25:43
jmes
Is there a way to shadow a binding with a symbol-macro whose expansion references the original binding? e.g. this is what I want to do, but it exhausts the control stack: (let ((a 1)) (symbol-macrolet ((a (1+ a))) ...))
15:26:07
White_Flame
a really silly way is to do packagename:<tab> and see everything that is earmuffed with asterisks :-P
15:27:31
Shinmera
(definitions:find-definitions *package* :type 'definitions:special-variable) will give you whatever variables are accessible in the current package.
15:28:10
beach
jmes: How about something like (let ((a 1)) (symbol-macrolet ((mumble a)) (symbol-macrolet ((a (1+ mumble))))))
15:32:55
Bike
symbol macros just expand in the same context, so if the original variable appears in the expansion it will just be expanded again
15:36:06
jmes
Bike: yeah, so what I've learned is if a symbol-macro expansion has its own symbol inside it then the stack goes boom, sadly.
15:56:00
Bike
of course, for something like 1+ there's no need to refer to the actual binding, so (let ((mumble a)) (symbol-macrolet ((a (1+ mumble))) ...)) would work, but maybe you want it as an actual place
17:30:06
pjb
jmes: (let ((a 1)) (flet ((get-a () a)) (symbol-macrolet ((a (1+ (get-a)))) a))) #| --> 2 |#
18:45:22
NotThatRPG
Having a momentary memory lapse: isn't there a library that offers a `partition-if` function? If so, could someone point me at it?