de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 def or int?
PostPosted: Tue Oct 22, 2013 4:49 pm 
Offline
Veteran
User avatar
Minor question from a groovy newbie:

In groovy, should all defines be "def" or should I be using "int" for purely numerical values that need calculations done?

I'm a bit confused if "int" ever needs to be used, as "def" seems to guess what kind of value you wanted anyway. So far, the only time it didn't work was with .replace, when the value was already a number... but I fixed that by using .toString() after much trial and error!


Top
 Profile Send private message 
 
 Re: def or int?
PostPosted: Tue Oct 22, 2013 7:59 pm 
Offline
Site Admin
User avatar
"int" is from Java ; Java may be harder for newcomers because of a lot of things, notably having stronger types (needing the use of "int")
"def" is Groovy-only ; it is easier. Alas, sometime you need to say to the interpreter : "this is an integer". There, you may use a special syntax to do it, like using "int", "long", "....toString()", etc.,


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.