[CM] Another Scheme API question

Iain Duncan iainduncanlists at gmail.com
Sun May 17 13:28:58 PDT 2020


I have another question for make my API seem scheme-ish. I'm going to bring
my side-effects functions that write to data structures to be in alignment
with vector-set! etc so that they return the value that was just used to
set a slot. But I'm less sure what should happen for side effect functions
that just do something with a value. Specifically, I have functions that
send values out the Max object outlets, ie:

(out 0 :foobar)  ;; sends :foobar out outlet 0

At the moment, I have the out function return s7_nil, which I did because I
didn't know what it should do and thought this was roughly equivalent to
returning void. I could just as easily have it return the value that was
just sent out, which could conceivably be useful for making chains with a
threading macro (where -> passes on the value as first arg of the next
function)

out 0 foobar -> some-other-function

If anyone can comment on what is standard in Scheme land for a pure side
effect function that is not a setter, I'm all ears.

thanks
iain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20200517/69b353bb/attachment-0001.html>


More information about the Cmdist mailing list