For those of you demanding a reason Lua is shit,
consider the following code:
local fh = io.open(filename, "r")
while true do
line = fh:read("*l")
if line == nil then break end
f(line)
end
That is a fucking eyesore. The whole point of a while loop is to embed the exit condition in it. When you have to make an infinite loop and then use an if statement with a break to accomplish what you can normally do with something like:
>>41
People embed Python, if you're going that far you might as well embed something that doesn't add GC stutter to your UI. Or were you the only guy in this thread talking about "embedded systems"?
Name:
Anonymous2011-10-05 0:40
>>23 It returns a ``map object'', which isn't a proper replacement for a lazy list
Lazy lists dont support random access.
Name:
Anonymous2011-10-05 0:52
>>36 Who would give away free ringtones? How would they earn back the money‽
ringtone is free, while...
- it serves promotional purposes
- first day isn't over, then DRM forces you to pay
- it gives backdoor to your phone
- you watch ads
- advertising "free" will get these jews more clicks
>>47
When was the last time you REALLY needed random access into a sequence.
There are precious few instances. Some games have grids. And there's image processing.
But unless you're making checkers-Fourier-transform 2011, who gives a fuck?
Name:
Anonymous2011-10-05 1:23
>>50
I'm writing a text editor. It should support copy-pasting and undo. Of all list structures, only immutable finger tree supports that out of the box. Does Python support immutable trees with path-copying?
I bet you could do it using python's immutable tupples, giving an immutable tree with variable degree vertices. The path copying would have to be implemented yourself, and it probably wouldn't fly too well with high degree vertices.
>>> tree = (((1, 2), (3, 4)) ((5, 6), (7, 8)))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object is not callable
>>> tree = (((1, 2), (3, 4)), ((5, 6), (7, 8)))
>>> print tree
(((1, 2), (3, 4)), ((5, 6), (7, 8)))
>>> tree2 = ((10, 11), tree)
>>> print tree2
((10, 11), (((1, 2), (3, 4)), ((5, 6), (7, 8))))
>>> def insert_left(tree, value)
File "<stdin>", line 1
def insert_left(tree, value)
^
SyntaxError: invalid syntax
>>> def insert_left(tree, value):
... if type(tree) is TupleType:
... return (tree[0], insert_left(tree[1], value))
... else:
... return (tree, value)
...
>>> print tree
(((1, 2), (3, 4)), ((5, 6), (7, 8)))
>>> print tree2
((10, 11), (((1, 2), (3, 4)), ((5, 6), (7, 8))))
>>> tree3 = insert_left(tree2, 167)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in insert_left
NameError: global name 'TupleType' is not defined
>>> from types import *
>>> def insert_left(tree, value):
... if type(tree) is TupleType:
... return (tree[0], insert_left(tree[1], value))
... else:
... return (tree, value)
...
>>> tree3 = insert_left(tree2, 4643)
>>> print tree3
((10, 11), (((1, 2), (3, 4)), ((5, 6), (7, (8, 4643)))))
>>>
Name:
Anonymous2011-10-05 3:02
>>52
Well then Python sucks. And why does it place "," comas between list's elements? How can I disable that?
Name:
Anonymous2011-10-05 3:39
i remember reading some faggots code and he had for(;;) everywhere.
Name:
Anonymous2011-10-05 3:45
>>54
IDA decompiler produces a lot of while (1) code, with breaks inside of it.
>>52
Do you even know about Python's syntax, you retard?
>>53
Because it makes the output more readable, you retard.
Name:
Anonymous2011-10-05 4:22
>>56 Because it makes the output more readable, you retard.
How printing garbage makes output "more readable"?
Name:
Anonymous2011-10-05 4:29
Python requires a lot of delimiters, like ',', to offset it's ugly syntax defficiencies, else "A (-B)" can be mistaken for "A - B". If you hate such non-uniformity and want elegance - consider Lisp.
>>58 but but but but why is python not like my favourite programming language! bad bad bad python! python bad! me no like confusy! why it make me thinky! me no like thinky! me give headache bad! bad bad!
Yes, we know you have your problems with Python.
But is it asked too much to take your ``problems'' and go back to /g/, please?
Name:
Anonymous2011-10-05 13:30
>>60
making me riddle my program with commas is NOT thinking. The fact that you think it is indicates that you are a typical syntax-obsessed Python faggot.
Name:
Anonymous2011-10-05 13:49
>>60 pythonista gets butthurt when he realizes somebody doesn't like his pet language