On 1/27/2012 9:51 AM, Rupert Swarbrick wrote:
>
> Another possibility is that, from a user perspective, the program author
> appears arrogant and unpleasant.
Having sat on both sides of this perspective, I entirely agree.
> I'm not convinced that it's ever a
> great idea to reply with PICNIC, RTFM or other acronyms that show how
> terribly clever the author is.
look up "user error" on wikipedia..
>> Statistically speaking, user error constitute a vast majority of
>> reported bugs in programs.
> In some cases, programs can be designed to make it obvious to the user
> that they're doing something weird. HAL's new line: "I'm sorry,
> Dave. I'm afraid I can't do that. And why on Earth do you want me to?"
>
> Maybe this is more difficult with something like Maxima, where there is
> a whole programming language with which a user can shoot themselves in
> the foot.
and the goal is to do "all of mathematics"...
>
>>> Are you saying that I should not expect Maxima to have sane
>>> semantics with defrule and friends?
>> If the documentation of remrule is changed, does that make it sane?
>> Maybe one should also add that any bugs that occur only when
>> simp:false, are user errors.
> Maybe. But arguing that "Maxima's behaviour when you set simp:false is
> undefined" implies that simp shouldn't be a variable a user can get to
> without diving into lisp...
That's pretty much my view. But in Maxima you can set any variable in
lisp by doing
something like ?secret_name: 1234, also.
So we cannot really make a water-tight system without other changes.
>
>>> Or do you think that I was trying to write this to improve
>>> performance?
>> Nope. The difference in performance for tellsimp/tellsimpafter should
>> be negligible. The initial implementation was complicated by the
>> notion that after a bunch of tellsimps etc one would end up with a
>> single subroutine that could be compiled into machine code. This
>> would be harder to do with a separable list of rules. In practice, no
>> one compiles the subroutine.
> If I've understood this paragraph correctly, it doesn't quite describe
> how the current code works. Each simplifying subroutine may recurse to
> a previously defined one if one exists.
Yes, it calls that function. Alternatively it could get the function
name from a list and
then call it. I don't know if the difference in execution time could be
measured.
> As such, each would be compiled
> into separate functions.
Yes
> I would expect to get identical performance
> with one function calling each simplifying routine in turn (and not
> descend so far into the stack!). With implementations like SBCL, of
> course, everything gets compiled, so the compile/don't compile thing is
> sort of moot.
I don't know what is compiled. If just "defun" forms are compiled, or
if the forms
produced by the pattern match compiler (used by tellsimp etc) also get
compiled.
Still, looking up functions in a list vs directly calling them would
distinguish your
suggestion from what is done now, right?
RJF