Am Freitag, 18. Januar 2013, 13:08:36 schrieb David A. Wheeler: > Arne Babenhauserheide: > > I've been pondering why using ! for indentation, \\ for empty and $ > > for sublist feels so alien to me, and today I finally found an answer, > > when I looked into letter distributions[^1]. > > An interesting approach!
Thanks :) It seems pretty natural, now that I found it, but it is strange how long it took me to get there. And it is pretty strange that lisp got the character distribution as right as they could: Besides the brackets, it uses . , ' and ", which are (barring mathematical symbols and strangely the : ) all the special charakters in the first three groups. \n ., -()":' /*<>?!\; % Maybe that’s one of the appeals of lisp: If you manage to ignore the brackets, its letter distribution is really close to normal text. (though using ! and ? in the names of frequently used functions/macros (like (set!)) seems like a pretty bad idea to me… - but that does not come from the old lisps but from scheme). The only frequent special symbols which lisp does not use for syntax are the linebreak and the colon (:), and for the linebreak that changes with sweet expressions. So, barring group and sublist, sweet expressions use the most frequent non-math special letters. And the brackets are the first symmetrical symbol in normal text, so there’s no escaping them for delimiting (except for indentation). > I don't think that "normal writing" is the best model for comparison. > Instead, I would use as the model "typical programs in widely-used > programming languages". I think on the long run normal writing is the most important model. It must not look completely alien to current programmes, too, but normal writing is the background of every new programmer (besides math). > Also, I think word (not character) analysis > would be be the better comparison. If I would search for ideal names of functions, I’d agree. But I explicitely searched for one-character syntax elements, so word analysis would not make a difference, I think. > I wonder if your analysis would different in that case. > > That said, I'm always delighted to see quantitative analysis, so let's > discuss given the numbers available here. > > > 2. In lisp brackets are the first letter, but people tend to remember > > words by their first letter. > > Agreed. Again, I think the better model is "typical programs in > widely used programming languages", or at least mathematics > (since people spend 10-20 years using math notation in school, and > decades afterwards using it). … > But I wouldn't want to use "*" because it's useful to be able to multiply a > bunch of complex constructs by doing this: > * > ! calculate1 ... > ! calculate2 ... > ... That is a really nice construct! > > But , ' and : on their own, not at the beginning of a line and > > surrounded by whitespace have no meaning in lisp (to the best of my > > knowledge). > > Two of them do have problems. The ' is quote, and , is unquote. These > abbreviations already have specific meanings when followed by text I think that this is actually an advantage: They are already defined, so they do not add another syntax-character, and at least for sublists they cannot appear at that place - or that’s what I thought. But now as I was writing this, I just tested it in guile and realized that (+ ' 1) is the same as (+ '1), so they cannot be used for sublists. > A lone ":" could, as far as I know, be used as a marker. I kind-of hate to > use it that way, though, because ":" is a pretty plausible user symbol for > various operations. Hm, yes. The emacs source contains 41 instances of "(: " but only 6 instances of "($ ". But it has no instance of "(: (" that is the syntax which would become impossible via pure sweet expressions using ":" for group. And the emacs source contains 603 instances os "(group " and still 139 instances os "(group (", which could not be written in SRFI-49 style. So those 41 instances of "(: " are pretty tame, I think. > While "$" already has a history for the meaning currently given I don’t really count Haskell as widespread language, so I don’t think that this makes much difference for adoption - at least less than the penalty for readability… (also keep in mind that $ is common in the USA, but in the rest of the world people don’t see the dollar-sign all the time, so the reception might be quite different) > , ":" does not. Spelling the GROUP_SPLIT operator as ":" instead of "\\" > does have some appeal, in particular, it does look reasonable as the SPLIT > operator. But I worry about making another single-character symbol > unavailable to users; it's pretty unlikely that they're using \\, and > one-character symbols are really handy. They are handy, but on the other hand it is important to have elegant core-syntax. It would be nice to have more info how much ":" is used in real-life scheme packages. Sadly I can only check emacs (and there it’s pretty rare). Best wishes, Arne -- 1w6 sie zu achten, sie alle zu finden, in Spiele zu leiten und sacht zu verbinden. → http://1w6.org
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122912
_______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss