Skip to content

Instantly share code, notes, and snippets.

@fstamour
Last active November 29, 2023 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fstamour/bacda529ac73a05505e98b43ea2d4fc8 to your computer and use it in GitHub Desktop.
Save fstamour/bacda529ac73a05505e98b43ea2d4fc8 to your computer and use it in GitHub Desktop.
cl-car
@fstamour
Copy link
Author

fstamour commented Jan 21, 2022

This is an existing list of suggestions gathered by somebody else:

https://discord.com/channels/297478281278652417/734079862066642944/905492234542121030

any comments on this by the way?
https://github.com/commander-trashdin/clng

  • Dovahkin 3 Nov 2021

@fstamour
Copy link
Author

fstamour commented Jan 21, 2022

I think I found another bad MOP edge case: http://clhs.lisp.se/Body/04_cf.htm says

If a class is redefined in such a way that the set of local slots accessible in an instance of the class is changed, a two-step process of updating the instances of the class takes place. The process may be explicitly started by invoking the generic function make-instances-obsolete. This two-step process can happen in other circumstances in some implementations. For example, in some implementations this two-step process is triggered if the order of slots in storage is changed.

The first step modifies the structure of the instance by adding new local slots and discarding local slots that are not defined in the new version of the class. The second step initializes the newly-added local slots and performs any other user-defined actions. These two steps are further specified in the next two sections.

so the first step is internal to the implementation, the second one is programmable, see http://clhs.lisp.se/Body/04_cfb.htm:

The second step initializes the newly added local slots and performs any other user-defined actions. This step is implemented by the generic function update-instance-for-redefined-class, which is called after completion of the first step of modifying the structure of the instance.

the spec says nothing on what happens if u-i-f-r-c signals an error.
on SBCL right now this results in half-baked updates where the slots are in there but uninitialized, and I see no good way to try to initialize them again even after knowing that u-i-f-r-c failed.

  • phoe 7 Jan 2021

@fstamour
Copy link
Author

fstamour commented Jan 21, 2022

From myself, on discord

Here's an idea: most RFC could in fact be a library/test-suite. (We already have tons of trivial-* libraries also... thinking )

@fstamour
Copy link
Author

Package locks

@fstamour
Copy link
Author

fstamour commented Jan 27, 2022

make-string-output-stream doesn't accept an existing string with a fill-pointer

@fstamour
Copy link
Author

@fstamour
Copy link
Author

Advising functions

@fstamour
Copy link
Author

fstamour commented Jan 31, 2022

There's no way to define your own (defun (compound name) ...)

@fstamour
Copy link
Author

fstamour commented Feb 2, 2022

sleep with sub-second precision

Already in the standard, my bad

@fstamour
Copy link
Author

@fstamour
Copy link
Author

symbol aliases

https://discord.com/channels/297478281278652417/297478350145060875/966815899711582208

declaratively, through defpackage:

(defpackage #:pkg
  (:import-from #:alexandria
     #:unionf #:removef
     (#:line-up-last #:->>)
     (#:line-up-first #:->)))

Where the car is the original symbol and the cdr is the list of aliases

@fstamour
Copy link
Author

@fstamour
Copy link
Author

from me:

It could be nice if digit-char could take a third argument for the alphabet

@fstamour
Copy link
Author

Extensible intern

@fstamour
Copy link
Author

@Gleefre
Copy link

Gleefre commented Nov 27, 2023

There should be a CDR for package-local nicknames. (see https://github.com/Gleefre/cdr-package-local-nicknames/ for a draft I wrote some time ago -- a rewrite is probably needed)

@Gleefre
Copy link

Gleefre commented Nov 27, 2023

Structures should be less under-specified. For example slot-... functions should work on those (unless :type is vector or list); it should be possible to meaningfully use structure-class; there should be ensure-struct function.

@Gleefre
Copy link

Gleefre commented Nov 27, 2023

@Gleefre
Copy link

Gleefre commented Nov 29, 2023

[ until cl-car is fully up, will continue writing ideas here ]

There should be compiler-macro-let or similar.

@fstamour
Copy link
Author

[ until cl-car is fully up, will continue writing ideas here ]

I think it would be better to just create a discussion in cl-car

Maybe the title could be just "compiler-macro-let"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment