ThakeeNathees / pocketlang

A lightweight, fast embeddable scripting language.
https://thakeenathees.github.io/pocketlang/
MIT License
1.52k stars 80 forks source link

[Bugfix] native class can be inherited in script #280

Open khchen opened 2 years ago

khchen commented 2 years ago

Example:

from types import Vector

class Vector2 is Vector
  def *=(n)
    self.x *= n; self.y *= n; self.z *= n
    return self
  end
end

v = Vector2(1, 2, 3)
v *= 2
print(v)

Output:

[2, 4, 6]