new version of grace

This commit is contained in:
asus
2024-01-25 14:12:49 +01:00
parent 1dea608c0d
commit 2e0b5dd8d9
3 changed files with 13 additions and 20 deletions

View File

@@ -1,6 +1,8 @@
# DR QUINE
#### constructing a quine with macro :
## 2. GRACE
#### 2.1 constructing a quine with macro :
---
**a quine could be this structure basically :**
@@ -27,7 +29,7 @@ MAIN()
```
#### let's try it
#### 2.2 let's try it
---
```
@@ -53,7 +55,7 @@ int main()
**problem :** the `char *quine` string should contain a copy of the whole code in place of "s"
#### second try, macro calling itself : MAIN(MAIN)
#### 2.3 second try, macro calling itself : MAIN(MAIN)
---
```
@@ -80,7 +82,7 @@ int main()
#### lets stringify the content of the inner MAIN
#### 2.4 lets stringify the content of the inner MAIN
---
**the previous can be written with an extra step :**
@@ -118,10 +120,10 @@ int main()
}
```
**problem :** oops, it stringified the paramter name, not it's expanded version, see https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html
**problem :** oops, it stringified the parameter name, not it's expanded version, see https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html
#### working stringification
#### 2.5 working stringification
---
```