axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Axiom-developer] B#


From: Bill Page
Subject: RE: [Axiom-developer] B#
Date: Mon, 21 Nov 2005 14:09:49 -0500

On November 21, 2005 12:59 PM Gaby wrote:
> 
> "Bill Page" <address@hidden> writes:
> | 
> | http://en.wikipedia.org/wiki/Datatype
> | 
> | > 
> | > That is interesting but the link above is confused to start
> | > with. I quote: 
> | > 
> | >    An example of the absence of strong typing is a C cast 
> | >    gone wrong; if you cast a value in C, not only is the
> | >    compiler required to allow the code, but the runtime is
> | >    expected to allow it as well.
> | > 
> | > That is misleading at best. ...
> | 
> | I think you are wrong.
> 
> No -- sorry, Bill you can't have it right on this one.
> 
> 
> Your program is ill-formed according to ISO C rules and semantics
> and my compiler rightly rejects it:
> 
>     bill-page.c: In function 'main':
>     bill-page.c:10: error: invalid lvalue in assignment
> 

I guess we are using different versions of gcc.

Here is what I get:

$ gcc --version;cat cast1.c; gcc -o cast1 cast1.c; cast1
gcc.exe (GCC) 3.4.2 (mingw-special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

/*
  'caste' example of weak typing in C
   Author: Bill Page
   Date: 21 Nov 2005
*/
#include <stdio.h>
int main(int argn, char *argv[]) {
float j;

  (int)j = 1;
  printf("float: %d\n",j);
  return 0;
}
cast1.c: In function `main':
cast1.c:10: warning: use of cast expressions as lvalues is
            deprecated
float: 0

--------

I note that I do get a warning. So this is a feature in the
language that is changing (deprecated).

> 
> | I still think the referenced article is well balanced and
> | accurate.
> 
> I don't think so  If is full of confusion and misunderstanding.

You have given only one example of something you disagree with
and at most I might be forced to agree that the author should
probably have been specific about which version of C he was
criticizing. The point still stands that many version of C used
to accept such constructions even if that is no longer true in
all versions.

> Unfortunately, many people take it as a Bible sentence don't
> go and do a minimum scrutinity as would be required in a
> scientific setting :-(
> 

Maybe some people do, but I do not intend to accept such an
attitude. I think I have applied much more than "minimum
scrutiny" to this article. Of course it is difficult to be
entirely accurate in an article that is intended to be at
most one or two pages.

Notice that there is a reference therein also to

http://en.wikipedia.org/wiki/Strongly-typed_programming_language

which also criticises the term "strong typing" as being
ambiguous and quotes well known author Benjamin C. Pierce
to this effect.

Could you provide a reference to a short article that you think
is less "full of confusion and misunderstanding"?

Regards,
Bill Page.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]