Sujet : Re: lisp-sound v0.2.1
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.lispDate : 17. Feb 2025, 02:01:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250216165611.690@kylheku.com>
References : 1 2 3 4 5
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-02-14, zara <
johan@freecol.be> wrote:
Hi,
>
Kaz Kylheku <643-408-1753@kylheku.com> writes:
>
On 2025-02-14, zara <johan@freecol.be> wrote:
>
Here's the example of the dictionary actor without CLOS :
>
Your approach has a giant bug, which is fixable.
>
;;
;; -- start of file --
;;
(defun make-dictionary ()
(let ((*dict ()))
>
(defun add (value)
(setq *dict (append *dict (list (length *dict) value))))
>
These defuns are defining and later redefining global function
bindings.
>
>
I know dynamic binding but using the actor there is little error.
Block scoping using the #'dispatch should almost always call
the defined add, get-with-index methods etc. not something
from environments above the lexical scope.
I can't make heads or tails of this paragraph, but it sounds as if you
might be trying to convince me that your little coding tidbit isn't
incorrect. Are /you/ even convinced?
Make a test case which makes two dictionaries:
(let ((dict1 (make-dictionary))
(dict2 (make-dictionary)))
...)
In the ... part, write some tests which show that an operation on
dict1 has no effect on a lookup in dict1.
(I mean if you call a message from dispatch, you better define
your called method locally).
That's the thing; you've not defined anything locally other
than the dict* variable.
defun is not a form which has a local effect.
I know, but it was just an example. AFAIK I am correct, and you have a
new Actor system for Common Lisp (e.g. bare bones systems).
In AFAIK, what exactly do you mean by K, know?
You are not correct, therefore if you "know" you are correct, there is
something wrong with how you determine when you know something
and when you don't.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca