Valid characters in unary message

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Valid characters in unary message

BrunoBB
Hi,

I have a meta model of Workflow of Forms and at some point i added the possibility to apply a query Block to FormInstance (in the workflow to choose a path) that answer true or false.

The evaluation is like:
[:form | form age > 20 and:[form level = 3]]

FormInstance rewrite #doesNotUnderstand:
doesNotUnderstand: aMessageDescriptor
        ^(self hasFieldNamed: aMessageDescriptor selector)
        ifTrue: [(self valueAt: aMessageDescriptor selector asString) value]
        ifFalse: [super doesNotUnderstand: aMessageDescriptor]

Until now everything is OK. But the Form application is a Java Application and a form name can be "person-age" (not problem with "person_age").

Since "-" is a binary message "form person-age" is not recognized as a message. I almost sure that is not possible to make character "-" legal in a unary message.
Is this correct ?

Of course in the import process i can detect fields name with "-" character and show an error or warning.
Another solution is to put in the user manual if the field name has "-" character you have to use perform:
[:form | (form perform: 'person-age') > 20] "this is working"

But may there is a very very smalltalk chance to make "-" a legal character in unary message ?

Regards,
Bruno
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] Valid characters in unary message

GLASS mailing list
I don’t think that anything that could be interpreted as a binary message should be legal as a character in a unary message.

How would we distinguish the following:

| a b c d |
a := b c-d. “unary message (#’c-d’) only"
a := b c - d. “unary message (#’c’) followed by binary message (#’-‘) ”


> On Mar 2, 2015, at 3:12 PM, BrunoBB via Glass <[hidden email]> wrote:
>
> Hi,
>
> I have a meta model of Workflow of Forms and at some point i added the
> possibility to apply a query Block to FormInstance (in the workflow to
> choose a path) that answer true or false.
>
> The evaluation is like:
> [:form | form age > 20 and:[form level = 3]]
>
> FormInstance rewrite #doesNotUnderstand:
> doesNotUnderstand: aMessageDescriptor
> ^(self hasFieldNamed: aMessageDescriptor selector)
> ifTrue: [(self valueAt: aMessageDescriptor selector asString) value]
> ifFalse: [super doesNotUnderstand: aMessageDescriptor]
>
> Until now everything is OK. But the Form application is a Java Application
> and a form name can be "person-age" (not problem with "person_age").
>
> Since "-" is a binary message "form person-age" is not recognized as a
> message. I almost sure that is not possible to make character "-" legal in a
> unary message.
> Is this correct ?
>
> Of course in the import process i can detect fields name with "-" character
> and show an error or warning.
> Another solution is to put in the user manual if the field name has "-"
> character you have to use perform:
> [:form | (form perform: 'person-age') > 20] "this is working"
>
> But may there is a very very smalltalk chance to make "-" a legal character
> in unary message ?
>
> Regards,
> Bruno
>
>
>
> --
> View this message in context: http://forum.world.st/Valid-characters-in-unary-message-tp4808998.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] Valid characters in unary message

BrunoBB
"I don’t think that anything that could be interpreted as a binary message should be legal as a character in a unary message. "

Well, this is the rule !!!

i just wanna be 100% sure now i take this option out of the table :)

Thanks for the fast answer.

Regards,
Bruno