Haskell memory management
1
Name:
Anonymous
2008-06-23 17:34
Haskell can't update variables, so I came up with an alternative solution: make new variables that hold desired values. But the problem is that when I make a new variable every time I change its value, the old variable stays there and littler the memory. How can I delete it?
2
Name:
Anonymous
2008-06-23 17:50
Garbage collector.
3
Name:
Anonymous
2008-06-23 17:50
Or reference counting.
4
Name:
Anonymous
2008-06-23 18:03
*facepalm*
5
Name:
Anonymous
2008-06-23 18:13
6
Name:
Anonymous
2008-06-23 19:15
It can't update variables? That's why it's called a variable!
What sort of shit useless language is this?!
7
Name:
Anonymous
2008-06-23 19:39
8
Name:
Anonymous
2008-06-23 20:26
variables should function arguments or structures you pass between functions
don't worry about freeing anything
9
Name:
Anonymous
2008-06-23 20:38
I am Heron of Alexandria. I have a large beard and I create mathematical formulas. If you don't repost this comment on 10 other pages, I will use my primitive steam engine to induce mold in your walls.
10
Name:
Anonymous
2008-06-23 21:13
>>9
How do I know it's really you, and not someone reposting the comment?
11
Name:
Anonymous
2008-06-23 21:30
In actuality, the term ``variable'' in Haskell is more properly known as a ``named function''
12
Name:
Anonymous
2008-06-24 1:45
>>6
variable does not mean mutable, you cretin
13
Name:
Anonymous
2008-06-24 4:47
Is this thread serious?
14
Name:
Anonymous
2008-06-24 5:51
>>12
Yes it does. Think about what the word actually means.
15
Name:
Anonymous
2008-06-24 7:12
>>14
OP is trolling, can't you see it?
16
Name:
Anonymous
2008-06-24 7:34
17
Name:
Anonymous
2008-06-24 7:48
Can we please stop the trolling?
18
Name:
Anonymous
2008-06-24 9:25
19
Name:
Anonymous
2008-06-24 9:28
const int lol = 0;
OMG you can't modify the variable!!!~1`lol
20
Name:
Anonymous
2008-06-24 9:31
21
Name:
Anonymous
2008-06-24 9:53
>>20
That's a variable
with const storage class
22
Name:
Anonymous
2008-06-24 10:06
>>21
No, it's not a variable, it's a constant.
23
Name:
Anonymous
2008-06-24 10:34
>>22
A constant variable.
24
Name:
Anonymous
2008-06-24 10:43
>>22
It's not a constant in C.
Proof: switch (42) { case lol: break; } doesn't compile.
25
Name:
Anonymous
2008-06-24 10:44
>>24
Your mother is not const correct.
26
Name:
Anonymous
2008-06-24 11:59
>>24
You misunderstand what a constant really is.
27
Name:
Anonymous
2008-06-24 12:51
stop thinking about memory, the problem will disappear.
28
Name:
Anonymous
2008-06-24 13:27
29
Name:
Anonymous
2008-06-24 13:44
const int lol = 0;
typedef lol float;
------------------
#define lol 1
typedef lol float;
30
Name:
Anonymous
2008-06-24 16:14
>>11
Actually, you should think of a ``Haskell Variable'' as a ``named expression''
31
Name:
Anonymous
2008-06-24 16:52
I submitted a patch to GHC to allow variables to actually vary, but they didn't accept it. Ungrateful bastards.
32
Name:
Anonymous
2008-06-24 17:52
Haskell variables are like mathematical variables.
/thread
33
Name:
Anonymous
2008-06-24 17:52
hm
34
Name:
Anonymous
2008-06-24 19:14
>>32
Except they are not.
35
Name:
Anonymous
2008-06-24 19:24
Logical variables aren't mutable either.
36
Name:
Anonymous
2009-09-17 21:05
Lain.
37
Name:
Anonymous
2009-09-17 21:06
Lain.
38
Name:
Anonymous
2009-09-17 21:06
Lain.
39
Name:
Anonymous
2009-09-17 21:07
Lain.
40
Name:
Anonymous
2009-09-17 21:07
Lain.
Newer Posts