2010年7月31日土曜日

[CP:AMA] 7 Basic Types


  • 7.1 Integer Types
    I found no new knowledge.

  • 7.2 Floating Types
    In this book or by C's terminology, the `literals' are called `constants'.

  • 7.3 Character Types
    This section contains nothing new to me.

  • 7.4 Type Conversion
    Just only scanned.

  • 7.5 Type Definitions
    No new knowledge found.

  • 7.6 The sizeof Operator
    No new knowledge found.

  • Q & A
    Mmm, printf can't print the signed values when they are negative.


This chapter seems plane and gentle introduction to the C's type system.
But somewhat boring...

plodding away.

2010年7月24日土曜日

[CP:AMA] 6 LOOPS


  • 6.1 The while Statement
    No new knowledge found.

  • 6.2 The do Statement
    No new knowledge found.

  • 6.3 The for Statement
    I've never used comma expressions...
    "C places no restrictions on the three expressions that control its behavior. Although these expressions usually initialize, test, and update the same variable, there's no requirement that they be related in any way." This is impressive.

  • 6.4 Exiting from a Loop
    No new knowledge found.

  • 6.5 Null Statement
    No new knowledge found.

  • Q & A
    No new knowledge found.


still plodding away...

2010年7月19日月曜日

[CP:AMA] 5 Selection Statements


    Most of C's statements fall into three categories.

    • Selection statements
    • Iteration statements
    • Jump statements

    In another point of view, C's statements classified as below.

    • Single statement

      • Expression statement

    • Compound statement

    This chapter discusses the selection statements and the compound statement.

  • 5.1 Logical Expressions
    No new knowledge found.

  • 5.2 The if Statement
    `if' is a statement, and `? ... :' is an operator or a conditional expression. I see.

  • 5.3 The switch Statement
    No new knowledge found.

  • Q & A
    No new knowledge found.

plodding away.

2010年7月17日土曜日

[CP:AMA] 4 Expressions


    "One of C's distinguishing characteristics is its emphasis on expressions-" Mmm... distinguishing from what? Let's take a tiny survey.

    • Assembly Language: It doesn't seem to have expressions.
    • Fortran: sure. Fortran has expressions in its language specification, but its emphasis is on statements.

    So one can say `for those days that C had been developed C's emphasis on expressions, C's emphasis on expressions is its distinguishing characteristics, except for Lisp'.

  • 4.1 Arithmetic Operators
    No new knowledge found.

  • 4.2 Assignment Operators
    The explanation for side effects is great. I finally understand why the assignment in C is thought to have side effects; because it is an operator or isn't an statement.

  • 4.3 Increment and Decrement Operators
    No new knowledge found.

  • 4.4 Expression Evaluation
    No new knowledge found.

  • 4.5 Expression Statements
    `Expression Statements' is somewhat weird term, but its meaning is clear.
    "C has the unusual rule that any expression can be used as a statement."

  • Q & A
    No new knowledge found.


still plodding away.

2010年7月16日金曜日

[CP:AMA] 3 Formatted Input/Output

An ad hoc introduction to the I/O functions.

  • 3.1 The printf Function

    • "The information that follows the % character specifies how the value is converted from its internal form (binary) to printed form (characters)"; simple but impressive expression.

  • 3.2 The scanf Function

    • I see. scanf is a pattern-matcher.

  • Q & A
    no new knowledge found.


prodding away.

2010年7月11日日曜日

[CP:AMA] 2 C Fundamentals


  • 2.1 Writing a Simple Program
    `cc' of gNewSense.

    sh-3.2$ sudo /usr/sbin/update-alternatives --config cc
    [sudo] password for aka:

    There is only 1 program which provides cc
    (/usr/bin/gcc). Nothing to configure.
    sh-3.2$

  • 2.2 The General Form of a Simple Program

    Very plain and simple explanation about directives, functions and statements! Great!

  • 2.3 Comments
  • 2.4 Variables and Assignment

    • `Variable' is fascinating but troublesome term for beginners.
    • In this book, `variables' is explained as "In C, as in most programming languages, these storage locations are called variables.".
    • This statement seems to correct one as for the C standards. But the concept of variables in Common Lisp is more generalized one. For the present, I don't know the relation of these two concepts. Interesting topic for me.

  • 2.5 Reading Input

    No new knowledge for me found.

  • 2.6 Defining Names for Constants
  • 2.7 Identifiers

    I can't yet believe that beginners are able to understand and distinguish the terms such as names, identifiers, keywords, tokens and symbols at the very beginning of their study of programming languages. Especially the terminology of the C standards seems to have ambiguity in their ontology.

    As for myself, I've already learned Common Lisp, and I've accustomed with relationship of the concept of symbols and the concept of the reader and the evaluator, so I've some feeling like "Though I couldn't tell I really understand what the author wrote, perhaps, these are in the scope of what I've learned in Common Lisp. So move on!", when I've read these sections.

    It doesn't seem hygienic, but anyway, move on.

  • 2.8 Layout of a C Program
  • Q & A
    fun to read!


Still prodding away...

2010年7月6日火曜日

[CP:AMA] 1 Introducing C

Memos; write down interesting topics for myself.

  • 1.1 History of C
    "C99 isn't yet universal" is still true ? According to C99 on Wikipedia, even GCC is still not a compliant implementation. mmm...
  • 1.2 Strengths and Weaknesses of C
    For further reading, I've tried installing lint. But gNewSense seems not to contain it...

    sh-3.2$ aptitude search lint
    p dlint - Checks dns zone information using nameserv
    p fslint - A utility to fix problems with filesystems
    p jlint - A Java Program Checker
    p jlint-doc - Manual for jlint - a Java Program Checker
    p libflint-1.06 - C library for number theory, shared librar
    p libflint-dev - C library for number theory, development f
    p libhtml-lint-perl - Check for HTML errors in a string or file
    p libmarc-lint-perl - Perl extension for checking validity of MA
    p linklint - A fast link checker and web site maintenan
    i A lintian - Debian package checker
    p nslint - Lint for DNS files, checks integrity
    p pylint - python code static checker
    p splint - tool for statically checking C programs fo
    p splint-data - tool for statically checking C programs fo
    p splint-doc-html - tool for statically checking C programs fo
    v weblint -
    p weblint-perl - A syntax and minimal style checker for HTM
    i A xserver-xorg-video-glint - X.Org X server -- Glint display driver
    sh-3.2$

  • Q&A
    No new knowledge found.


Still plodding away.

2010年7月5日月曜日

[CP:AMA] PREFACE

自分なりのポイントをメモ。


  • "Complete coverage of both the C89 standard and the C99 standard."
  • "I've included more information about GCC..."
  • "New coverage of abstract data types" in C.
  • 498 Exercises!
  • "Avoid dependence on a particular machine, compiler, or operating system."
  • the undergraduate level.
  • "Be careful with a starred exercise: either pay close attention and think hard or skip it entirely."


こつこつ。

学習ブログ再開

Twitterを試してみたり、Wiki書いてみたり、業務繁忙だったりと、ずいぶん更新してなかった。

まとめWiki+学習ブログという組み合わせが結構いいかも、と再開してみる。

ただし、業務繁忙は相変わらずなので、超スロウペース。

スロウスタディみたいなものになるのかなぁ。

まずは、一度読んでみたかったK.N.KINGのC PROGRAMMING: A Modern Approachを勉強することにする。

こつこつ。