A C tutorial

J

jacob navia

Dan Pop said:
In <[email protected]> "jacob navia"

For example, you're not allowed to invade the program name space with
identifiers like WINVER and WIN32 (but _WIN32 and _WIN32_IE are OK) and

int c = operator+(a,b);

*must* be parsed as

int c = operator + (a,b);

where operator is a program defined identifier (this is a perfectly
valid C expression, BTW).

Otherwise, your compiler is not a conforming C compiler.


Yes. Here is a session transcript
#include <stdio.h>
int main(void)
{
int operator = 2;
int c = operator+(2,3);

printf("c is %d\n",c);
return 0;
}

D:\lcc\mc50\test>lc top.c

D:\lcc\mc50\test>top
c is 5

D:\lcc\mc50\test>

I have really worked on that...

Besides, I repeat ALL extensions will be disabled with the -ansic
flag.
In that case:
1) No operator overloading
2) No 350 bit precision floats (long double still works of course)
3) No generic functions
4) No default arguments.

It is possible that some problems could appear with complex numbers,
since
internally they use operator overloading. In that case please write a
bug report and I will fix it ASAP.

Thanks for your input Dan.
 
A

Arthur J. O'Dwyer

Arthur J. O'Dwyer said:
Re the actual content, I gave it a very cursory inspection. The
text still has a higher-than-average number of typos [snip]
I will also say that the typography needs some work. It's legible,
but you haven't paid much attention to the consistent use of Courier
for code snippets embedded in the text, the difference between ` and
' and whatever TeX does with ", `` and '', and lots of other little
typographical nits.

I didn't want to use Word, so I wrote it with Adobe Frame maker,
a very expensive and badly functioning software as I discovered
after buying it. The spell checker is inexistent almost. I will
spell check it with Word again.

I have recently become a LaTeX convert (lots of math homework and
Linux will do that to you). I strongly recommend you look at it,
and its companion 'pdflatex' (although writing a whole book-length
piece in LaTeX, with charts and pictures and an index, might be a
little tricky, I dunno). Plus, then you would be able to release
the text in a portable document format (namely, LaTeX), so that
Richard could read it. ;-)
Don't use Word's spell-checker. It will just make your text
word-wise correct, leaving in the character-wise (typographical)
and sentence-wise (grammatical) problems. If you can't stand to
read through your own text in order to find the bugs, what makes
you think anyone else will? :) [English as a non-native language,
I guess, would be a really good excuse. Hey, release the portable
source to the text, and let the Free Market (TM) fix your typos!]

-Arthur
 
R

Richard Heathfield

Dan said:
In <[email protected]> Richard Heathfield


How do you read your copy of the C99 standard?

I use ghostview (from which I cannot copy/paste, and which I find awkward
and clunky to use). I am not formatting a tool-generated text copy of the
Standard in my spare time, and it is not approximately 10% complete. When
it is not 100% complete, I will not no longer need ghostview.
 
J

Jack Klein

Then it isn't C. The code may be C++, which happens to have a lot in
common with C (though it is not truly a superset)
Operator overloading is without a doubt NOT ISO/ANSI C.

So you're telling me that just because a program does not use class,
namespace, or templates means its not C++. I think you have flawed
reasoning.
Sorry, but your tutorial uses C++. It may use a restricted subset of C++,
but it is still C++, not C.

Got it?

You are mistaken. Jacob Navia's compiler is most definitely *NOT*
a C++ compiler, and doesn't try to be (AFAIK). It *is* a C compiler
with a whole bunch of non-standard extensions, including operator
overloading and suchlike. But it's *NOT* C++!

To use Sidney's analogy, just because Jacob likes to play soccer
using a tennis racket doesn't mean he's playing tennis. He may not
be playing tournament-rules soccer, but he's sure as heck not
playing tennis, if he's still kicking around that big black-and-white
ball!

[Jacob's an off-and-on regular in c.l.c, which is how I know what
his compiler is like, second-hand. I've never tried it myself: I
prefer to play soccer with my feet, and tennis with my tennis racket.
;-) ]

-Arthur

The mistake you are making, Arthur, is assuming that lcc-win32's
extensions keep it from being a very good conforming C90 compiler with
a large subset of C99's features when desired.

That is most certainly not the case, and I have used various versions
of his compiler for years, with excellent results.
 
J

Jack Klein

I didn't want to use Word, so I wrote it with Adobe Frame maker,
a very expensive and badly functioning software as I discovered
after buying it. The spell checker is inexistent almost. I will
spell check it with Word again.

Jacob, a suggestion from a happy lcc-win32 user. I have been using
Open Office lately (free download from http://www.openoffice.org). It
has very good Word comparability and also the ability to directly
generate PDF files for distribution, so people who download them only
need the free Acrobat reader and not any particular word processor.

If you give it a try, you might like it.
 
A

Arthur J. O'Dwyer

The mistake you are making, Arthur, is assuming that lcc-win32's
extensions keep it from being a very good conforming C90 compiler with
a large subset of C99's features when desired.

I make no such assumption. I only said Jacob seems to *prefer*
playing soccer with a tennis racket; I never said that he *always*
does so. :) If his compiler weren't at least C90- or C99-conforming
in some mode, I wouldn't even have *called* it a "C compiler"!
So there!
That is most certainly not the case, and I have used various versions
of his compiler for years, with excellent results.

I don't doubt it.

-Arthur,
clarifying
 
D

Dan Pop

In said:
Where have I claimed *Jacob Navia* wrote documents that require a
particular product to read?

Then, what *exactly* was the point of your previous post, in the context
of this particular thread?

Dan
 
D

Dan Pop

In said:
I use ghostview (from which I cannot copy/paste, and which I find awkward
and clunky to use).

OTOH, Acrobat Reader lets you copy/paste, generates excellent output
and is trivially easy to use. If your choice of tools is suboptimal,
there is little point in blaming others.
I am not formatting a tool-generated text copy of the
Standard in my spare time, and it is not approximately 10% complete. When
it is not 100% complete, I will not no longer need ghostview.

Been there, done that. You'll still need a PDF reader for the sections
involving math formulas (unless you translate them into TeX or some other
plain text representation that you can *easily* read). Admittedly, these
sections are seldom relevant to c.l.c discussions.

Dan
 
R

Richard Heathfield

Dan said:
In <[email protected]> Richard Heathfield


OTOH, Acrobat Reader lets you copy/paste, generates excellent output
and is trivially easy to use.

Is the source code freely available, so that I can assure myself that the
program contains no malicious code?

<snip>
 
M

Mark McIntyre

Is the source code freely available, so that I can assure myself that the
program contains no malicious code?

the license agreement avers that it doesn.t. . If acrobat eats your
machine, you can sue adobe.

BTW I bet you a groat you don't scan most programs for malicious code,
so your argument is spurious.
 
R

Richard Heathfield

Mark said:
the license agreement avers that it doesn.t.

Does it?
If acrobat eats your
machine, you can sue adobe.

Great! But anyone can sue anyone anytime. It doesn't guarantee I'll win.
BTW I bet you a groat you don't scan most programs for malicious code,
so your argument is spurious.

I disagree that the argument is spurious. It's true that I don't scan most
programs for malicious code; I don't have to, because - since they're Open
Source - lots of people have done this already, and word would soon get
around if there were any malware kicking around the open source scene.

Having said that, this isn't the place for an Open Source discussion. I'd
set followups if I could think of anywhere appropriate. I can't, so I'll
just shut up about it instead.
 
A

Allin Cottrell

Richard said:
Is the source code freely available, so that I can assure myself that the
program contains no malicious code?

If that's a concern, use xpdf instead. Last time I checked it did not
let you copy text, but it does let you search, which is probably more
significant in the orginal context (reading the C standard, I believe).
 
J

jacob navia

Richard Heathfield said:
Thanks. I'd love to have a look at it. Do you have a version available in a
portable document format? The site says that "you need the Acrobat Reader
to view it". You see, given a choice between using Acrobat Reader or not
reading your tutorial, I will cheerfully give up the chance to read your
tutorial.

Look, I have taken the time to prepare:
ftp://ftp.cs.virginia.edu/pub/lcc-win32/tutorial.zip

It is in html format and only 600K. You can read it with your
browser. Many small things have disappeared, like the
indentation of program text, but it is still quite readable

I am in no way associated with Adobe corp. Neither do I want to do any
publicity for them.

But PDF is a widely used format, and there are many tools under linux
that
understand it perfectly. I could have put the post script file, but it
is 40MB,
zipping it reduces it to 12MB, quite considerable still. So I produced
zipped html.

jacob
 
C

CBFalconer

jacob said:
Look, I have taken the time to prepare:
ftp://ftp.cs.virginia.edu/pub/lcc-win32/tutorial.zip

It is in html format and only 600K. You can read it with your
browser. Many small things have disappeared, like the
indentation of program text, but it is still quite readable

Excellent. Program text indentation should be easily preserved
with <pre> </pre> enclosures. You might also look into the info
system, which can prepare html, pdf, info, text and ps output from
common source. All open source.
 
R

Richard Heathfield

jacob said:
Look, I have taken the time to prepare:
ftp://ftp.cs.virginia.edu/pub/lcc-win32/tutorial.zip

That is kind of you. Thank you. I will return the favour by reading the darn
thing and giving you some feedback. :)

But PDF is a widely used format,

Oh, I know, I know. That doesn't mean it necessarily /should/ be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top