DES Documentation and Instructions for use

Each function starts with define and ends with a new line (they are all like paragraphs). The only way to iterate is by using a recursive function. Kind of like in Racket.

DES basic Commands


Define

Define {name} with {arg} and [{arg} and ...]nothing else.

Defines a function. 'main' must always be defined for the program to work.

Remember

Remember {name} as {value}.

Defines a variable. Can be used for lists (kinda). You can use python syntax in the value.

Call

Call {function} with {arg} and [{arg} and ...]nothing else.

Calls a function. Works for built in python functions.

Run

Run {code} in python.

Runs python code. compiles to the same thing as Write.

If

If {condition} is true, do the following.

Executes the next line of code if the condition (python syntax) is true.

Stop

Stop and return {variable}.

Returns a variable.



HTML functions


Create

Create {tag} with contents: {contents}. 

Makes a tag in one line.

Open

Open {tag}.

Opens an HTML tag using an f string meaning you can add variables with squigges.

Close

Close {tag}.

Closes an HTML tag.

Write

Write {thing}.

Used to write content for the HTML tags, compiles to the same thing as the Run function (just useful to diferentiate their uses).

Useful Examples

Using periods in the program

Define main. Remember pd as chr(46). Remember msg as 'Mr'+pd+' DW'. Open h3. Write {msg}. Close h3.

You can't just use a period because that would cause the compiler to get confused. Instead, you can define a period as a variable and add it to other strings as a way to get around this rule.