On Thu, Mar 27, 2014 at 1:20 PM, Zach Beane xach@xach.com wrote:
femlisp side-effects *READ-DEFAULT-FLOAT-FORMAT*, which means that every system compiled after it will be treated differently than if it were compiled before it — and once again, whoever writes the system does not and cannot control the order in which things are compiled, which ultimately depends on what toplevel system the user operates on and what systems have or haven't already been compiled (and are up to date) before he operates on that toplevel system. This means that the semantics of your system are already dependent not just on the REPL but also other uncontrolled and uncontrollable state. This is not desirable.
I do have control: If femlisp or any other library makes a boneheaded decision that breaks my software, I can stop using it.
That is less of an option with ASDF.
If the semantics of your software depends 1.0 being 1.0f0 rather than 1.0d0, by expecting *read-default-float-format* to be 'single-float, you are already setting yourself for failure if you don't also make sure *read-default-float-format* is properly bound.
If you control the top-level application, you can certainly counter the femlisp binding with your own.
The problem is if you provide a different library and also expect *read-default-float-format* to be bound to a certain value without binding it yourself — some user is bound to suffer. And if you bind it through a side-effect, you are bound to bring sorrow to users of other libraries.
With the current ASDF contract, library authors cannot depend on *read-default-float-format* yet also should not modify it globally either. This is unfortunate.
That said, one option would indeed be to declare that femlisp is broken, by desiring to write 1.0 and expect it to be 1.0d0 without binding *read-default-float-format* around every file.
Consider other variables, like *READ-BASE*. Aren't library authors entitled to expect it to be 10? I'd say they are, and ASDF is only making things easier by binding it to 10 by default, which only makes it nicer on those who want to make it 8, 16 or 36 locally, and can now do it safely in their own files or at the REPL.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The only saving grace of government is that they're incompetent, because if they could do what they really want, it would be horrible for all of us