Is there the equivalent of Common Lisp's /structure/ type in
Racket?  I looked through Racket's User Guide and Reference
manuals but did not see something similar, although it's
quite possible that I saw one but did not recognize it.

Specifically, here is what I want.  Consider the Common Lips
definition of a /person/ structure:

(defstruct person
           name
           age
           waist-size
           favorite-color)

Then create an instance:

(make-person :age 35
             :favorite-color "blue"
             :name "Bob")

The latter echos:

  #S(PERSON :NAME "Bob" :AGE 35 :WAIST-SIZE NIL :FAVORITE-COLOR "blue")

Let's note that the order of fields when invoking /make-person/
need not be the same as the order in which the /person/
structure is defined.

Furthermore, since /waist-size/ was not specified at invocation,
it was assigned NIL.

-- 
Rouben Rostamian

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to