Skip to content
This repository was archived by the owner on Dec 29, 2018. It is now read-only.
This repository was archived by the owner on Dec 29, 2018. It is now read-only.

Inline list pattern #103

@david-a-wheeler

Description

@david-a-wheeler

The "list" and "list*" patterns are nice, but sometimes it's convenient to have them inline (so that the list itself doesn't need to be spliced in).

Consider adding these as built-in:

(defpattern ilist (arg)
  (when (consp arg) `(cons ,(car arg) (ilist ,(cdr arg)))))

(defpattern ilist* (arg)
   (if (null (cdr arg)) `(and ,(car arg) (type list)) `(cons ,(car arg) (ilist* ,(cdr arg)))))

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