@@ -66,7 +66,7 @@ let preprocess e = e |> List.map ~f:expand_macro |> unfold_decl_def []
6666The preprocessing phase consists of two steps:
6767
68681 .  ** Syntactic expansion**  (` expand_macro ` ): Desugars syntax like ` [1|Tail] ` , ` <f a b> ` , ` "string" `  into core forms
69- 2 .  ** Macro expansion**  (` unfold_decl_def ` ): Processes ` new-declaration `  forms and expands macro calls
69+ 2 .  ** Macro expansion**  (` unfold_decl_def ` ): Processes ` macro `  forms and expands macro calls
7070
7171### How Macros Work  
7272
@@ -78,7 +78,7 @@ The `unfold_decl_def` function:
7878let unfold_decl_def (macro_env : (string * (string list * expr list)) list) exprs = 
7979  let rec process_expr (env, acc) = function 
8080    (* Macro definition *) 
81-     | List (Symbol "new-declaration " :: List (Symbol macro_name :: args) :: body) -> 
81+     | List (Symbol "macro " :: List (Symbol macro_name :: args) :: body) -> 
8282      let var_args = List.map args ~f:(function | Var x -> x | _ -> failwith ...) in 
8383      ((macro_name, (var_args, body)) :: env, acc) 
8484
@@ -791,8 +791,8 @@ let resolve_module module_name current_file =
791791The same macro definitions appear at the beginning of ** 12+ example files** :
792792
793793``` stellogen 
794- (new-declaration  (spec X Y) (:= X Y)) 
795- (new-declaration  (:: Tested Test) 
794+ (macro  (spec X Y) (:= X Y)) 
795+ (macro  (:: Tested Test) 
796796  (== @(interact @#Tested #Test) ok)) 
797797``` 
798798
@@ -847,8 +847,8 @@ Suppose we want to create `lib/prelude.sg`:
847847
848848``` stellogen 
849849' lib/prelude.sg - Common macros 
850- (new-declaration  (spec X Y) (:= X Y)) 
851- (new-declaration  (:: Tested Test) 
850+ (macro  (spec X Y) (:= X Y)) 
851+ (macro  (:: Tested Test) 
852852  (== @(interact @#Tested #Test) ok)) 
853853``` 
854854
@@ -1054,8 +1054,8 @@ The current architecture has a clean separation between:
10541054
10551055``` stellogen 
10561056' lib/prelude.sg 
1057- (new-declaration  (spec X Y) (:= X Y)) 
1058- (new-declaration  (:: Tested Test) 
1057+ (macro  (spec X Y) (:= X Y)) 
1058+ (macro  (:: Tested Test) 
10591059  (== @(interact @#Tested #Test) ok)) 
10601060
10611061' my_program.sg 
@@ -1111,8 +1111,8 @@ The current architecture has a clean separation between:
11111111
11121112``` stellogen 
11131113' lib/prelude.sg 
1114- (new-declaration  (spec X Y) (:= X Y)) 
1115- (new-declaration  (:: Tested Test) 
1114+ (macro  (spec X Y) (:= X Y)) 
1115+ (macro  (:: Tested Test) 
11161116  (== @(interact @#Tested #Test) ok)) 
11171117
11181118' my_program.sg 
@@ -1169,8 +1169,8 @@ sgen config set prelude lib/prelude.sg
11691169
11701170``` bash 
11711171#  Create prelude
1172- echo  ' (new-declaration  (spec X Y) (:= X Y))' >  prelude.sg
1173- echo  ' (new-declaration  (:: Tested Test) (== @(interact @#Tested #Test) ok))' >>  prelude.sg
1172+ echo  ' (macro  (spec X Y) (:= X Y))' >  prelude.sg
1173+ echo  ' (macro  (:: Tested Test) (== @(interact @#Tested #Test) ok))' >>  prelude.sg
11741174
11751175#  Use it
11761176sgen run --prelude prelude.sg my_program.sg
@@ -1351,10 +1351,10 @@ sgen config set prelude lib/milkyway.sg
13511351' lib/milkyway.sg - Stellogen Standard Library 
13521352
13531353''' Type system macros ''' 
1354- (new-declaration  (spec X Y) (:= X Y)) 
1355- (new-declaration  (:: Tested Test) 
1354+ (macro  (spec X Y) (:= X Y)) 
1355+ (macro  (:: Tested Test) 
13561356  (== @(interact @#Tested #Test) ok)) 
1357- (new-declaration  (::lin Tested Test) 
1357+ (macro  (::lin Tested Test) 
13581358  (== @(fire @#Tested #Test) ok)) 
13591359
13601360''' Common type definitions ''' 
@@ -1363,15 +1363,15 @@ sgen config set prelude lib/milkyway.sg
13631363(spec list {...}) 
13641364
13651365''' Utility macros ''' 
1366- (new-declaration  (alias X Y) (:= X Y)) 
1367- (new-declaration  (type X Y) (spec X Y)) 
1366+ (macro  (alias X Y) (:= X Y)) 
1367+ (macro  (type X Y) (spec X Y)) 
13681368
13691369''' Testing macros ''' 
1370- (new-declaration  (test Name Body) 
1370+ (macro  (test Name Body) 
13711371  (== Body ok Name)) 
13721372
13731373''' Documentation helpers ''' 
1374- (new-declaration  (doc _ Body) Body) 
1374+ (macro  (doc _ Body) Body) 
13751375``` 
13761376
13771377** Organization:** 
0 commit comments