Semantic Indentation is an actively used design pattern. With this pattern, programmers indent their code blocks with whitespace instead of using braces, brackets, or other visible characters.
- Have a question about Semantic Indentation not answered here? Email me and let me know how I can help.
- Read more about Semantic Indentation
Languages with Semantic Indentation include abc, aldor, argdown, bml, boo, buddyscript, cirru, cobra, coffeescript, csl, curry, elfe, elixir, f-sharp, genie, haml, haskell, i-expressions, indental, inform, iswim, literate-coffeescript, livescript, madcap-vi, madcap, makefile, markdown, miranda, nemerle, net-format, nim, occam, ogdl, org, p4p, promal, purescript, python, restructuredtext, sass, scss, sheep-lang, spin, stylus, sweet-expressions, wisp, xl-programming-language, yaml, z-expressions
Example from cirru:
print + 1 2 , 11
Example from purescript:
-- https://github.com/purescript/documentation/blob/master/language/Syntax.md -- Syntax is whitespace sensitive. The general rule of thumb is that declarations which span multiple lines should be indented past the column on which they were first defined on their subsequent lines. foo = bar + baz
Example from sheep-lang:
define pythtree ax:real ay:real bx:real by:real depth:int do cx = ax-ay+by end
Example from z-expressions:
defun message msg do print : Here's a message print msg print : End of message.
Last updated February 18th, 2020