Page 1 of 2

maybe im just nit picking...

Posted: Wed Apr 23, 2014 9:06 am
by hairy puppy
hello all,

enjoying LOVE like the 6 year old me enjoying disneyland.

though i do have a question or two regarding the syntax of LOVE, maybe even lua, but more on LOVE right now.
since it is mainly dealt with camel case [whereTheTextLooksLikeThis]. then why doesnt things like love.keypressed, or even love.keyreleased have them, like love.keyPressed and love.keyReleased. there are others, but these stuck out because ive been using them just now.
i may be nit picking here, but those keyboard functions have say .setKeyRepeat and so forth.

i guess im just looking at this as keeping things consistent. but just wanted to ask none-the-less. i guess coming from an arduino/c/c++ kind of call, then im just used to those things.

Re: maybe im just nit picking...

Posted: Wed Apr 23, 2014 9:51 am
by slime

Re: maybe im just nit picking...

Posted: Wed Apr 23, 2014 11:08 am
by hairy puppy
thanks for that. i chimed in my annoying 2 cents too it ;)

Re: maybe im just nit picking...

Posted: Thu Apr 24, 2014 7:16 am
by OttoRobba
Just to point out that some modules will abide by a lowercase naming convention due to how Lua's core functions are written (and this might be why LÖVE's callbacks are as they are now).

dofile
setmetable
math.randomseed
debug.traceback
...
and so on.

PS: Welcome to LÖVE :D

Re: maybe im just nit picking...

Posted: Thu Apr 24, 2014 8:16 am
by hairy puppy
aye, well the functions for onFocus, keyPressed etc have been the centre of attention. but thanks for letting me know. good to keep in the loop

Re: maybe im just nit picking...

Posted: Thu Apr 24, 2014 8:16 am
by HugoBDesigner
You can always have this on the top of main.lua or in the beggining of love.load:

Code: Select all

love.keyPressed = love.keypressed
love.keyReleased = love.keyreleased
love.mousePressed = love.mousepressed
love.mouseReleased = love.mousereleased
--Any other code. You got my point
But yeah, I think I'd prefer uppercase too (even though it'd break 100% of LÖVE games).

Re: maybe im just nit picking...

Posted: Fri Apr 25, 2014 3:01 am
by Inny
I'd go one step further and ask why the callbacks aren't subscriptions

Code: Select all

love.on_update(function(dt)
    inny.writes.too.much:javascript()
end)

Re: maybe im just nit picking...

Posted: Fri Apr 25, 2014 5:55 am
by OttoRobba
Inny wrote:I'd go one step further and ask why the callbacks aren't subscriptions

Code: Select all

love.on_update(function(dt)
    inny.writes.too.much:javascript()
end)
Image

Re: maybe im just nit picking...

Posted: Fri Apr 25, 2014 6:30 am
by slime
Inny wrote:I'd go one step further and ask why the callbacks aren't subscriptions

Code: Select all

love.on_update(function(dt)
    inny.writes.too.much:javascript()
end)
In my eyes, that code snippet is the perfect illustration for why LÖVE will not do that. :monocle:

Re: maybe im just nit picking...

Posted: Fri Apr 25, 2014 1:49 pm
by Ragzouken
all i ask is please avoid putting "on" in front of everything D: