Dino Script® Language Reference
Appendix A: Trestle®/Dino Script® Integration
An additional appendix for the Dino language to showcase integration of Dino script with platform code.
Adding New Functionality with Dino Script XCommand™
Topics In this Article. Introduction to XCommand Walkthrough: Creating an Action Menu Item. Walkthrough: Capturing an Event.. Command Attribute Reference. Parameter Attribute Reference. Using Functio…
Introduction
Introduction. Dino Script™ is a script-oriented programming language. This means Dino Script stores its program text in scripts (which could be a file, database record, etc.), but also allows importing in a manner…
Dino Script™ Table of Contents
Introduction. Concepts. Syntax. Expression Types. Operators. Variables. Blocks and Scopes. Keywords. Symbol Visibility (public, private). Built-in Functions. Custom Functions (defs). Anonymous Functi…
Operators
All computer languages define operators. There are two basic kinds of operators: binary (very common), and unary (less common). A binary operator has a left-hand side (LHS) expression and a right-han…
Concepts
The Sandbox. The sandbox is based on a very similar premise: if you cannot import the type or module, you cannot use it. Dino does not attempt to use confusing combinations of attributes and permissi…
Syntax
Syntax. Dino syntax is simple and expressive. Great care has been taken to make each statement or expression intuitive and easy to remember. Where possible, Dino prefers a plain language way to expre…
Expression Types
As explained, an expression is something that returns a value. That value can be itself, or it can be a combination of other expressions, or a symbol (variable) lookup. Literal Values. Literals are t…
Keywords
Dino defines a set of keywords (reserved words) which cannot be used as identifiers for symbols or custom functions. The keywords are, in alphabetical order: __args__ , __init__ , __sandbox__ , alway…
Variables
Variables in Dino must be declared , using the var keyword, followed by an identifier , followed by the = sign, then an expression. var x = 0; var a, b, c = null; // declare all null at once y = 20;…
Blocks and Scopes
Dino uses braces { and } as block delimiters. A block in Dino defines a new scope where symbols reside. The top scope (anything not within {}) is called the global scope. Symbol redefinition is consi…
Built-In Functions
Dino has several built-in functions that can make it easier to create common data structures without resorting to imports from types of the host language. assert(expr [, onFailure]). Asserts that som…
Custom Functions (defs)
In addition to the Dino built-in functions, you can of course define your own functions. The keyword def is used to start a function definition. def triassic() { return 'T-Rex came later'; } Function…
Anonymous Functions
Anonymous functions can be a confusing topic, so a "quick start" is in order to explain the thinking behind them, and how they integrate with the host language. Anonymous Functions Quick Start. Consi…
Conditional Statements
Dino defines several conditional statements that choose options based on the truth of an expression. In most places in Dino, an assignment expression (a = 5) is allowed. However, because the followin…
The Context Object
Event handlers have the sender. But what do custom functions have? Wouldn’t it be nice if there was an analog to the sender parameter, but for every other type of function? Dino defines just such a t…
FAQ
Here we answer your questions about the current state of Dino, possible future directions, and help with some concepts that generate the most questions. About Dino. These are questions about Dino, de…
Dino Cookbook
Deferred Evaluation. We'll be expanding the documentation in this section soon. Please contact us if you have questions. Dynamic Script Integration Points. We'll be expanding the documentation in thi…
Sandbox In-Depth
Why have a sandbox at all? Consider this business rule engine written to run in IronPython. This engine allows adding “commands” which the user can execute in a context. Here is the relevant Python c…
Functions as Delegates
As outlined above, functions are often passed to other functions, either within Dino itself or back to the host language, as callbacks. Because Dino is a dynamically-typed language, the host language…
Style Guidelines
For the most part, Dino doesn’t really care how your code is formatted. Because it requires statement terminators (;) and block boundaries ({}) – spaces, tabs, and linefeeds (collectively known as wh…
Native Types
Dino can access nearly all native types (.NET classes), along with their public methods (instance or static), public properties, public events, public fields, and public indexers. Dino can also handl…
Aliasing
All Dino imports can be aliased. Sometimes this is helpful to save a few keystrokes later, and other times it is downright essential – some types must be aliased on import. Sometimes, as when importi…
Other Dino Scripts
Dino is a “script-oriented” language. What that means is that you can import scripts into the current script, either as top-level variables and functions, or as an object-like construct using an alia…