3 pontos por xguru 2021-10-18 | Ainda não há comentários. | Compartilhar no WhatsApp
  • Biblioteca somente de cabeçalho

  • É possível implementar um REPL simples registrando funções como comandos

register_command(add, "add", "Add two numbers");

register_command(&Arithmetic::inc, "inc", "Increment a number");

→ adiciona as funções add e inc como comandos

[Tela de funcionamento]

help

add Add two numbers

inc Increment a number

help Show this help

add 3 4

7

inc 21

22

add 3 4 5

Error: expected 2 arguments; got 3

Ainda não há comentários.

Ainda não há comentários.