teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.13k stars 107 forks source link

Redefining the standard library #590

Closed uramer closed 1 year ago

uramer commented 1 year ago

In my context, the debug library is not available, and some methods of other standard libraries aren't either.

I would expect to be able to redefine it by having global debug: nil etc in my declaration files, but I get errors such as global was previously declared as <const>: debug

Is there an intended way to do this?

uramer commented 1 year ago

Here it's mentioned that it's possible: https://github.com/teal-language/tl/issues/532#issuecomment-1179307978

For the time being, unfortunately if you really need to use a customized definition of standard library tables, you'll have to redefine the whole thing.

But not how

hishamhm commented 1 year ago

@uramer That last statement was incorrect, sorry. I fixed that comment and I'm closing this issue as a duplicate, while keeping the other one open for tracking the feature request.