by Slackwise · 10y ago · 0 comments
local win = hs.window.focusedWindow()
local f = win:frame()
win is presumable a copy ("instance") of the table hs.window created by focusedWindow().Meaning hs.window.focusedWindow() returns a copy of the hs.window table.
With that being said, win.frame(win) would just be hs.window.frame(win), so you're also correct. It's just a poorly worded example explaining Lua's colon syntax feature.
As for JavaScript, my opinion is that Lua is everything JavaScript should have been: A clean, minimal, sanely designed, language. JavaScript on the other hand is nothing but mistakes piled upon mistakes. It's really disheartening to see JavaScript get shoved into places Lua fits better, like as Gnome Shell's scripting language. Oh well.