Encyclopedia > Syntactic sugar

  Article Content

Syntactic sugar

"Syntactic sugar" is a term coined by Peter J. Landin[?] for additions to the syntax of a language that do not affect its expressiveness but make it "sweeter" for humans to use. Syntactic sugar gives the programmer an alternative way of coding that is more succinct or more like some familiar notation. It does not affect the expressiveness of the formalism (compare chrome[?]).

Syntactic sugar can be easily translated ("desugared") to produce a program in some simpler "core" syntax. E.g. C's a[i] notation is syntactic sugar for *(a + i). In a (curried) functional language, all operators are really functions and the use of infix notation x+y is syntactic sugar for function application (+) x y.

Alan Perlis once quipped, "Syntactic sugar causes cancer of the semicolon."

Compare candygrammar[?], syntactic salt[?].


Based on material imported from FOLDOC



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
242

... 190s 200s 210s 220s 230s - 240s - 250s 260s 270s 280s 290s Years: 237 238 239 240 241 - 242 - 243 244 245 246 247 Events Patriarch Titus[?] succeeds Patriarch ...

 
 
 
This page was created in 36.8 ms