Name: Anonymous 2014-12-02 12:11
Why hasn't anyone made C that doesn't look like dogshit?
(def pointer_compare (-> (location1 void *) (location2 void *) int)
(cond
((< location1 location2) ~1)
((> location1 location2) 1)
(t 0)))
(def string_hash (-> (string void *) (unsigned int))
(def result (: int) 5381)
(def p (: (unsigned char *)))
(set! p ((cast unsigned char *) string))
(while (!= (@ p) '\0')
(set! result (+ (<< result 5)
(result)
(@ p)))
(++ p))
(result))
(def string_hash (-> (string void *) (unsigned int))
(def result (: int) 5381)
(def p (: (unsigned char *)))
(set! p ((cast unsigned char *) string))
(while (!= (@ p) '\0')
(set! result (+ (<< result 5)
(result)
(@ p)))
(++ p))
result)
creat
def func_name(type1 arg1, type2 arg2): ret_type { ...
int arr[]
if it's not an int? It's an array of ints, the [] needs to go to the type, ya incestuous drunken faggots. Hey, it's equivalent to int* arr
(at least in function arguments), so why does the * go to the type if the [] goes to the identifier? Fucking disgusting. Hey, it's equivalent to int* arrOnly people that do not understand C syntax use int* arr. This shows something about you.
so why does the * go to the type if the [] goes to the identifierIt does not. Think of int* a, b. b is a int while *a is a int.
Foo : Integer
, Bar : Map<String, Float>
, and word []char
. But the syntax for declaring such identifiers is completely different from the syntax for using them in your code, which complicates the language: You must be able to express both the name of the type itself and the way it is used.*p
is int
, and therefore you would write int *p
. The type of buf[n]
is unsigned char
, and therefore you would write unsigned char buf[BUFSIZ]
.only a retard would complain about C's syntax.Didn't read the rest.
int func_name(...);
func_name(...)
may indeed be replaced by a value of type int. But it doesn't make sense in C because there are unrestricted implicit side effects everywhere, and a function call is not, as a rule, observationally equivalent to its return value.(void *)
for all function types.