Time |
Nick |
Message |
02:37 |
MTDiscord |
<exe_virus> As long as those values map down to a table I'm good with more descriptive variable types |
02:38 |
MTDiscord |
<exe_virus> I.e. if you in the type return a vector, greenxenith can just call that a table and move on |
02:39 |
MTDiscord |
<exe_virus> So we would just need a small table mapping the descriptive types to numbers, tables, bools, etc |
02:39 |
MTDiscord |
<GreenXenith> The whole point of returning a "vector" is that its a special table |
02:39 |
MTDiscord |
<GreenXenith> changing it to table defeats the entire purpose |
02:39 |
MTDiscord |
<GreenXenith> vector links to the vector section, which describes a vector as at able |
02:39 |
MTDiscord |
<GreenXenith> thats all you need |
02:40 |
MTDiscord |
<exe_virus> Kk, I thought you were having issues with calling it a vector.... Why the heck do we need to give returns two types? |
02:41 |
MTDiscord |
<exe_virus> Every variable that contains 2+ values is going to be a table, this is Lua... |
02:41 |
MTDiscord |
<GreenXenith> sorry what? |
02:41 |
MTDiscord |
<GreenXenith> Lua lets you return multiple values at once |
02:41 |
MTDiscord |
<GreenXenith> and no, I dont have an issue calling it a vector, apparently LMD does. |
02:42 |
MTDiscord |
<GreenXenith> I have an issue saying something returns a table when its a vector, or specifying "table" every time its a vector |
02:44 |
MTDiscord |
<exe_virus> Okay I'm with you, saying the same thing, moving on to put a binky in this kids mouth... |
03:33 |
MTDiscord |
<MisterE> to quote the api: However, one should never create a vector manually as above, such misbehavior is deprecated. lua vector.new(0,0,0) ~= {x=0,y=0,z=0} specifically, vector.new returns a table of the form {x=0,y=0,z=0} but with a setmetatable applied which gives a vector special properites such as supporting addition of vectors |
05:00 |
|
MTDiscord joined #minetest-docs |
06:34 |
MTDiscord |
<Benrob0329> I mostly used vector as an analogy, the actual issue is when something specifically needs/returns an integer value, but we only have the general number type in Lua. |
06:34 |
MTDiscord |
<Benrob0329> I'm fine with it being described in prose, but I do understand where LMD is coming from |
10:58 |
MTDiscord |
<luatic> Perhaps object properties are a better example. In the end, they are just a table. Almost every table is a valid object properties table in fact, as most properties have defaults or silently default or clamp if set to erroneous values. When documenting object:set_properties, would we say that it takes a table, and then in prose describe that this is a table of object properties? I'd rather just say the type is "object properties", |
10:58 |
MTDiscord |
which would then link to the relevant documentation. Same for integers. Integers are a type which (at least in our version) is not an actual Lua type, but rather embedded in the Lua number type. Yet we want to make clear that the numbers should be integers. And integers occur very often. So I'm not fine with describing them in prose. I don't have an issue with calling a vector a vector, I just feel modders should know how the underlying |
10:58 |
MTDiscord |
metatable-based "classes" work. Perhaps there should be a document explaining them, so that modders get an idea of how to extend or modify these classes. |
11:13 |
|
appguru joined #minetest-docs |
11:55 |
|
erlehmann joined #minetest-docs |
12:25 |
|
erle joined #minetest-docs |
12:25 |
|
erlehmann joined #minetest-docs |
12:50 |
|
erlehmann joined #minetest-docs |
13:12 |
|
erlehmann joined #minetest-docs |
14:52 |
|
erlehmann joined #minetest-docs |
16:17 |
|
erlehmann joined #minetest-docs |
16:22 |
|
erlehmann joined #minetest-docs |
18:46 |
MTDiscord |
<MisterE> If it links to the relevant info, its fine. The problem with minetestapi&co is that it gives references to other parts of the api without linking |
21:03 |
|
appguru joined #minetest-docs |