sdvillal / whatami

Easily provide python objects with self-identification
Other
9 stars 1 forks source link

Allow "result=whatid" ids? #11

Closed sdvillal closed 8 years ago

sdvillal commented 8 years ago

It is useful to allow id strings that specify the output name from computations that return more than one value. If for example, the computation is given by a whatami id like "GoingTowards(here='pos', there='target')", and the output is named "velocity", we have the following two advantageous options:

Option 1 - a human friendly syntax:

velocity=GoingTowards(here='pos',there='target')

Option 2 - a whatami friendly syntax:

GoingTowards(here='pos',out='velocity',there='target')

I'm inclined to keep option 2, because option 1 would surely require changes to the ID parser and, potentially, to the What class. However, option 1 reads better.