#. doesn't reset *backquote-count* around eval

Bug #1321047 reported by Faré
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

The sharp-dot reader in sharpm.lisp has a (let ((*backquote-count* 0)) ...) around its read, but not around its eval, which means that if you read or load code from within a #. you're going to have bad surprises:

* `#.(write-to-string (read-from-string "#(1 2 3)"))
"((SB-IMPL::|bqv|) 1 2 3)"

* `#.(compile () (read-from-string "(lambda () #(1 2 3))"))
; in: LAMBDA ()
; ((SB-IMPL::|bqv|) 1 2 3)
;
; caught ERROR:
; illegal function call
;
; compilation unit finished
; caught 1 ERROR condition

#<FUNCTION (LAMBDA ()) {1005B4F0AB}>

* (with-open-file (s "/tmp/foo.lisp" :direction :output :if-exists :rename-and-delete :if-does-not-exist :create) (format s "#(1 2 3)~%")) `#.(load "/tmp/foo.lisp")
;==> same error

In practice, you can't load or compile files from within a `#. — bad.

Revision history for this message
Douglas Katzman (dougk) wrote :

there's a problem with your second example for a different reason.

Changed in sbcl:
status: New → Fix Committed
Revision history for this message
Faré (fahree) wrote :

I don't see the commit — can you push?

What was wrong with my second example?

Revision history for this message
Douglas Katzman (dougk) wrote :

http://sourceforge.net/p/sbcl/sbcl/ci/ba6318ebc663a3c96a4b24360803164d9ec103a0/

oh, never mind my remark. I copied-and-pasted badly.

Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.