Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/hpcgap/demo/   (GAP Algebra Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 481 B image not shown  

Quelle  actortest.g  Sprache: unbekannt

 
Spracherkennung für: .g vermutete Sprache: Lisp {Lisp[50] Masm[50] Shell[24]} [Methode: maximale Elemente, drei Dimensionen]

# Simple actor test

handlers := rec(
  _Init := function()
    Display(CurrentThread());
    Display("Hello, world!");
  end,

  _AtExit := function()
    Display(CurrentThread());
    Display("Goodbye, world!");
  end,

  print := function(x)
    Display(x);
  end,

  finish := function()
    ExitActor();
  end
);
actor := StartActor(handlers);
actor.print("a");
actor.print("b");
actor.print("c");
actor.print([1,2,3]);
actor.finish();
actor.print("should not be displayed");

[Dauer der Verarbeitung: 0.4 Sekunden, vorverarbeitet 2026-10-20]