3 ms·
Sounds cool. I don't use emacs at all, but maybe you can post it anyways?
by cheatercheater 15y ago
Sounds cool. I don't use emacs at all, but maybe you can post it anyways?
- hollerith 15y agoNow that I know you see replies to your comments, I will inform you that I disagree with your assertion that what I have been describing here is just banner style. 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.
- cheatercheater 15y agoWhat you just described totally is banner style. Don't fool yourself! You're just reducing lisp's indent idiocy to something easier to use. Indent I have seen described as "lisp style" (and there are many kinds) can never be called banner-style. Banner style's most important rule is that a new block that should stand out is given one extra indent level, as a whole, except for the header. Lisp style's most important rule is that things that lists of things should have their first element in the header, and the next elements should graphically be right under the first thing, never mind formatting and other things like that. Those concepts are in no way compatible. Anyways, this: while(aa){if(bb){ xxx} yyy} is not banner-style indent, whereas this: while(aa){ if(bb){ xxx} yyy} is. It's a little too long: about 90 lines of code Not too long for Bitbucket. This "lisp style indenting" happens in Haskell every now and then too -- luckily all the big projects I looked at use fixed size indent. It's usually a sign of a programmer who hasn't written a lot of code, but I bet someone reading this will find some guy as good as Simon Marlow doing exactly that.
- dustingetz 15y agoi'm quite confused, I'd love to read a blog post with side-by-side examples in both C-style and lisp, in both styles, laying out the benefits.