O'Reilly logo

Domain Specific Languages by Martin Fowler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required