-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion] ideas for improving REPRESENT macro #3
Comments
I don't understand what I also don't understand what The You also can already simply write |
I see that my ideas are still flawed and a bit muffled.
would be changed to:
Each of the data passed into
Ahh, I see now, that would be some very handy feature! Hmm, in this case, giving T case a more intuiative name will be my suggestion at last. |
I'm afraid I still don't understand the purpose of your proposed changes. So instead, let me try and explain what the idea is behind the component and data protocols again, maybe that'll clear up some of the confusion I feel is floating around here. In most other UI frameworks there is a disconnect between the data the system operates on and the data that the UI shows. For instance, a text input field will have its own text slot that contains the text to display. It is then up to the programmer to shuffle the data into the text slot and back out when changes occur in the system, or are made by the user. This divide is necessary, as the languages these systems are written in, including Lisp, do not allow observation of changes made to standard data structures. In order to make this observation possible the system would have to poll, which may be prohibitively expensive. However, what can be done is to attempt and minimise this divide and define a standard protocol for managing it. At the lowest level this is what the observables protocol is for. It defines a way to signal changes being made to an object, and a way to register functions to be called whet a certain change is made to a specific object. The So finally we come to The aforementioned divide however means that we cannot always have a smooth integration with the UI if the system itself changes the data, rather than the UI. This is where most of my displeasure comes from. I'm not sure if this means that my attempt at removing the divide between the UI and the backing data is wrong to begin with quite yet. However, I'm sure there's no way to completely remove it, so there will always be some amount of disconnect. The case of the I hope that clears some stuff up. |
Thanks for the explanation.
I am still not clear with the following:
by system do you mean having I agree with this:
That is why I thought it will be helpful have the
|
I mean if you have something like
There's no way for the slider to know that |
Okay, I dont think this is a flaw of the design of Alloy, or anything along that line. Like you said
Therefore, in order to make this the observation on said The users need to use |
Well yes, it's unavoidable, but the question remains whether it's worth it to try and bridge the gap at all, or whether that will just confuse users needlessly and create annoying designs, since only some things will be immediately observable and others need to be handled specially, rather than just forcing the users to make the data interaction explicit like other frameworks do. |
I think the REPRESENT macro currently serves as the only and unified component initialization method, could use some work:
1. isolate data creation, perhaps move that to the user's side
introduce new functions:
#'alloy:add-observable-callback
for adding observable callbacks,#'alloy:set-data
' for data setting, and corresponding new functions for each of type of data.In each of the function we can reinforce validation accordingly, because
#'expand-place-data
and#'expand-compound-place-data
already serve this purpose and exposed to the user, this would be just renaming some of the methods.2. Considering remove the T case in 'represent-with'.
So that
(alloy:represent "Hey!" T)
becomes(alloy:represent "Hey!" 'alloy:label)
, this is would be much more consistent with the rest of the components.Doing this for symbol, nil & T, and maybe
#'component-class-for-object
can be removed?The text was updated successfully, but these errors were encountered: