Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: double free Date: Tue, 12 Jul 2016 09:40:21 -0700 Organization: None to speak of Lines: 34 Message-ID: References: <48c43c3f-8e7e-0509-5b9d-04133e7bb537@verizon.net> <57837892.8808984@news.xs4all.nl> <481f30b4-acb3-4445-92b3-c403dc3e51f7@googlegroups.com> <8760sc2aiz.fsf@bsb.me.uk> <87twfv26cv.fsf@bsb.me.uk> <2cfb31aa-11dd-422c-a5ea-07f44bee0deb@googlegroups.com> <8ba2b99f-4afe-42ce-9789-1c3c1792a5b2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="10518"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189zUtNZv6DMQGhAZdYl3cN" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:K4ID9ElRxd+zfHJa4qqCAVK42j0= sha1:gFuND25m2kZbYifokshgj67OELk= Xref: csiph.com comp.lang.c:90287 Malcolm McLean writes: > On Tuesday, July 12, 2016 at 4:44:21 PM UTC+1, Keith Thompson wrote: >> Imagine a C-like language that differs from C only in that "sizeof" >> is spelled "$". I presume that, in such a language, you'd be willing >> to write `$ foo` rather than `$(foo)`. Why does the fact that it's >> spelled "sizeof" change that? >> > Special mathematical symbols are used for basic operations like addition. > These operations are also functions, you can graph them, take derivatives, > and so on. They're not "functions" in the sense that C uses the word. > More complex operations don't always have special symbols, we use > identifiers like cos or log. And some operations like exponentiation are > sometimes represented using one convention, sometimes the other, sometimes > people will write pow(x,y), sometimes x^y or x**y (or the superscript > convention which I can't type here) And in mathematics, it's common to write `cos x` without parentheses. The word `cos` is treated like a symbol. > If you use a name rather than symbol, then it makes sense to use the > same syntax as other functions. Especially if you use names as variables > as well. It keeps things visually distinct. `sizeof` is a keyword. Apart from a superficial visual resemblance, it's more similar to operator symbols than to identifiers. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"