Ohhh, thank you so much, Sorawee! Now I have wealth of code to study.
By the way, I tried to send my full code but apparently once again I hit
the "reply" button instead of "reply all" and I only sent it to David, so
here it is again in case anyone wants to play with it. I haven't
implemented
Thanks, I'll take a look into the code struct++! I'll probably get lost but
I'm sure I'll learn something.
Answering your questions:
A) What exactly are you trying to do, because I think I've got it but I'm
>>> still fuzzy.
>>>
>>
Structs that allow constructors like any other function, and
still fuzzy.
>> B) Why are you trying to do it?
>> C) Is there a simpler / more Racket-ish way to do it?
>>
>> On Thu, Sep 16, 2021 at 2:12 PM Dimaugh Silvestris <
>>> dimaughsilvest...@gmail.com> wrote:
>>>
>>>> Sorry, I haven't posted th
(sorry if I'm asking too many questions about macros lately, I'm learning
about them but I keep running into scenarios I can't find documentation for)
I'm trying to capture the value of a variable whose identifier I can only
get with format-id, inside a with-syntax.
Something like this pseudocode
Tired of writing:
#:methods gen:custom-write
[(define write-proc
(make-constructor-style-printer
(lambda (x) blablabla)
(lambda (x) blablabla)))]
I made this macro:
(define-syntax (print-as stx)
(syntax-case stx []
{[_ lam1 lam2]
#'[(define write-proc
I wanted a 'define' that stores in a hash the arguments and the function
definition so I don't keep forgetting argument order and having to go to
the file and check. So with my very little knowledge of macros, I wrote
this:
#lang racket
(define global (make-hash))
(define-syntax (assign stx)
silly me, I forgot to mention I installed Racket from Guix
On Sun, 16 May 2021 at 02:23, Dimaugh Silvestris <
dimaughsilvest...@gmail.com> wrote:
> I recently did a clean Ubuntu reinstall, but decided this time to try Guix
> as a package manager and install as much as possible from
I recently did a clean Ubuntu reinstall, but decided this time to try Guix
as a package manager and install as much as possible from there. Guix might
be the issue here, perhaps something else.
Now I can't run 'raco pkg install', and emacs gives me:
;--
; Can't suggest packages to
On Thu, 4 Mar 2021 at 19:29, Sam Tobin-Hochstadt
wrote:
> It doesn't print that way because that wouldn't turn back into the
> original value when evaluated, since it's quoted.
>
Is there any other way?
If not, I might consider the possibility of having a struct type for each
of those ugens,
I have a struct defined as:
(struct ugen sc.unit (name rate inputs)
#:methods gen:custom-write
[(define write-proc
(make-constructor-style-printer
[λ (x) (let [(rate (ugen-rate x))
(name (symbol-append (ugen-name x) ':))]
(cond [(eq? rate 'ar)
I was reading about Extempore, an enviroment for audio and video production
in Scheme. Well, almost: it uses something similar to SuperCollider's
client-server architechture, with a Scheme interpreter on the client side
and a server in a typed Scheme with manual memory management, Xtlang.
I'm trying different ways to define a struct that has the same fields as
its superstruct without adding any new field, but all I get is errors
saying struct expects a list of fields.
Something like:
(struct edible (name grams) #:transparent)
and then
(struct fruit #:super edible #:transparent)
I would like to build an additive synth on Racket, but I can't decide myself
wether I should use SuperCollider, Rsound or Fluxus.
SuperCollider I've used already with Sclang and Haskell, and I admire
it's efficiency, but it has some quirks I dislike (like the order of
execution of UGENs). I tried
Just in case somebody has a similar issue and finds this:
In the end I used keyword-apply/sort , which doesn't requiere keywords to
follow the same order they do in the function definition.
On Thursday, 26 November 2020 at 10:42:40 UTC+1 Dimaugh Silvestris wrote:
> Thanks! Your answer led
(for/hash ([chunk (in-slice 2 args)])
> (values (first chunk) (second chunk
>
> (keyword-apply/dict proc args* '())
>
>
> On Thu, Nov 26, 2020 at 12:53 AM Dimaugh Silvestris
> wrote:
>
>> Is it possible to reproduce this behavior
>> ((lambda (#:colo
Is it possible to reproduce this behavior
((lambda (#:color color #:size size) (display (cons color size))) #:color
"red" #:size 3)
when what I have is a list such as '(#:color "red" #:size 3) ?
How can I feed keyword arguments stored in a list as symbols in a way that
doesn't involve parsing
Sun, Nov 22, 2020 at 7:45 PM Dimaugh Silvestris
> wrote:
>
>> So I tried adding a custom keybinding using c:c, and now when I open
>> DrRacket, I get the error:
>> <> /home/dimaugh/prog/rkt/keybindings.rkt:
>> map-function in keymap%: "c:c" is alrea
rRacket, I get the error:
<>
But after clicking the OK button I can use DrRacket, and Control+c works as
it should.
The error message bothers me a bit, but other than that it's now solved.
On Sunday, 22 November 2020 at 16:49:38 UTC+1 Dimaugh Silvestris wrote:
>
> For some reason, C
For some reason, Control+c isn't working in DrRacket, while Control+x for
cut and Control+v work as expected. I think I've had this since I installed
DrRacket, and I haven't changed anything about keybindings that I remember;
I've been using the right-click menu instead, but it's cumbersome
19 matches
Mail list logo