Hello, Yes, my idea is to check the type of the parameters. I still have to add the types to my code, but I was trying to see if I could do it without them (just pattern matching), as the functions of type *f* are in the declaration of the contract.
Can you access this link? https://bitbucket.org/beatrizmoreira/msc/src/master/fwsollast.rkt Thank you for your answer :D A terça-feira, 29 de setembro de 2020 à(s) 17:20:58 UTC+1, [email protected] escreveu: > Hello Beatriz, > > Is this something like contracts with parameters? That sounds neat, > actually. > > Anyway, this seems more like syntax analysis rather than string matching, > but I'm not entirely certain as to what your approach is. I can't access > the file you linked. > > If this _is_ syntax analysis, then maybe a macro using `syntax-case` or > `syntax-parse` would serve you better? Again, I'm not exactly sure what > your approach is, and I'm sorry for that. > On Monday, September 28, 2020 at 3:31:11 PM UTC-4 gneuner2 wrote: > >> >> On 9/28/2020 10:50 AM, Beatriz Moreira wrote: >> >> Hello, >> I would like to know how do I match multiple variables to a regular >> expression. >> My idea is to match every *f* variables (f...) to an *f* in ((contract C >> ((T x) ...) ((T f)) ...) ... ). >> I am trying to implement a core language for smart contracts in Racket, >> but I need to have as pre condition in my reduction rules that the *f* is >> a function in one of the contracts. >> Thank you! :) >> >> >> 'regexp-match*' outputs a list of matched strings, and match has an apply >> clause: '(app *expr* pats ...)' which evaluates *expr* and tries to >> match the output. My first thought would be to try something like: >> >> match ( inp ) >> : >> ((app (regexp-match* pattern inp) match1 match2 ... ) >> ... ) >> : >> >> Caveat ... I've never tried to do this. If match doesn't like this >> approach (or something close to it), then I would separately perform the >> regexp-match* and the pattern match on its output list. >> >> Hope this helps, >> George >> >> https://docs.racket-lang.org/reference/regexp.html >> https://docs.racket-lang.org/reference/match.html >> > -- 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/76283498-990f-4c7c-b445-0d40f10108can%40googlegroups.com.

