> Const keyword: changing const from `local a <const> = 42` to `const a = 42` is far better syntax. The bracketed syntax was never a good idea.
The bracketed syntax is an okay idea especially for <close>, adding close as a keyword would be a disaster given how common the word is. If anything, local should have been tossed away as a keyword and the bracketed syntax adopted completely
v <local const close>, v2 = io.open'file', false
g <global const> = 5
5.5 introduced global which makes better use of attributes as well. of course, I don't deny how great it would be to not type <> or local const since const would already imply a local
> string interpolation
Hisham already made this nice module https://github.com/hishamhm/f-strings Which I don't dare use, even if you don't have string interpolation. Of course, I don't care because I just have a table.format(tbl, "tbl.key is %{key}"), is it a little tedious? sure, but its just a gsub call.
> short form function syntax
I disagree with this, I've always wanted it and roll my eyes as I write/create a function, especially when you like to use lots of them like
str:gsub('%d+', (s){ tonumber(s)+1 })
> Named varargs: It may be nice, but there is no real reason to add this. If you wanted a name for your varargs you could do `local name = ...` or just use the `args` variable already available in every function.
You've made a mistake there
local name = ...
is
local name = ({...})[1]
In order to actually do this you need to
local name = table.pack(...)
If you will use a vararg, you will always have to do this, so why not just let it be handled in the parameter definition? its costless. AND lua5.5 already introduced this so it seems they liked it.
Quite frankly I would like the capability of treating ... as just an array like ...[1] but I haven't looked at the parser to see if its feasible or not.
> Switch/Match/Select Statements: An optimized if/else block works just as well and another expansion of a small language.
I don't disagree, but big table of functions is so ugly, switch statements would be nice
- Agreed on the bracketed attributes, the close attribute is very useful and devs would reach for the brackets more if they were like as you suggest.
- short form fns: you and another commenter have given me good examples. I’m still not sure they are worth the complexity but I understand the use better now.
- varargs true! Conceded!
No, not basically, it simply doesn't have them, Ternary means three as in it operates on 3 operands, and/or operates on 2 operands. They are also not equivalent.
x = a ? b : c # x is b, same as you would if a {x=b} else {x=c}
lua and/or
a,b,c = true, 1, 2
x = a and b or c -- x is b
a,b,c = true, false, 2
x = a and b or c -- x is c
The or is dependent on its previous operand, so b will return false and skips to c, even if you meant for it to be b. you must use an if then else. However, you can have more than a ternary, if there is no need for short-circuit evaluation, as in, any of the operand is not a function CALL like c(), and you want to remain inside an expression, then you can do this instead
select (select is a native C function, this is faster than the table creation below)
Legalities aside, You can use compute how you want, that doesn't stop anybody from accurately measuring its usefulness. Given that this is an objective measurement.
I can have a computer on an endless loop without any idling, consuming as much CPU time as it can, I do not know any other classification of this action than wastefulness. crypto mining is useful of course, the end goal of mining is to get crypto, of course, there is no further goal beyond that.
Via comparison of the solutions, we measure objectives and actions performed and the time it requires to do them.
Objectively, Minecraft is a game, an objective of many games is to waste time, therefore this cannot be used as a measurement, but enjoyment is. as a game it fulfills its role. wastefulness could be classified in comparison to other solutions/clones, like minetest. If minetest fulfills exactly the same goals with less action as minecraft, then minecraft is in comparison wasteful.
Another measurement is mining solutions can we achieve the action of mining with less compute? can we not mine at all? does not mining achieve the same goal? if it does, then mining is objectively wasteful.
The objective of crypto is replacing fiat currency, it does not do this, therefore it is wasteful. Of course, this is only true until it does replace it, which is why we must compare, would this cryptocoin scale to the entire world? does it require more work for it to do so? if so then it is wasteful.
Well, it seems he wasn't, he's not gonna get upvotes though, HN is startup culture and startup culture is selling dreams until it works or you notice too late you got robbed.
And who's gonna admit that bitcoin is a ponzi scheme when all of their savings are in it? you can't, it would devalue your own money, so you're trapped, you can only further invest in it.
It worked on ipv6 only for like a year, it seemed to be back this last month but it seems to be back down right now probably because of this whole github ragequit happening.
It has a wiki, forum and issues included. So it definitely can do that, what fossil allows by default is to not have a docs/ or bugs/todo file, because its all in the server part.
The bracketed syntax is an okay idea especially for <close>, adding close as a keyword would be a disaster given how common the word is. If anything, local should have been tossed away as a keyword and the bracketed syntax adopted completely
5.5 introduced global which makes better use of attributes as well. of course, I don't deny how great it would be to not type <> or local const since const would already imply a local> string interpolation
Hisham already made this nice module https://github.com/hishamhm/f-strings Which I don't dare use, even if you don't have string interpolation. Of course, I don't care because I just have a table.format(tbl, "tbl.key is %{key}"), is it a little tedious? sure, but its just a gsub call.
> short form function syntax
I disagree with this, I've always wanted it and roll my eyes as I write/create a function, especially when you like to use lots of them like
> Named varargs: It may be nice, but there is no real reason to add this. If you wanted a name for your varargs you could do `local name = ...` or just use the `args` variable already available in every function.You've made a mistake there
is In order to actually do this you need to If you will use a vararg, you will always have to do this, so why not just let it be handled in the parameter definition? its costless. AND lua5.5 already introduced this so it seems they liked it.Quite frankly I would like the capability of treating ... as just an array like ...[1] but I haven't looked at the parser to see if its feasible or not.
> Switch/Match/Select Statements: An optimized if/else block works just as well and another expansion of a small language.
I don't disagree, but big table of functions is so ugly, switch statements would be nice
reply