> On Apr 24, 2016, at 7:21 PM, Matthew Butterick wrote:
>
> This probably has an obvious answer in the syntax library but the problem is
> new to me.
>
> The `definer-macro` below wants to bind identifiers that have been introduced
> at the caller site. Case 1 works as
>From the hip: Can your name-producing macro consume (val-producing-macro) and
>then just directly generate the case-2 macro call directly:
#lang racket
(require rackunit)
(define-syntax-rule (definer-macro ids vals)
(match-define ids vals))
(define-syntax-rule (val-producing-macro) (list 1
This probably has an obvious answer in the syntax library but the problem is
new to me.
The `definer-macro` below wants to bind identifiers that have been introduced
at the caller site. Case 1 works as expected.
But consider case 2, where another macro picks up identifiers from the calling
Yes, that’s what I meant. But beware! This is a quasi OO style. — Matthias
p.s. In plain Racket, structs serve as an opaque carrier of values.
> On Apr 24, 2016, at 1:56 PM, Benjamin Greenman
> wrote:
>
>
> On Sun, Apr 24, 2016 at 1:47 PM, Daniel Karch
On Sun, Apr 24, 2016 at 1:47 PM, Daniel Karch wrote:
> how this could be done with structures
One way is to consider the struct definition as an interface. Then
different values can implements the same interface & be used in a uniform
way.
Here's a struct that I used as
> On Apr 24, 2016, at 9:05 AM, Daniel Karch wrote:
>
> Hi,
>
> I recently started learning Racket and like it so far. Since I very much
> prefer statically typed languages, I am leaning towards Typed Racket.
>
> In a small program I am writing I would like to have a
Hi,
I recently started learning Racket and like it so far. Since I very much prefer
statically typed languages, I am leaning towards Typed Racket.
In a small program I am writing I would like to have a function that accepts a
value of an abstract type and then calls a function on that type
On Sunday, April 24, 2016 at 12:15:23 PM UTC+2, Ben Greenman wrote:
> I think you want hash-clear! because I think you're using a mutable hashtable.
>
>
> hash-clear! is for mutable hashtables (built with make-hash, added to with
> hash-add!) and returns void after it updates its argument
>
I think you want hash-clear! because I think you're using a mutable
hashtable.
hash-clear! is for mutable hashtables (built with make-hash, added to with
hash-add!) and returns void after it updates its argument
hash-clear is for immutable hashes (build with hash or for/hash, added to
with
hi,
what is the best way to clear a hash table, hash-clear or hash-clear! ? if the
hash-table is defined in a code at top-level and used in functions as a global
variable, the issue i have is that when at REPL i use a first time my function
(that use hash-table) it's ok but when i reuse the
10 matches
Mail list logo