[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

=?UTF-8?Q?Re=3A_=5Bxml=2Ddev=5D_Here=E2=80=99s_why_you_should_be_creatin

  • From: Ihe Onwuka <ihe.onwuka@gmail.com>
  • To: "Costello, Roger L." <costello@mitre.org>
  • Date: Thu, 4 Aug 2016 15:29:39 -0400

=?UTF-8?Q?Re=3A_=5Bxml=2Ddev=5D_Here=E2=80=99s_why_you_should_be_creatin


On Thu, Aug 4, 2016 at 2:45 PM, Costello, Roger L. <costello@mitre.org> wrote:

Hi Folks,

Would you provide a use case for creating two levels of syntax please?

I will provide two use cases, one from Lisp and the other from XML:Books.

Use Case #1: Recall from my previous message that the Lisp language defines two levels of syntax: s-expressions and Lisp forms. A list that is an s-expression may contain any elements, whereas a list that is a Lisp form must start with a symbol (This is a bit simplified – see John Cowan’s post). Now here’s why the Lisp folks created two levels of syntax: Lisp has functions and macros. The arguments to a function must be Lisp forms, which are evaluated before calling the function. Conversely, the arguments to a macro only have to be s-expressions, the arguments are not evaluated before calling the macro; the macro assigns a meaning to the s-expression (very neat!). (I realize this explanation is a bit terse. Hopefully, however, it gives you some feel for why two levels of syntax are important/needed in Lisp.)



The reason LISP/Scheme has special forms is because certain procedures wouldn't work if they followed the evaluation rules for s-expressions. The classic example is an if function because you don't want all it's arguments  to be evaluated before it is invoked. 

What you are exemplifying in this thread doesn't seem to follow that line of reasoning. 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.