Skip to content

Make # reader customizable #2

@sellout

Description

@sellout

E.g., something like

(defconst er-standard-sharpsign-dispatcher-alist
  (concat (er-enumerate-sharpsign-digit-dispatchers)
          (er-enumerate-original-sharpsign-dispatchers)
          '((?\' . (lambda (in x) (list 'function (er-read-datum in)))))))

(defcustom er-sharpsign-dispatcher-alist er-standard-sharpsign-dispatcher-alist
  "An alist mapping characters following ?# to reader functions.")

;; This regexp reader can now be conditionally enabled
(add-to-list er-sharpsign-dispatcher-alist
             '(?\/ . (lambda (in x) (er-read-regexp in))))

Or, to prevent users from breaking the elisp reader completely, the alist could start empty and only be used before er-croak in the catchall of your existing dispatcher.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions