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.

author avatar
14 articles by 1 author

​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…

Dale Mandeville
Updated by Dale Mandeville

​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…

Scott Waldron
Updated by Scott Waldron

​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…

Dale Mandeville
Updated by Dale Mandeville

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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;…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

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…

Scott Waldron
Updated by Scott Waldron

Contact