Recherchez Oktopios dans l'onglet Extensions de VSCode.
Depuis le fichier .vsix
code --install-extension oktopios-0.0.1.vsix
Commandes disponibles
Commande
Raccourci
Description
Oktopios: Run File
F5
Exécute le fichier .okp courant
Oktopios: Open REPL
—
Ouvre le REPL interactif
Oktopios: Check Syntax
—
Vérifie la syntaxe du fichier
Snippets disponibles
Préfixe
Description
var
Variable typée
val
Constante
fun
Fonction
lambda
Fonction anonyme
class
Classe
classe
Classe avec héritage
if / ife
Condition
for / fore
Boucles
try
Try/catch/finally
inject
Module natif
matrix
Utilisation Matrix
Prérequis
Oktopios doit être installé :
pip install oktopios
Syntaxe Oktopios rapide
// Variables
var age: int = 25
val nom: string = "Oktopios"
// Fonction
fun saluer(prenom: string): string {
return f"Bonjour {prenom} !"
}
// Classe
class Animal {
var nom: string
fun __construct(n: string) { this.nom = n }
}
// Modules
inject Math
print(Math.sqrt(16)) // 4.0