add generic-ciel by removing a couple conflicting symbols

This commit is contained in:
vindarel 2021-05-12 11:57:36 +02:00
parent 7124f93cf6
commit 152ccabd88
5 changed files with 67 additions and 24 deletions

View file

@ -99,7 +99,16 @@ Once installed, create a package and =:use= =ciel= in addition of =cl=:
(:use :cl :ciel))
#+end_src
/NB: this is likely to change in the future./
You can also use =generic-ciel=, based on [[https://github.com/alex-gutev/generic-cl/][generic-cl]]:
#+begin_src
(defpackage yourpackage
(:use :cl :generic-ciel))
#+end_src
generic-cl allows us to define our =+= or =equalp= methods for our
own objects (and more).
** With Quicklisp

View file

@ -81,13 +81,6 @@ ARGLIST: `(object &key (test #'eql) (key #'identity))`
FUNCTION: Returns true if OBJECT is a list that denotes a set, NIL otherwise. A list
denotes a set if each element of the list is unique under KEY and TEST.
## EMPTYP
ARGLIST: `(sequence)`
FUNCTION: Returns T if SEQUENCE is an empty sequence and NIL
otherwise. Signals an error if SEQUENCE is not a sequence.
## SHUFFLE

View file

@ -1,6 +1,8 @@
# Install
Once you have it installed, see the next section on how to create your package definition with `CIEL`.
## With Quicklisp
You need a Lisp implementation and Quicklisp installed.
@ -96,3 +98,24 @@ You can also switch it on and off from the REPL:
``` commonlisp
(setf sbcli:*syntax-highlighting* t)
```
# Use in the REPL and in new packages
On the REPL, enter the `ciel-user` package instead of `cl-user` (`,in-package RET ciel-user`).
Use CIEL in your own packages by `use`-ing it in addition of `cl`:
~~~lisp
(defpackage yourpackage
(:use :cl :ciel))
~~~
You can also use `generic-ciel`, based on [generic-cl](https://github.com/alex-gutev/generic-cl/):
~~~lisp
(defpackage yourpackage
(:use :cl :generic-ciel))
~~~
`generic-cl` allows us to define our `+` or `equalp` methods for our
own objects (and more).

View file

@ -269,15 +269,6 @@ STRICT determines whether to check that the list actually is a set.
The resulting hash table has the elements of SET for both its keys and
values. That is, each element of SET is stored as if by
(setf (gethash (key element) table) element)
## HASH-TABLE-SET
ARGLIST: `(table &key (strict t) (test #'eql) (key #'identity))`
FUNCTION: Return the set denoted by TABLE.
Given STRICT, check that the table actually denotes a set.
Without STRICT, equivalent to `hash-table-values'.
## HASH-TABLE-PREDICATE

View file

@ -6,6 +6,30 @@
:enable-pythonic-string-syntax
:enable-punch-syntax))
#|
Currently, usage is to "use" ciel along with cl:
(defpackage mypackage
(:use :cl :ciel))
How we build this package
=========================
A note on symbol conflicts.
We like very much Alexandria, Serapeum and Generic-cl. However we
can't "use" them all at once, some symbols conflict. And some are very
different things, especially with generic-cl. For example:
SERAPEUM:HASH-TABLE-SET and GENERIC-CL:HASH-TABLE-SET.
We think that providing the user with Serapeum's symbol on CIEL-USER
on one hand, and with Generic-cl's one on GENERIC-CIEL on the other
hand is the thing not to do. So we don't import these symbols by
default in CIEL. They are present in GENERIC-CIEL (since we "use"
generic-cl).
|#
(in-package :ciel)
@ -57,8 +81,8 @@ We currently only try this with serapeum. See *deps/serapeum/sequences-hashtable
:dohash ;; key value ht
:dolist* ;; position value list
;; :doplist ;; already from alexandria
:doseq ;; value sequence
:doseq* ;; position value sequence
;; :doseq ;; value sequence ;; conflicts with generic-cl
;; :doseq* ;; position value sequence
))
(cl-reexport:reexport-from :repl-utilities
@ -85,7 +109,7 @@ We currently only try this with serapeum. See *deps/serapeum/sequences-hashtable
:flatten
:setp
:emptyp
;; :emptyp ;; conflicts with generic-cl
:shuffle
:random-elt
:length=
@ -131,7 +155,7 @@ We currently only try this with serapeum. See *deps/serapeum/sequences-hashtable
:merge-tables
:flip-hash-table
:set-hash-table
:hash-table-set
;; :hash-table-set ;; conflicts with generic-cl. They are different things.
:hash-table-predicate
:hash-table-function
:make-hash-table-function
@ -248,6 +272,9 @@ We currently only try this with serapeum. See *deps/serapeum/sequences-hashtable
(with-output-to-string (s)
(symbol-documentation sym :stream s)))))))
;;
;; Generate documentation.
;;
#+only-with-a-C-c-C-c
(generate-dependencies-page-reference)
@ -259,9 +286,9 @@ We currently only try this with serapeum. See *deps/serapeum/sequences-hashtable
(:http :dexador)))
;TODO: a conflict between Serapeum and generic-cl
;; (defpackage generic-ciel
;; (:use :generic-cl
;; :ciel))
(defpackage generic-ciel
(:use :generic-cl
:ciel))
(in-package :ciel-user)