by dustingetz · 14y ago · 0 comments
i recognize a lot of old school lispers follow a philosophy of "lisp empowers me so much that i don't need a team", so they do whatever they want and their productivity so godly that nobody says anything, but this isn't particularly helpful to increased lisp adoption, which benefits us all. maybe it isn't harmful either, but we who are already using it aren't in a position to judge this.
I use banner style in all languages and it works well.
If you write "(a (b (c (d (e (f" RET, TAB indents just as many spaces as it would if you had written just "(a" RET.
Lisp coders are accustomed to a certain pattern of indentation that would be analogous to the following in C, where xxx and yyy are typically many lines long:
while(aa){if(bb){
xxx}
yyy}
I am recommending for Lisp coders to avoid that pattern and to indent the above as follows: while(aa){
if(bb){
xxx}
yyy}
which is of course familiar to a C programmer and which we will refer to as "formula A". However, what will be unfamiliar to a C programmer is the motive behind my recommendation: namely, to make it possible to introduce into Lisp a new pattern of indentation, unfamiliar to C programmers and Lisp programmer (but familiar to Haskell programmers) in which you are allowed to write, while(aa){if(bb){
xxx}}
where again xxx is a place holder for many lines of code. However, it is important to note that the following would be a definite violation of the indentation style I recommend: while(aa){if(bb){
xxx}
yyy}
I recommend indenting that as formula A above. In other words, you can begin multiple multi-line s-expressions on the same line, but if you do, you have to close all of those multi-line s-expressions at the same time.>maybe you can post it anyways?
It's a little too long: about 90 lines of code. I could make it shorter by taking out the code that warns the user of the stylistic violation described above, but most user would want that code.