Talk:Pastel (programming language)

Pastel syntax
There's detail from Jeff Broughton at https://forum.lazarus.freepascal.org/index.php/topic,64224.0.html:

>> Constant expressions

const = ;   (* expr can contain, constants, other named constants and operators *) (* likewise, constant-value expressions could be used in type declarations, and other places where simple constants were required *)

>> Variable initialization

var : = . (* equivalent to an assignment at the start of the block *)

>> Loop-exit form:

loop. (* loop forever, until exit condition is true *) …. exit if ; (* multiple allowed *) …. end;

>> Additional control constructs

let = do ;  (* assign the value to the variable, and execute the statement *) (* the variable is known only within the scope of the statement *)

>> Condition boolean operations

orif / andif (* analogous to || and && *)

>> Return statement

return ; (* from a function *) or return; (* in a procedure *)

>> Set iteration

for in do ;  (* perform statement with name bound to values in the set *)

>> Additional parameter passing modes

In a procedure or function declaration:

procedure xxx ( : ; … )

could be      var — by reference — by value in — by value out — copy out on return inout — by value on input and copy out on return

>> Module definition

module ; (* at the beginning of a file defines a module *)

use ; (* in another file, incorporates the definitions from another module *)

I believe that you had to use x.y in a referencing module. I don’t believe that it did an “import *”.

>> Improved type definition

I believe that you could do things like

type :  0..  (* where expr was actually a variable expression, useful with parameters and fields, especially arrays *)

>> Parametric types

We were able to define a record that was partly self defining. Examples:

type x = record y: integer z: array [0..y] of integer; end

a = record b: 0..4 case b of            0: (d, e, f:…); 1: (g, h, i: …);

These were intended to be used with pointers to records to describe variable operation system structures. I forget if we could specified the values in a new, so that the record was of the minimum lenghth.

>> Explicit packing and allocation control

I vaguely recall that you could add “packed ” to individual field definitions.

>> Exceptions

I forget how these worked.

I think it's worth having this in the record, but I'm reluctant to try to work it into the article only to have it ripped out by a more-established editor on the grounds that the references are inadequate or that the author was too closely associated with the project. MarkMLl (talk) 09:52, 1 January 2024 (UTC)