Chapter 39. Literal List

Represent language expression with a literal list.

       martin.follows("WardCunningham", "bigballofmud", "KentBeck", "neal4d");

39.1 How It Works

A Literal List is a language construct for forming a list data structure. Many languages provide a direct syntax for Literal List. The most obvious of these is Lisp’s (first second third); Ruby is similar [first, second, third] but not quite as elegant. These structures usually allow lists to be nested; indeed, one way of looking at an entire Lisp program is as a nested list.

Literal Lists are usually used in a function call; the parent function will then take the elements of the list and process them in some way.

Mainstream C-based languages don’t provide a useful nested ...

Get Domain Specific Languages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.