magritte-metamodel / magritte

The Magritte Meta-Model
65 stars 34 forks source link

[GT Search]: Transform should Accept Receiver Argument #317

Closed snrnyc closed 1 year ago

snrnyc commented 1 year ago

It would be nice because it would decouple the receiver from the description, which is a best practice because theoretically descriptions can be applied to any model object, so self can't be cached e.g. in a block. Then MATokenSelectorElement's initialize could #cull:cull:.

However, this causes an error if using mementos because there doesn't seem to be a way to pass the message through to the model object

seandenigris commented 1 year ago

Tried to have:

gtSearchTransform: aValuable
    "aValuable - two optional parameters:
        - the model object (needed because theoretically descriptions can be applied to any model object, so self can't be cached e.g. in a block); this is annoyingly (because often you don't need it) the first argument because we want to be able to pass a selector here, which requires the receiver first
        - the object returned by the Search (already transformed by its send block if present)"

    self propertyAt: #gtSearchTransform put: aValuable

But had to roll back to "search result only" do to memento issue.

Left a note in MATokenSelectorElement>>initialize

stale[bot] commented 1 year ago

To limit bug bankruptcy (see https://www.joelonsoftware.com/2012/07/09/software-inventory/) this issue has been automatically marked as stale because it has not had any activity in 6 months. If no further activity occurs, it might be closed. If this issue remains important to you, please comment to reactivate the issue. Thank you for your contributions.