Curl (programming Language) - Syntax

Syntax

A simple Curl applet for HelloWorld might be

{Curl 5.0, 6.0, 7.0 applet} {text color = "blue", font-size = 16pt, Hello World}

This code will run if the user has at least one of the Curl versions 5.0, 6.0, or 7.0 installed.

Curl provides both macros and text-procedures in addition to anonymous procedures and named methods. An alternative using the text-procedure paragraph would be:

{paragraph paragraph-left-indent=0.5in, {text color = "red", font-size = 12pt, Hello} {text color = "green", font-size = 12pt, World}}

Recently this style of layout has been adopted by "builders" in the Groovy language for the JVM, but is also familiar to users of CSS or Tcl/Tk. Most features for web applications now implemented through combinations of JavaScript libraries + HTML + CSS are already found within the Curl language, including features usually associated with Prototype + script.aculo.us such as accordion panes.

Curl sets callbacks in the manner also adopted by Groovy:

{CommandButton width=100pt, height = 50pt, label = {center {bold Invokes an event handler when clicked}}, control-color = "orange", || Attach the following event handler to this CommandButton {on Action do {popup-message title = "Your Message", "This is a user message dialog." } }}

Curl comments use the vertical bar in several variations. The simplest is as follows:

{text A comment can be on a line by itself, || A comment on a line by itself or it can be at the end || A comment on the same line as code of a line.}

Read more about this topic:  Curl (programming Language)