mirror of
https://github.com/zekexiao/pocketlang.git
synced 2025-03-04 13:15:55 +08:00

- MethodBind type added. - Now methods are first class and can be passed around as arguments store as a variable and return it from a function and they're first class callbales. - Can bind instance to a method bind using .bind() method - Class.methods() method added -> return a list of all methods as method binds - Module.globals() method added -> returns a list of all globals of that module. - Var._class -> attribute added which will return the class of the variable - Class.name, MethodBind.name, Closure.name attribute and Modue._name attribute added - Class._docs, Closure._docs, MethodBind._docs attribute added - MethodBind.instance attribute added
43 lines
577 B
Markdown
43 lines
577 B
Markdown
# lang
|
|
|
|
### gc
|
|
|
|
```ruby
|
|
lang.gc() -> Number
|
|
```
|
|
|
|
Trigger garbage collection and return the amount of bytes cleaned.
|
|
|
|
### disas
|
|
|
|
```ruby
|
|
lang.disas(fn:Closure) -> String
|
|
```
|
|
|
|
Returns the disassembled opcode of the function [fn].
|
|
|
|
### backtrace
|
|
|
|
```ruby
|
|
lang.backtrace() -> String
|
|
```
|
|
|
|
Returns the backtrace as a string, each line is formated as '<function>;<file>;<line>
|
|
'.
|
|
|
|
### modules
|
|
|
|
```ruby
|
|
lang.modules() -> List
|
|
```
|
|
|
|
Returns the list of all registered modules.
|
|
|
|
### debug_break
|
|
|
|
```ruby
|
|
lang.debug_break() -> Null
|
|
```
|
|
|
|
A debug function for development (will be removed).
|