formatting of maxima code



"Stavros Macrakis" <stavros.macrakis@verizon.net> writes:

> > However, in the examples given, commands were ended with commas.
> > As I understand it, commands end in ; or $, unless they are
> > parenthesized.  Is that right?
> 
> Interactive commands end in ; or $.
> 
> Within blocks, statements are separated with commas.

Is within a block necessarily within parentheses?

> > Also, the way I have it set up now, inside parentheses, lines will
> > typically be indented one more than the opening parenthesis.  If the
> > opening parenthesis is well into a line, the output begins to look
> > bad; e.g.,
> 
> Well, that is OK, I think.  The same thing happens in C mode and Lisp
> mode.

Good.

> > The newline indentation and tab indentation won't be the same unless
> > you use reindent-then-newline-and-indent for a newline.
> 
> Aren't they are always the same in Lisp mode?  I can't see any reason
> they shouldn't ALWAYS be the same.

In Lisp, I can't think of any situation offhand where a line's
indentation would depend on the line itself, it would depend on the
previous lines.  So it probably doesn't matter, and it wouldn't make
sense to use the resources to recompute the current line's
indentation.  In something like Maxima, the indentation of a line
might depend on the actual line; after a `then', how much indentation
a line gets depends on whether it begins with an `else' or not.
I hadn't thought about it until now; perhaps programming modes
typically use the simpler newline-and-indent when it is equivalent to
reindent-..., and only uses reindent-... when necessary.  At any
rate, it would be necessary in Maxima.

Jay