On 5/29/20, Beatriz Moreira <[email protected]> wrote: > > > Hi, im a beginner with racket and im using it to implement a language in > order to test its operational semantic rules. > > This is the function where i keep having the error: > > (define-metafunction FS > > call : env-ß classes address f ((x v)...) -> e > > [(call (env-ß_1 ... ((address_1 C_1 n_1 vars_1 ...) ... (address C n vars > ...) (address_2 C_2 n_2 vars_2 ...) ...) env-ß_2 ...) > > ((contract C_1 {x_11 ...} F_1) ... (contract C {x_1 ...} f (x ...) {return > e}) (contract C_2 {x_22 ...} F_2) ...) address f ((x v)...)) > > e]) > > > And this is the error message : > > ../../../../../../../Applications/Racket > v7.6/share/pkgs/redex-lib/redex/private/reduction-semantics.rkt:1588:55: > call: (call (((2 C 4 (x 3) (r 9)) (9 A 24 (a 9) (b 5)))) ((contract C (x r) > > (a (d y) (return (y + d)))) (contract A (a b) (c (a b) (return (3))))) 2 a > (d 7) (y 3)) is not in my domain > > I have tried changing the parenthesis but i can't seem to get it right. > Here's the code > <https://bitbucket.org/beatrizmoreira/contracts/src/master/newfs.rkt> .Thank > > you guys for your help! :)
The "not in my domain error" happens when a metafunction gets either the wrong number of arguments or the wrong shape for a certain arg. Once you have the right number of arguments, `redex-match?` can help check shapes. ``` (require rackunit) (check-true (redex-match? FS env-ß (term (((2 C 4 (x 3) (r 9)) (9 A 24 (a 9) (b 5))))))) ``` -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAFUu9R4yO5dRXxbPB5JcfotbNCQONPS2SskTq3YAhtX7erXQ0A%40mail.gmail.com.

