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


    Date: 1 September 1982 13:40-EDT
    From: Robert P. Krajewski <RpK at MIT-ML>

    Does WITH-OPEN-FILE exist in MacLisp ?  It would be a very nice
    thing to have.  I'd define a robust version of it, but I don't
    know how MacLisp does UNWIND-PROTECTs and such.  (If you take
    out the clean-up code, it's very simple.)

MacLisp does UNWIND-PROTECT by having an UNWIND-PROTECT special form just like
the LispMachine's.  There is no built-in WITH-OPEN-FILE macro, but clearly you
can write your own using UNWIND-PROTECT, or wait until KMP writes one (he'll
think of some screws you never dreamed of I'll bet) or you can convert your
code to using IOTA.

    This may be a stupid question, but why don't the objects
    returned by OPEN accept messages like :TYO, :TYI, :STRING-OUT,
    :LINE-OUT, :TRUENAME, and so on ?  All they seem to accept are
    very general messages that would be handled by the Lisp Machine
    SI:VANILLA-FLAVOR  -- :PRINT-SELF and others.

I don't understand this question in the least.  The objects returned by OPEN
don't except ANY messages.  They are not message recieving objects.  They do
have a printed representation, but that isn't accomplished by sending any
messages.  You don't do I/O by sending them messages, but by calling functions
like PRINC and TYO and passing them the "file object" as an argument.