;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Package: FSet -*- ;;; File: reader.lisp ;;; Contents: Reader macros and supporting code for FSet ;;; ;;; This file is part of FSet. Copyright (c) 2007 Sympoiesis, Inc. ;;; FSet is licensed under the Lisp Lesser GNU Public License, or LLGPL. ;;; See: http://opensource.franz.com/preamble.html ;;; This license provides NO WARRANTY. (in-package :fset) ;;; This file defines two different kinds of convenience syntax for constructing ;;; the FSet datatypes: constructor macros, and reader macros that expand to ;;; invocations of the constructor macros. (Note 2008-10-25: the reader macros ;;; haven't been used much; the constructor macros seem to be as much syntax as ;;; is desirable in Lisp. But, they're here if you want them.) ;;; ;;; Each constructor macro has the same name as the type it constructs (making ;;; them somewhat like `cl:list', but with some additional features). Some ;;; examples: ;;; ;;; (set 1 2) => set containing 1 and 2 ;;; (let ((x 3)) (set 1 2 x)) => set containing 1, 2, and 3 ;;; (let ((s (set 1 2))) (set 3 ($ s) 4)) => set containing 1, 2, 3, and 4 ;;; (bag (% 11 3)) => bag with 3 occurrences of 11 ;;; (let ((b (bag 17))) (bag ($ b) 13 (% 17 2))) ;;; => bag w/ 1 occ. of 13, 3 occs. of 17 ;;; (map (2 47) (3 23)) => map from 2 to 47 and 3 to 23 ;;; (let ((m (map (2 47) (3 23)))) (map ($ m) (2 61))) ;;; => map from 2 to 61 and 3 to 23 ;;; ;;; For complete documentation, see the documentation strings below. ;;; ;;; The reader macros expand directly into invocations of the constructor macros, ;;; so the syntax is similar. Loading this file does _not_ cause these macros ;;; to be defined in the current readtable; see `fset-setup-readtable' below. ;;; ;;; Set syntax: ;;; ;;; #{