Subscribe Bookmark
gail_massari

Community Manager

Joined:

Feb 27, 2013

Expression Handling Functions: Part I - Unraveling the Expr(), NameExpr(), Eval(), ... Conundrum

This article originally appeared in JMPer Cable, Issue 26, Winter 2010

by Joseph Morgan joseph.morgan, JMP Senior Software Developer, SAS

Note: The JSL in this article is compatible with JMP 9 and later.  Accordingly, the code may not reflect the power of JSL introduced with versions of JMP released subsequent to JMP 9.


Introduction

Many beginning and intermediate JMP Scripting Language (JSL) programmers are unaware of the power of abstraction available from JSL expressions. Such meta-programming constructs are not always available in widely used programming languages such as C++ but are commonly found in functional programming languages such as Lisp.

As it turns out, such constructs are particularly useful when the application being developed is complex. They facilitate process abstraction. Robert Sebesta (1999) describes abstraction:

“The ability to define and then use complicated structures or operations in ways that allow many of the details to be ignored. The degree of abstraction allowed and the naturalness of its expression is important.”

This article attempts to unravel the mystery surrounding JSL expression handling functions and show how such functions can be used to solve nontrivial JSL programming challenges.

Concluding Comments

The primary purpose of these examples is to illustrate the use of several expression-handling functions. A secondary purpose is to point out common errors and misunderstandings that JSL programmers sometimes experience when attempting to use these functions. Hopefully, we have partly achieved that objective.

References

SAS Institute, Inc. (2008), JMP Scripting Guide, Cary, NC: SAS Institute, Inc.

Sebesta, Robert M. (1999), Concepts of Programming Languages, Addison Wesley, Reading, MA.

2 Comments
Community Trekker

Great article!  Where can I go for part 2 or back issues of JMPer Cable?

Community Manager

John,

Joseph Morgan joseph.morgan is planning a Part 2 for the end of Summer 2015.  We plan to publish his article, and all other JMPer Cable articles, here in The JMP Community.

Back issues of JMPer Cable are here: http://www.jmp.com/en_us/newsletters/jmper-cable/back-issues.html

Article Tags