bshoshany / OGRe

An object-oriented general relativity package for Mathematica.
MIT License
122 stars 20 forks source link

Supporting symbol keys or auto-completion of string keys #4

Closed yuriever closed 1 year ago

yuriever commented 1 year ago

Hi! I'm new using your package and have only read part of the code. I just wonder is it okay to support Symbol keys like replacing

TNewCoordinates[coordinatesID_String, coordinates_List?VectorQ] := 

by

keytype=(_String|_Symbol)
TNewCoordinates[coordinatesID:keytype, coordinates_List?VectorQ] := 

Will this replacement of patterns break codes in other place?

Or if supporting Symbol keys is hard, can String keys be auto-completed by

FE`Evaluate@FEPrivate`AddSpecialArgCompletion[_];

in this answer. Where are the right places to add this function?

bshoshany commented 1 year ago

Hi @yuriever, thanks for opening this issue. Sorry it took me so long to reply. I'm currently on hiatus from developing this package, since I'm too busy teaching. However, I plan to release a new version with many bug fixes and new features in the summer.

I have considered replacing the strings with symbol names, but I'm not sure this is a good idea, since it will make it easier to break encapsulation. However, I do plan on adding autocomplete for the object names. It won't be in the way that you suggest, since that is an undocumented and possibly broken feature, but I might use AddCodeCompletion or something similar.

Closing this issue since this is already planned to be implemented in the next release.