On 24-07-2022 03:21, Zelphir Kaltstahl wrote:
(define-syntax require
(identifier-syntax
(syntax-error "'require' can only be used as part of a contract
construct")))
Can you explain how it works?
If you meant: how can identifier-syntax + syntax-error be used? -- I
don't
Hello Maxime!
I needed some time to implement the things you explained/mentioned, but I think
I've got it now:
https://notabug.org/ZelphirKaltstahl/guile-examples/src/87304cc573086b5ef60c1d3aad25d4431fd5bca8/macros/contract.scm
There is still one issue though: The placeholder of the ensure
On 20-07-2022 10:39, Zelphir Kaltstahl wrote:
It would also be nice to define a global 'require' and 'ensure' and
'' somewhere (e.g.: (define-syntax require (identifier-syntax
(syntax-error "'require' can only be used as part of a contract
construct", that way, require / ensure / can be
Hello Maxime!
On 7/19/22 17:20, Maxime Devos wrote:
Zelphir Kaltstahl schreef op do 14-07-2022 om 23:55 [+]:
(make-assertion-failure)
(make-exception-with-message "assertion failed")
(make-exception-with-irritants (quote (op args* ...)]
Instead of a
Zelphir Kaltstahl schreef op do 14-07-2022 om 23:55 [+]:
> (make-assertion-failure)
> (make-exception-with-message "assertion failed")
> (make-exception-with-irritants (quote (op args* ...)]
Instead of a generic 'assertion failure', I believe a more specific
Hello Guile users!
I've tried myself again at writing some macros. Some post about programming
language features inspired me to try and write a macro, which adds contracts (or
my naive idea of what they are) to function definitions.
The code is at: