[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

loadtime conditionalization.

    Date: Fri, 10 Jun 88 19:23 PDT
    From: Jerry@MARLOWE.inference.dialnet.symbolics.com (Jerry Bakin)


    Failing that, I would like to add code such as the following within
    tcp-stubs and always load it:

    (when (fboundp 'tcp::add-tcp-port-for-protocol)
      (tcp::add-tcp-port-for-protocol :sna-simulation 2050))

    (unless (find 'tcp-error sys:*all-flavor-names*)
      (defflavor tcp-error () ()))

    The problem is that upon compiling, I get many warnings similar to the

    Warning (not associated with any definition):
      A DEFFLAVOR should only occur at top level

    Well it is only a warning, but still; I'd rather not see it.

    Does anyone have any suggestions?


    Jerry Bakin.

progn will act like a top-level so you can use:

(unless (find 'tcp-error sys:*all-flavor-names*)
    (defflavor tcp-error () ())))

to avoid the warnings. This will also help you conditionalize a section of forms.