Re: [racket-users] Pattern Matching

2020-09-28 Thread George Neuner


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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/22de3af2-b64f-73c0-fe12-a832dccf6086%40comcast.net.


[racket-users] Spritely website launches (plus, Goblins + networked programming)

2020-09-28 Thread Christopher Lemmer Webber
Hello all,

First of all, Spritely's website has finally launched:

  https://spritelyproject.org/

If you're wondering what on earth I've been doing, and where all my work
is going, this is a good explaination as any.  There's also a video you
can see on that page that I gave for a presentation for ActivityPub
Conference 2020:

  https://conf.tube/videos/watch/18aa2f92-36cc-4424-9a4f-6f2de946fbd2

Also, here's a fun easter egg:

  https://conf.tube/videos/watch/285e7580-8281-4ae4-842e-81c687237c69

But of course, the main thing of interest to most racketeers is Spritely
Goblins, the ocap'y actor model'y distributed transactional programming
library thingy I've been building in Racket.  The most recent release
(v0.7) has added the beginings of distributed programming support:

  https://docs.racket-lang.org/goblins/captp.html

However it isn't as easy to use as it could be.  More will be coming in
v0.8, which is when I can start recommending people start building
programs on top of it (and when I think we'll switch from alpha to
beta).

There is much more to say about Spritely Goblins, and I will be also
giving a talk at RacketCon about it, much more focused on the code side
than my APConf talk was.  (I'm still trying to restructure it based on
feedback!  Getting close!)  So more then.

 - Chris

-- 
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87k0wd4tr6.fsf%40dustycloud.org.


[racket-users] Pattern Matching

2020-09-28 Thread Beatriz Moreira
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! :) 


https://bitbucket.org/beatrizmoreira/msc/src/master/fwsollast.rkt

-- 
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/e4bc2e79-c375-4dad-8d49-2f308ad53c19n%40googlegroups.com.