- When writing macros, the number and order of evaluation are pretty tricky to handle. There exists a macro "rebinding" in some Common Lisp implementations that allows for  dealing with those issues. With "rebinding", the for macro could be written as follows:

(defmacro for ((var start stop) &body body)
  (rebinding (start stop)
    `(do ((,var ,start (1+ ,var)))
         ((> ,var ,stop))
       ,@body)))

The idea is that rebinding ensures that the expression start is evaluated first, the expression stop is evaluated second, and none of these two expressions are evaluated again in the resulting code.

How can "rebinding" be implemented. Hint: The code fragment passed to "rebinding" does not need to be transformed, but it only needs to be wrapped by appropriate local variable definitions.

- Assume you have defined a point structure, like this.

(defstruct point x y)

Implement a read macro that allows you to specify instances of point with square brackets, so for example [10 15] should be equivalent to (make-point :x 10 :y 15).

- A typical problem one encounters when using the Lisp listener is the following. Assume that you have a package defined that exports a few symbols, like this.

(defpackage :some-package
  (:export :some-function))

(in-package :some-package)

(defun some-function (x) (+ x x))

You type the following in the listener.

? (some-function 5)
> Error: undefined function SOME-FUNCTION called with arguments (5).

That's because you have forgotten to use the package :some-package. So you say this:

? (use-package :some-package)
> Error: Using package "SOME-PACKAGE" in package "COMMON-LISP-USER" would cause name conflicts with symbols already present in that package.

Why does this error occur? How can you solve it?

- Under what circumstances does it make sense to use the :: syntax to access internal symbols in another package?

- How can you find out whether a symbol is accessible in a package?