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, 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, 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 z-expressions:
defun message msg do print : Here's a message print msg print : End of message.
Last updated January 24th, 2020