Skip to content

Commit 12f17f9

Browse files
committed
Fix conflict
2 parents 9457e37 + a9cfd87 commit 12f17f9

22 files changed

+116
-116
lines changed

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Unlike traditional typed languages where types constrain and shape program desig
5656

5757
### Declarations
5858
- **Definition**: `(:= name value)`
59-
- **Macro**: `(new-declaration (pattern) (expansion))`
59+
- **Macro**: `(macro (pattern) (expansion))`
6060
- **Show**: `(show expr)` - display result
6161
- **Expect**: Assertion/testing mechanism
6262

@@ -171,10 +171,10 @@ dune exec sgen run -- <inputfile>
171171

172172
```stellogen
173173
' Macro for type specification
174-
(new-declaration (spec X Y) (:= X Y))
174+
(macro (spec X Y) (:= X Y))
175175
176176
' Macro for type assertion
177-
(new-declaration (:: Tested Test)
177+
(macro (:: Tested Test)
178178
(== @(interact @#Tested #Test) ok))
179179
180180
' Define nat type as interactive tests

docs/basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Some special operators are written as prefix of the expression:
109109
It is possible to declare aliases for expressions:
110110

111111
```stellogen
112-
(new-declaration (spec X Y) (:= X Y))
112+
(macro (spec X Y) (:= X Y))
113113
```
114114

115115
after this declaration, `(spec X Y)` stands for `(:= X Y)`.
@@ -370,7 +370,7 @@ In Stellogen, **types are sets of tests** that a constellation must pass to be o
370370
For example, we define a type for natural numbers:
371371

372372
```stellogen
373-
(new-declaration (spec X Y) (:= X Y))
373+
(macro (spec X Y) (:= X Y))
374374
(spec nat {
375375
[(-nat 0) ok] ' test 1
376376
[(-nat (s N)) (+nat N)]}) ' test 2
@@ -381,7 +381,7 @@ A constellation must pass **all tests** to be considered of type `nat`.
381381
We then define the behavior of type assertions with a macro:
382382

383383
```stellogen
384-
(new-declaration (:: Tested Test)
384+
(macro (:: Tested Test)
385385
(== @(interact @#Tested #Test) ok))
386386
```
387387

docs/cut_and_control_flow.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ Or with syntactic sugar:
709709
**Syntax:**
710710

711711
```stellogen
712-
(new-declaration (not Test)
712+
(macro (not Test)
713713
(interact @#Test #failure-check))
714714
715715
(:= failure-check {
@@ -802,7 +802,7 @@ Or with syntactic sugar:
802802
**Example - First-match macro:**
803803

804804
```stellogen
805-
(new-declaration (first-match Name Cases)
805+
(macro (first-match Name Cases)
806806
(:= Name {
807807
(expand-cases-with-flags Cases)}))
808808
@@ -936,14 +936,14 @@ Or more directly, introduce `|` separator for alternatives:
936936
' lib/control.sg
937937
938938
''' Deterministic if-then-else '''
939-
(new-declaration (if Cond Then Else)
939+
(macro (if Cond Then Else)
940940
(interact
941941
{ [(+cond) @#Then]
942942
[(-cond) @#Else] }
943943
@#Cond))
944944
945945
''' First match from multiple options '''
946-
(new-declaration (first-of Options)
946+
(macro (first-of Options)
947947
(:= temp {
948948
[(+available)]
949949
@(expand-with-guards #Options)

docs/import_mechanisms.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let preprocess e = e |> List.map ~f:expand_macro |> unfold_decl_def []
6666
The preprocessing phase consists of two steps:
6767

6868
1. **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:
7878
let 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 =
791791
The 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
11761176
sgen 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:**

docs/language_comparisons.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ Both support powerful macro systems for syntactic extension.
279279

280280
**Stellogen:**
281281
```stellogen
282-
(new-declaration (spec X Y) (:= X Y))
283-
(new-declaration (:: Tested Test)
282+
(macro (spec X Y) (:= X Y))
283+
(macro (:: Tested Test)
284284
(== @(interact @#Tested #Test) ok))
285285
286286
(spec nat { ... })
@@ -400,7 +400,7 @@ No automatic evaluation—you control when terms are evaluated.
400400
| Foundation | Lambda calculus | Term unification + polarity |
401401
| Syntax | S-expressions | S-expressions |
402402
| Evaluation | Eager (strict) | Explicit (via `@`) |
403-
| Metaprogramming | Macros (syntax-rules, defmacro) | Macros (new-declaration) |
403+
| Metaprogramming | Macros (syntax-rules, defmacro) | Macros (macro) |
404404
| Unification | No | Yes (central) |
405405
| Types | Dynamic | User-defined interactive tests |
406406
| Paradigm | Functional (primarily) | Multi-paradigm (logic-agnostic) |
@@ -1097,7 +1097,7 @@ Stellogen supports **linear evaluation** via `fire`.
10971097

10981098
**Stellogen (`examples/mll.sg`, `examples/smll.sg`):**
10991099
```stellogen
1100-
(new-declaration (::lin Tested Test)
1100+
(macro (::lin Tested Test)
11011101
(== @(fire #Tested #Test) ok))
11021102
11031103
' fire uses resources exactly once (linear)
@@ -1507,8 +1507,8 @@ Stellogen supports **all paradigms** without committing to any:
15071507
Macros are not an add-on—they're **fundamental** to how Stellogen is extended.
15081508

15091509
```stellogen
1510-
(new-declaration (spec X Y) (:= X Y))
1511-
(new-declaration (:: Tested Test) ...)
1510+
(macro (spec X Y) (:= X Y))
1511+
(macro (:: Tested Test) ...)
15121512
```
15131513

15141514
Users define new declaration forms, not just syntactic sugar.

0 commit comments

Comments
 (0)