Re: Using "internal" macros of a CL implementation





Victor Kryukov wrote:
Hello group,

I've the following question: I want to define macro case-string, which
behaves exactly like case, only using string-equal instead of eql.

I've looked up definition of case in SBCL[*], and realized that my
task is as simple as

(defmacro case-string (keyform &body cases)
(case-body 'case keyform cases t 'string-equal nil nil nil))

My problem is with case-body - it's not imported by default, and I
don't know how to import it (I guess that my problem is with
understanding how packages work, strictly speaking). I also don't know
how to make my definition of case-string portable - I guess not all CL
implementations may use case-body internally.

And I don't want simply to copy-paste case-body definition in my source
files - it's seems to be not elegant, I would need to copy definition
of list-of-length-at-least-p as well, etc.

Is there any elegant solution?

COND.

kt

--
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
-- Smiling husband to scowling wife, New Yorker cartoon
.



Relevant Pages

  • Using "internal" macros of a CL implementation
    ... (defmacro case-string (keyform &body cases) ... (case-body 'case keyform cases t 'string-equal nil nil nil)) ... My problem is with case-body - it's not imported by default, ... Is there any elegant solution? ...
    (comp.lang.lisp)
  • Re: Using "internal" macros of a CL implementation
    ... (defmacro case-string (keyform &body cases) ... (case-body 'case keyform cases t 'string-equal nil nil nil)) ... My problem is with case-body - it's not imported by default, ...
    (comp.lang.lisp)
  • Re: Using "internal" macros of a CL implementation
    ... (defmacro case-string (keyform &body cases) ... (case-body 'case keyform cases t 'string-equal nil nil nil)) ... My problem is with case-body - it's not imported by default, ... Il faut ce qu'il faut. ...
    (comp.lang.lisp)
  • Re: Using "internal" macros of a CL implementation
    ... (case-body 'case keyform cases t 'string-equal nil nil nil)) ... (case-body 'case-string keyform cases t 'string-equal nil nil nil)) ...
    (comp.lang.lisp)