Skip to content

Notable additions

Scover edited this page Dec 21, 2024 · 5 revisions

Notable additions

In order to make Pseudocode usable, a few features that are not present in the taught, "official" flavors of Pseudocode have been added.

These features should probably be avoided in tests.

This document provides an exhaustive list of these "notable additions".

Type conversions

Sometimes it is necessary to convert values from one type to another. This can be done with a C-like syntax for type casting, or through implicit conversions.

Directives

Directives (lines starting with #) are used for configuration, comptime introspection, and modularity.

Scalar initializers

Initialiers for primitive types (any type except structure or arrays) are supported.

This is for convenience only — separating initialization from declaration is recommended to preserve your grade.

No-op statements

Just a semi-colon ;. Does nothing.

Anonymous block

An anonymous block défines a new scope.

Line continuations

Any newline preceded by a backslash is preprocessed away. This can be used for multiline string literals:

écrireÉcran("this is a long\
string literal")

Output:

this is a longstring literal

But this syntax can be used anywhere, including in keywords and other literals.

Clone this wiki locally