[CM] srfi 212 - define-alias

Orm Finnendahl orm.finnendahl at selma.hfmdk-frankfurt.de
Fri Oct 2 05:46:24 PDT 2020


Hi Christos,

 without wanting to start a big discussion here I'd recommend to use this technique with caution: Changing the semantics or inner working of named functions on the fly is introducing state and can make programs quite challenging to debug and a fast way of getting rid of the advantages of functional programming ;-)

I can see the necessities of doing this e.g. in live-coding, but would advice to use it in very restricted and well defined situations of coding (like in live coding situations) and doubt that the mechanism you describe is reaĺly necessary in such situations.

--
Orm

Am 2. Oktober 2020 03:44:16 MESZ schrieb Christos Vagias <chris.actondev at gmail.com>:
>Hi all,
>
>i stumbled upon srfi 212 which speaks of aliases.
>" An alias definition transfers the binding of one identifier to
>another,
>effectively aliasing the identifier."
>https://srfi.schemers.org/srfi-212/srfi-212.html
>
>I think that would be a great help for the concept of
>libraries/namespaces.
>In the r7rs define-library concept, you can import a library and have
>access to its "exported" symbols.
>
>If these exported symbols are aliases, we could have hot-reloading
>redefinition of a library's symbols (redefining a function) and have
>this
>change reflected on the places where it's used.
>
>This is one feature from clojure I really missed in scheme.
>In my work on s7-imgui I do this but with the hack of making the
>"imported"
>function a macro that resolves the functions' symbol from the
>environment
>where it's defined.
>But, aliases would be a more subtle solution.
>
>-- excuse the long text, it's quite late yet something on my mind for
>quite a while
>
>Christos

----------------------------------------------------------------------
Prof. Orm Finnendahl
Komposition

Hochschule für Musik und Darstellende Kunst
Eschersheimer Landstr. 29-39
60322 Frankfurt am Main

https://www.youtube.com/watch?v=2rWha1HTfFE&list=PLiGfneJSWmNw6dTUvcTHbTkCYOOTiB_N6

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20201002/a57e9d6c/attachment.html>


More information about the Cmdist mailing list