level 9
_湖心龙
楼主
(defmacro my-file-position (file pos)
`(file-position ,file ,(if (< pos 0)
(+ (file-length file) pos)
pos)))
我这个宏,目的是将负数时的pos变成文件倒数位置的长度。
(my-file-positoin r 1)正常
(my-file-positoin r -1)就不正常了。
报错:
; caught ERROR:
; during macroexpansion of (MY-FILE-POSITION R -1). Use *BREAK-ON-SIGNALS* to
; intercept.
;
; The value R is not of type STREAM.
;
; compilation unit finished
; caught 1 ERROR condition
2014年08月08日 14点08分
1
`(file-position ,file ,(if (< pos 0)
(+ (file-length file) pos)
pos)))
我这个宏,目的是将负数时的pos变成文件倒数位置的长度。
(my-file-positoin r 1)正常
(my-file-positoin r -1)就不正常了。
报错:
; caught ERROR:
; during macroexpansion of (MY-FILE-POSITION R -1). Use *BREAK-ON-SIGNALS* to
; intercept.
;
; The value R is not of type STREAM.
;
; compilation unit finished
; caught 1 ERROR condition