goldmosh (1) [Avatar] Offline
#1
Hi,
I have not read this book yet, but I am curious about the following:

A lot of FP languages (Lisp, Closure, Scheme, etc.) provide a macro language as their vehicle to meta programming which, for example, allows the expansion of the language and the creation of Domain Specific Languages (DSLs). Macro languages became one of the important features of FP languages, even if it is not necessarily an FP feature. Does Scala provide (or includes) a macro language? If not, is it possible to create DSLs with Scala.

Thanks.
-- Moshe
runar (53) [Avatar] Offline
#2
Re: about macro language in Scala
Yes, Scala has a macro language. We do not cover this in the book, however.
pchiusano (36) [Avatar] Offline
#3
Re: about macro language in Scala
Also, I would add that DSLs are very much possible without macros in Scala. I don't typically like to distinguish between a functional "library" and a DSL. Every well-designed library is a little language of sorts. smilie

Scala also provides a great deal of syntactic flexibility in the language, so obtaining a desired syntax for your library often does not require macros, it can be done directly in Scala.