Skip to content

Commit 5a3803d

Browse files
committed
master is fine again
1 parent 73e90b7 commit 5a3803d

19 files changed

+706
-1300
lines changed

hyperon-wam.vpj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,6 @@
308308
N="*.*"
309309
Recurse="1"
310310
Excludes=".git/;*.metta.html;*.bak;build/;.*/;*~*/"/>
311-
<F N="mymod.py"/>
312-
<F N="rust_rand.py"/>
313-
<F N="setup.py"/>
314311
<F N="vvv_tests.pl"/>
315312
</Files>
316313
</Project>

libraries/builtin_mods/builtins-fileio.metta

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,26 @@
55
; the system level get-type is nondetermninistic therefore returns all willing participants
66
(= (get-type $obj)
77
(call-for! FileHandle ; call for returns the first argument
8-
(@ (atomic $obj) ; stream might return an error if obj is not atomic
9-
(stream $obj)))) ; if obj is a stream we are calling it a filehandle since prolog streams already support this api
8+
(atomic $obj) ; stream might return an error if obj is not atomic
9+
(stream $obj))) ; if obj is a stream we are calling it a filehandle since prolog streams already support this api
1010

1111
(= (parse-mode $chars)
1212
(call-for! $mode
13-
(@
1413
(or
1514
(and (memberchk r $chars) (memberchk w $chars) (= $mode update))
1615
(and (memberchk a $chars) (= $mode append))
1716
(and (memberchk w $chars) (= $mode write))
1817
(and (memberchk r $chars) (= $mode read))
19-
(= $mode read)))))
18+
(= $mode read))))
2019

2120
(= (handle-create-options $path $chars)
22-
(call-unit!
23-
(@ (if-then (and (memberchk n $chars) (exists_file $path))
21+
(call-unit
22+
(if-then (and (memberchk n $chars) (exists_file $path))
2423
(throw (error (file_exists_error $path))))
2524
(if-then (and (memberchk c $chars) (not (exists_file $path)))
2625
(setup_call_cleanup (open $path write $s) (close $s) true))
2726
(if-then (and (memberchk t $chars) (exists_file $path))
28-
(setup_call_cleanup (open $path write $s) (close $s) true)))))
27+
(setup_call_cleanup (open $path write $s) (close $s) true))))
2928

3029
(@doc file-open!
3130
(@desc "Function takes path to the file and open options (r, w, c, a, t) both in form of string, creates filehandle and
@@ -40,12 +39,12 @@
4039
; tells the compiler to return only the first successful clause
4140
(iz file-open! Deterministic)
4241
(= (file-open! $fpath $opt)
43-
(call-for! $stream (@
42+
(call-for! $stream
4443
(string_chars $opt $chars)
4544
(any_to_atom $fpath $path)
4645
(= $mode (parse-mode $chars))
4746
(handle-create-options $path $chars)
48-
(open $path $mode $stream [ (type text) ]))))
47+
(open $path $mode $stream [ (type text) ])))
4948
(= (file-open-err! $path $opt)
5049
(call-for! $_err
5150
(format (string $msg)
@@ -61,7 +60,7 @@
6160
(@return "File's content"))
6261
(: file-read-to-string! (-> FileHandle String))
6362
(= (file-read-to-string! $stream)
64-
(call-fn! read_string $stream $_ ))
63+
(call-fn read_string $stream $_ ))
6564

6665
(@doc file-write!
6766
(@desc "Function takes filehandle provided by file-open!, content to be written (string atom) and puts content into
@@ -72,9 +71,9 @@
7271
(@return "Unit atom"))
7372
(: file-write! (-> FileHandle String Unit))
7473
(= (file-write! $stream $content)
75-
(call-unit! (,
74+
(call-unit
7675
(write $stream $content)
77-
(flush_output $stream))))
76+
(flush_output $stream)))
7877

7978
(@doc file-seek!
8079
(@desc "Function takes filehandle provided by file-open! and desired cursor position (number) and sets cursor to
@@ -85,8 +84,8 @@
8584
(@return "Unit atom"))
8685
(: file-seek! (-> FileHandle Number Unit))
8786
(= (file-seek! $stream $offset)
88-
(call-unit!
89-
(@ (seek $stream $offset bof $_))))
87+
(call-unit
88+
(seek $stream $offset bof $_)))
9089

9190
(@doc file-read-exact!
9291
(@desc "Function takes filehandle provided by file-open! and desired number of bytes to read (number), reads content
@@ -119,11 +118,11 @@
119118
(@return "Unit atom"))
120119
(: file-close! (-> FileHandle Unit))
121120
(= (file-close! $stream)
122-
(call-unit!
121+
(call-unit
123122
(close $stream)))
124123

125124
; Load system libs (not required .. but more here for reference)
126-
;!(call-unit!
125+
;!(call-unit
127126
; (use_module (library apply))
128127
; (use_module (library filesex)))
129128

libraries/builtin_mods/builtins-thread.metta

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
(@return "Token (Token)"))
8888
(: thread:async-token! (-> Atom Variable Token))
8989
(= (thread:async-token! $eval $result)
90-
(call-fn! async_eval_token $eval $result))
90+
(call-fn async_eval_token $eval $result))
9191

9292
(@doc thread:async-policy!
9393
(@desc "Starts an asynchronous operation with a policy and token as result.")
@@ -97,7 +97,7 @@
9797
(@return "Token (Token)"))
9898
(: thread:async-policy! (-> Atom Atom Token))
9999
(= (thread:async-policy! $eval $policy $token)
100-
(call-for! $token
100+
(call-for $token
101101
(async_thread_with_policy $eval $token $policy)))
102102

103103
(@doc thread:await-token!
@@ -464,9 +464,7 @@
464464
(@param "Goal: Expression to evaluate")
465465
(@param "Options: Expression of (key value) pairs")))
466466
(@return "Engine handle"))
467-
(: engine:create (-> Atom EngineHandle))
468-
(= (engine:create $eval) (engine:create $eval ()))
469-
(: engine:create (-> Atom Expression EngineHandle))
467+
(: engine:create (-> %Undefined% Atom Expression EngineHandle))
470468
(= (engine:create $eval $options)
471469
(call-for! $handle (@ engine_create $template (@ eval_args $eval $template) $handle $options)))
472470

@@ -552,7 +550,7 @@
552550
(= (engine-quick-tests)
553551
(let
554552
$E (engine:create (superpose (1 2 3)))
555-
(progn
553+
(do
556554
(println! ("Result 1: " (engine:next $E)))
557555
(println! ("Result 2: " (engine:next $E)))
558556
(println! ("Result 3: " (engine:next $E)))

0 commit comments

Comments
 (0)