> Sent from my tablet device
>
>
>
> -Original Message-
> From: Ben Duan
> To: users
> Sent: Mon, 25 Nov 2013 9:25 AM
> Subject: [racket] One accessor for the same fields of different structs?
>
> Hi All,
>
> If I have several structures, lik
ocs.racket-lang.org/reference/mzlib_class.html
--
William J. Bowman
Sent from my tablet device
-Original Message-
From: Ben Duan
To: users
Sent: Mon, 25 Nov 2013 9:25 AM
Subject: [racket] One accessor for the same fields of different structs?
Hi All,
If I have several structures
No need for a macro here, you simply need to define a common parent struct
`person', and derive `customer' and `student' from this struct:
(struct person (name age))
(struct customer person (foo))
(struct student person (bar))
(person-name (customer "Joe" 34 'foo)) ; -> "Joe"
The parent struct n
Hi All,
If I have several structures, like the following:
(struct customer (name age foo))
(struct student (name age bar))
I choose the same representation for the `name` and `age` fields which are
`string?` and `natural-number/c`. So I think I could just define a `name`
accessor for bot
4 matches
Mail list logo