Skip to content

Specification0 · How to read this specification

0.5

Syntax profiles: Spanish and English

PseudoLearn has two vocabularies with exactly the same rules: you can program in Spanish or in English and the result is the same.

Markdown version

0.5.1 How it works

A syntax profile is the language of the words of the language. In the Spanish profile you write Si … Entonces … FinSi; in the English one, If … Then … EndIf. The vocabulary changes and nothing else: precedence, types, index base and the order in which everything is evaluated are the same.

Figure 0.5-1.The same program in both profiles. Each word has its exact partner; names and texts do not change.

Two columns, Spanish on the left and English on the right. Each row pairs a word: Si with If, Entonces with Then, Cadena with String. The last two rows show that the name nombre and the text Hola do not change.

The engine can translate a program from one profile to the other. Translation changes only the words of the language; it keeps the names you invented, the quoted texts and the comments.

ProgramA program in the Spanish profile

Algorithm Saludo
  Define nombre As String <- "Ana";
  If length(nombre) > 2 Then
    Write "Hola, ", nombre;
  EndIf
EndAlgorithm

Output

Hola, Ana

The program finishes normally.

This specification can be read with either profile. Programs are written once and the engine translates them; that is why, in the English edition, quoted texts stay in Spanish.

0.5.2 The only visible difference

There is a single place where the profile changes what you see when running: writing a boolean value. In the Spanish profile Verdadero is written and in the English profile true. Everything else, numbers included, is written the same way.

In short

  • There are two official profiles: Spanish and English.
  • They have the same rules; only the words change.
  • The engine translates between them without touching names, texts or comments.
  • Boolean values are written with the profile's vocabulary.