On 10/6/2020 10:41 AM, Beatriz Moreira wrote:
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 contra
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
Hello,
I don't think this is what im looking for, but thank you very much :D
A segunda-feira, 28 de setembro de 2020 à(s) 20:31:11 UTC+1, gneuner2
escreveu:
>
> 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
> exp
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, th
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 contr
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 condit
Oh, neat. Thank you, Sorawee.
On Thu, Jun 27, 2019 at 7:26 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:
> If you want only one match, it seems what you really want is ~seq-like
> form from syntax/parse. E.g.,
>
> #lang racket
>
> (require syntax/parse)
>
> (define ->value syntax-
If you want only one match, it seems what you really want is ~seq-like form
from syntax/parse. E.g.,
#lang racket
(require syntax/parse)
(define ->value syntax->datum)
(define (apply-lift op args)
(datum->syntax #f (apply op (->value args
(syntax-parse (vector 1 2 3 4)
[#(a {~and {~seq
On Thu, Jun 27, 2019 at 5:13 PM Eric Griffis wrote:
> On Thu, Jun 27, 2019 at 11:56 AM David Storrs
> wrote:
> >
> > Suppose instead I wanted to have a pattern like so (this does not work):
> >
> > (match (vector 1 2 3 4)
> > [(vector a (app + b ..2 x) c) (list a b c x)]
> > ; => '(1 (2 3) 4 5
On Thu, Jun 27, 2019 at 11:56 AM David Storrs
wrote:
>
> Suppose instead I wanted to have a pattern like so (this does not work):
>
> (match (vector 1 2 3 4)
> [(vector a (app + b ..2 x) c) (list a b c x)]
> ; => '(1 (2 3) 4 5)) ; NB: does not work
We have a few problems here.
The pattern (
This works:
(match (vector 1 2 3 4)
[(vector a b (app add1 c) d)
(list a b c d)])
; => '(1 2 4 4)
Suppose instead I wanted to have a pattern like so (this does not work):
(match (vector 1 2 3 4)
[(vector a (app + b ..2 x) c) (list a b c x)]
; => '(1 (2 3) 4 5)) ; NB: does not work
Is th
Yes, lambda expression have an implicit begin in the body.
> (begin . (1 2 3))
3
> (begin (1 2 3))
application: not a procedure;
expected a procedure that can be applied to arguments
given: 1
arguments...:
Here (begin . (1 2 3)) is the same as (begin 1 2 3).
The doc
Does that mean that lambda expressions have an implicit (begin …) block in them?
(begin ((displayln 1) (displayln 2) (displayln 3))) leads to an error
(begin . ((displayln 1) (displayln 2) (displayln 3))) displays to 1 2 3
Thank you for the detailed explanation I think I get it now.
> On 13 Mar
>Imagine (_ (foo x y z) (displayln x) (displayln y) (displayln z)) as the
>actual syntax. The .body will be bound to the sequence of three diaplaylns and
>this sequence will become the body of the lambda in the expansion.
So in this case body will be bound to the list ((displayln x) (displayln y
The cons cell constructed by (cons 1 2)
is normally printed as (1 . 2).
The list created by (list 1 2 3) could also be created
as (cons 1 (cons 2 (cons 3 '(. It could be printed as
(1 . (2 . (3 . (.
Normally lists are simply printed as (1 2 3) though.
Notice that (1 . (list 2 3)) is the s
de marzo de 2016 16:05
To: Racket Users
Subject: [racket-users] Pattern Matching in Macros | Meaning of dot
Hello everyone,
Since I've discovered the concept of metaprogramming I've been quite
interested in Racket and its syntax extension capabilities.
While searching for a memoizat
> On Mar 13, 2016, at 11:05 AM, Pedro Caldeira
> wrote:
>
> Hello everyone,
>
> Since I've discovered the concept of metaprogramming I've been quite
> interested in Racket and its syntax extension capabilities.
>
> While searching for a memoization syntax extension I found a macro whose
> p
Hello everyone,
Since I've discovered the concept of metaprogramming I've been quite interested
in Racket and its syntax extension capabilities.
While searching for a memoization syntax extension I found a macro whose
pattern extension remained unclear.
(define-syntax define/memoized
(syntax
18 matches
Mail list logo