You can also set! the extra constructor
#lang racket
(struct foo [a b c]
#:extra-constructor-name -foo
#:transparent)
(define ((foo* make-foo) a b)
(make-foo a b (+ a b)))
(set! -foo (foo* -foo))
(foo 1 2) ; -> (foo 1 2 3)
(match (foo 1 2)
[(foo _ _ c) c]) ; -> 3
However I usually
On Fri, Mar 9, 2018 at 9:35 PM, Kevin Forchione wrote:
> Is it possible to initialize a struct field based on values from
> previously defined fields? Something equivalent to let* where
>
> >(struct foo (A B C))
> >(foo 1 2) would produce (foo 1 2 3) for
Is it possible to initialize a struct field based on values from previously
defined fields? Something equivalent to let* where
>(struct foo (A B C))
>(foo 1 2) would produce (foo 1 2 3) for example?
Thanks!
Kevin
--
You received this message because you are subscribed to the
It's fixed now. Cron job didn't run for some reason. Thanks for the heads up!
On Fri, Mar 9, 2018 at 12:42 PM, 'John Clements' via Racket Users
wrote:
>
>
>> On Mar 9, 2018, at 8:25 AM, Tim Hanson wrote:
>>
>> Hi, I tried to grab the latest
> On Mar 9, 2018, at 8:25 AM, Tim Hanson wrote:
>
> Hi, I tried to grab the latest racket version from download.racket-lang.org
> and chrome and edge tell me the certificate of the site at
> mirror.racket-lang.org is not yet valid or expired. It's no problem as I
> found a
It depends on the hardware, and what you want to do with it. For a lot
of hardware on GNU/Linux and other Unix-ish systems, you can do some
things just by doing normal Racket I/O to a device file under the
directory "/dev/". On Linux, there are also some useful device-related
interface files
Hi, I tried to grab the latest racket version from download.racket-lang.org and
chrome and edge tell me the certificate of the site at mirror.racket-lang.org
is not yet valid or expired. It's no problem as I found a mirror with a valid
certificate, but I guess you'll want to renew the
Can anyone point me to documentation / library functions to access hardware
through Racket? For instance, I would like to access the CD-ROM drive to
be able to calculate a SHA-256 of the entire contents of the disc in a CD
drive.
Has anyone considered writing a tutorial on hardware I/O with
8 matches
Mail list logo