ayecue / greybel-vs

VSCode extension for GreyScript.
https://marketplace.visualstudio.com/items?itemName=ayecue.greybel-vs
MIT License
16 stars 7 forks source link

Quasi-feature Request: intrinsic object consistency #99

Closed Olipro closed 1 year ago

Olipro commented 1 year ago

Depending on how you want to look at it, this is either a feature request, or a (minor) bug report:

In GreyHack, returned intrinsics such as computer, file, shell are all map objects which have an __isa pointing to a base that contains all their core functions (e.g. touch, get_folders or launch, respectively)

In GreyHack, this allows MiniMock to automatically generate mock functions by being passed an instance of any GreyHack intrinsic. In Greybel, this doesn't exist so functions must be manually defined.

In any case, not a significant one, but I figured you'd want to know about it for consistency purposes - and who knows, this might end up also becoming relevant for MiniMicro intrinsics :)

ayecue commented 1 year ago

Hey so Greybel should actually already return intrinsics for shell, file, computer etc. Here a working example with shell: https://editor.greyscript.org/?c=cHJpbnQoJTQwZ2V0X3NoZWxsLl9faXNhKQ%3D%3D

Unless there is a bug or maybe I misunderstood the question?

Olipro commented 1 year ago

Hm, so it does. Alright, must be something on my end because MiniMock wasn't picking them up. Closing this up.