teal-language / tl

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

extended stdlib by environment #728

Closed atticus-sullivan closed 5 months ago

atticus-sullivan commented 6 months ago

I'm working on a project which should run with texlua. Now the issue I have is that inside texlua some stuff is added to the stdlib. Suppose for example section 4.2.6 in the docs (should be page 69). There it says the os library/table is being extended by e.g. a type: string field.

As of https://github.com/teal-language/tl/pull/48 teal itself disallows such extending, but is there a possibility to bring such changes in the environment (not by the lua script) to teal? (so that there are no issues when using such added fields)

Usually I think one would go with writing a <...>.d.tl file, but when the subject is a stdlib table like os or string I think this is not possible.

hishamhm commented 5 months ago

Closing this as a duplicate of #532 — BTW, I have just successfully ported the default standard library definition to be written in Teal itself in the next branch, so we're now much closer to making this feature request possible!