[WIP] add support to spawn new processes

This commit is contained in:
Bennet Bleßmann
2025-07-19 20:50:53 +02:00
parent f91aedcc2f
commit ae0baf4893
9 changed files with 326 additions and 15 deletions

View File

@@ -82,6 +82,9 @@ must_be_(octet_chars, Cs) :-
; true
).
must_be_(list, Term) :- check_(error:ilist, list, Term).
must_be_(list(Elem), Term) :-
must_be_(list, Term),
check_all(Elem, Term).
must_be_(type, Term) :- check_(error:type, type, Term).
must_be_(boolean, Term) :- check_(error:boolean, boolean, Term).
must_be_(pair, Term) :- check_(error:pair, pair, Term).
@@ -96,10 +99,12 @@ must_be_(term, Term) :-
% We cannot use maplist(must_be(character), Cs), because library(lists)
% uses library(error), so importing it would create a cyclic dependency.
all_characters([]).
all_characters([C|Cs]) :-
must_be(character, C),
all_characters(Cs).
check_all(_, []).
check_all(Type, [Head| Tail]) :-
must_be(Type, Head),
check_all(Type, Tail).
all_characters(Cs) :- check_all(character, Cs).
check_(Pred, Type, Term) :-
( var(Term) -> instantiation_error(must_be/2)
@@ -141,6 +146,7 @@ type(octet_character).
type(octet_chars).
type(chars).
type(list).
type(list(Type)) :- type(Type).
type(var).
type(boolean).
type(term).