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

[ART@THINK-AQUINAS.ARPA: Another reader macro]



Another true-life story from a real User:
    
    Date: Tue, 18 Mar 86 01:19 EST
    From: Art Medlar
    
    I've often had a need to comment out a single s-expression
    temporarily.  Using a semicolon is reasonable only when the
    expression is on one line, and it's really annoying when the
    line containing the expression has other things that you don't
    want to comment out, like closing parentheses of super-expressions.
    #-LISPM would probably work, but it's not intended to be used
    this way, and it's too long.
    
    So I wrote the #! reader macro.  When placed immediately in front
    of a list, it causes the reader to completely ignore the list.  It's
    a lot like #| |# except it operates over a single s-expression and
    so needs no termination symbol.  It is more useful than (comment ...) 
    and (ignore ...) since comment returns the symbol COMMENT and ignore 
    returns NIL.  For example, the following form returns T 
	
	(and (minusp -1) 
	     #!(zerop 
		    (+ 4 3)) 
	     (plusp 1)
	     #!(zerop 0))
    
    To get it, load a:>utility>reader-macros.  If it doesn't cause any
    problems, I'll add it to the system.
    
    --art