gibbsly / gm

A utility datapack for doing math operations
The Unlicense
31 stars 2 forks source link

Enhancement: Add IMP #7

Closed GlitchlessCode closed 6 months ago

GlitchlessCode commented 6 months ago

Enhancement:

IMP is used fairly often in datapack development. It may allow for easier usability of this datapack to implement IMP into GM (Especially IMP-DOC). Some people may find this useful, considering this datapack really is mainly meant to be a module which exposes an easy API to use.

One small caveat to implementing this is that IMP-DOC currently has no specification for macros, which are widely used in this datapack. However, to resolve this, I propose the following:

### Function annotation `@macro` This annotation only has one form: ```mcfunction #> namespace:path/to/function # # An imaginary example function. # # @macro # macro_name: type # Macro description ``` So, for example: ```mcfunction #> gm:arctan2 # # Gets the arctangent of y/x # # @macro # x: float | double # The denominator of the ratio # y: float | double # The numerator of the ratio ```

If you think that adding IMP standards into this datapack would be good, let me know, I'm willing to put in a PR for that.

gibbsly commented 6 months ago

yea absolutely, I was thinking about headers for this the other day when they were brought up on mcc