ときどきの雑記帖 未定編 2011年6月(中旬)


一つ前へ 2011年6月(上旬)
一つ後へ 2011年6月(下旬)





■_ .comb()


June 19 2011: Reading files :: Strangely Consistent

June 19 2011: Reading files

Tomorrow we'll be writing a game.


If split looks through a string for the things it wants to throw away, its cousin comb 
sifts through a string for the things it wants to keep:

#えーと、split は対象となる文字列中の切り取りたい部分に注目するのに対し、
#その親戚である comb は文字列中の残したい部分に注目する ってかんじ?

say join " ", "abc123def456".split(/\d+/);    # "abc def"

say join " ", "abc123def456".comb(/\d+/);     # "123 456"

A very useful special case of comb is when you want all the individual characters of a 

comb が非常に有用である special case は文字列の個々のキャラクターすべてを必要とする

say join " ", "Hello World".comb();           # "H e l l o   W o r l d"

Hang around for tomorrow's game. Because we're reading from file, the actual game is 
nice and short.


C Programming - Advanced Test : programming でだいぶ盛り上がってるんですが、結構昔のページなんですよねえ。 なんか見覚えがあるような気も。

Advanced Test in C

Advanced Test in C: The 0x10 Best Questions for C Programmers

This test was written by Ashok K. Pathak, a researcher at Bharat Electronics Limited (CRL), Ghaziabad.  Ashok has an M.E. from Motilal Nehru Reginal Engineering College, Allahabad, and is the author of a book titled “Advanced Test in C and Embedded System Programming”.

This test appeared as an article on programmersheaven.com.  It is reproduced here with modifications, which are as follows:

    * Javascript-based scoring and answer display functionality was added.
      Javascript を使った採点と解答の表示機能が追加されました。

    * Minor errors in questions 3, 13, and 14 are corrected.
      設問3、13、14 にあった細かなエラーは修正済みです。

    * All necessary headers are introduced with #include.
      必要なヘッダーはすべて #include で指定してあります、

    * Declarations of main are C99 compliant.
      main の宣言は C99 準拠になりました。

    * Data type sizes are supplied only where necessary (questions 9 and 14).

    * Questions 9, 10, and 12 have more convincing wrong choices.

    * Code spacing and indentation are more consistent.
      コードの spacing とインデントをより一貫性のあるものにしました。

    * Spacing of printf output has been corrected in a few places.

    * All code is syntax highlighted (TextPad-style).

    * Minor stylistic adjustments were made.

    * Answers are re-worded for clarity, accuracy, and completeness.

If you find any mistakes, please let me know:

— Steve Kobes, 8/25/04

Jump to question: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

1. Consider the following program:

#include <stdio.h>
#include <setjmp.h>

static jmp_buf buf;

int main(void)
   volatile int b = 3;

   if (setjmp(buf) != 0)
      printf("%d\n", b);
   b = 5;
   longjmp(buf, 1);

What is the output of this program?

(a) 3
(b) 5
(c) 0
(d) none of the above

Show answer


■_ Octal


整数定数の先頭に0をつけると8進数として扱われる……という仕様は使っていますか? - Yahoo!知恵袋





Copyright (C) 2011 Yahoo Japan Corporation. All Rights Reserved.

つ Python



■_ 時間切れ


Rants, Raves and Ridicule: A Generic Quicksort in Scala
A Generic Quicksort in Scala

So, I decided to create a quicksort algorithm in Scala that showcases how to write 
'generic' collection methods. That is, how can we write an external method that works 
across many types of collections *and* preserves the final type.

Well, here's how you do it:

Pen and paper

While tinkering with the Rubinius VM, I found it useful to have pen and paper around 
whenever I was coding. Given a set of VM instructions, I'd go instruction after 
instruction, drawing what the stack should look like at each step. I'd freak out at 
net stack underflow errors, try to follow along the instructions that were being 
executed, keeping track of the stack size and spotting that extra (or missing) pop. As 
a last resort, I'd also go crying in the #rubinius IRC channel on Freenode :)

Shed Skin - A (restricted) Python-to-C++ Compiler: Shed Skin 0.8, Programming Language Benchmark I'm happy to announce the release of Shed Skin 0.8, a (restricted-)Python-to-C++ compiler. It must be one of the best releases so far, with help and feedback from many directions.
Technical Discovery: Python Enhancement Proposals I Wish I Had Time to Champion
Python Enhancements I Want

・Adding additional operators

・Overloadable Boolean Operations

・Allowing slice object literals outside of []





正規表現 Part8 

192 デフォルトの名無しさん [sage] 2011/06/18(土) 19:08:41.62 ID: Be:
    Onigmo is a regular expressions library forked from Oniguruma.


k-takata/Onigmo - GitHub


README  2011/06/11

Onigmo (Oniguruma-mod)  --  (C) K.Takata <kentkt AT csc DOT jp>


Onigmo is a regular expressions library forked from Oniguruma.
Some of new features introduced in Perl 5.10+ can be used.

Some patches are merged from Ruby 1.9.2.

Oniguruma's README follows:

Onigmo というのは O N I G のあとに何か続く名前ということで決めたのだろうか? Oniguruma-mod … でもないかな?

■_ じゃんくしょん

Perl 6 で一番好きな機能を挙げろといわれたらこれかなあ(Rulesも捨てがたいけど)。

June 18 2011: Junctions :: Strangely Consistent

June 18 2011: Junctions

We've seen junctions a bit already. They showed up as a sidekick to the slightly 
longer logical operators:

if $answer == 1 || $answer == 3 { ... }

if $answer == 1 | 3 { ... }               # same thing

There's a third way to write it too, and that's by using a function form:

if $answer == any(1, 3) { ... }


Just to have this said: it's common for people to look at junctions, think they're 
really cool, and then expect them to do the following:

ジャンクションを見た人はたいていそれが cool な機能であると考えて、さらに次のような

if any(@contestants).won {
    # do something with the winner

But we can't. Junctions answer questions like "does any of these..." or 
"do all of these..."; they don't pick out the things that match or fail to 
match and hand them back to you. Their purpose is to treat several things as a unit. 
If you find you wanted to tease out values of that unit, what you wanted was probably 
something more like this:

"does any of these..." や "do all of these..." のような
しないのです。ジャンクションの目的はいくつかのことがらをひとつの unit のように扱う
ことです。もし、条件にかなった unit の値を tease out したいのであれば、あなたが

my $winner = @contestants.first({ .won });

if $winner {
    # do something with $winner

And with that, we're all set. See you tomorrow with more blogging.

■_ たくさん


Implementations / Perl 6


There is no official or reference Perl 6 implementation, as exists with Perl 5. Instead, there
is a language specification that began with Apocalypses and evolved through Exegeses and
Synopses. (略) This page is about the various partial implementations that exist, which can
parse and execute Perl 6. Virtual machines and runloops are excluded because they do not deal
with Perl 6 source code.

Perl 5 にはあった、公式なあるいは参照実装としての Perl 6 の実装というものはありません。
その代わり、Apocalypses に始まり、Exegeses や Synopses と続いた言語仕様があります。
このページでは現状で Perl 6 の構文解析や実行ができる various partial implementation
について説明します。仮想マシンや runloops は Perl 6 で書かれたソースコードを

    * Rakudo is currently the most feature-rich and most actively developed implementation. It
      runs on Parrot, a virtual machine for many dynamic languages.

    * Niecza is currently the fastest implementation, the active development is lead by
      Stefan O'Rear.

    * Pugs was the leading implementation from 2005 until about 2007. It runs on GHC Haskell
      and helped to develop the test suite.

    * viv is a derivation of STD.pm for testing and bootstrapping purposes. A utility called
      "gimme5" creates viv by translating STD.pm into Perl 5. This is possible
      because Larry very carefully wrote STD.pm in a translatable subset of Perl 6.

    * Mildew is a Perl 5 based compiler that embeds viv, and can emit code for several runtime
      engines, including JavaScript and SMOP.

    * Sprixel started out with viv as the source code parser and Google's V8 JavaScript engine
      as a runtime interpreter. Currently Sprixel is undergoing a complete rewrite. The new
      version is being in C# and will probably run on both Mono and the .NET Framework. It
      will include its own regex engine and Perl 6 grammar parser.

    * Elf is a compiler written in Perl 6 with Perl 5 and Lisp backends.

    * vill connects STD.pm to the LLVM (Low Level Virtual Machine) compiler tools.

    * Perlito, formerly known as MP6 (mini Perl 6), is a Perl 6 subset build by Flavio Glock
      for bootstrap purposes.

    * KindaPerl6 (kp6)

    * v6 is a Perl 6 compiler for Perl 5.

Historical Implementations are definitely closed projects.


Historical Implementations / Perl 6

Historical Implementations


Topaz was Chip Salzenberg's attempt to reimplement Perl 5 in C++ in the late 1990s. Topaz was
abandoned after the Coffee Mug Incident.


Simon Cozens tested around 2000 how to reimplement Perl.


(Perl (5) On New Interpreter Engine) had aimed to implement the Perl 5 language on Parrot. It
was developed 2003-2006 by Arthur Bergman and Nicholas Clark. Ponie had the potential to
integrate Perl 6 and Perl 5 code in the same process. That would have been useful for
language bootstrap purposes, and also to make lots of the Perl 5 based CPAN libraries
available to Perl 6 users. Some thought at one point even it might become Perl 5.10.. It was
discontinued because emulating all of the idiosyncracies of Perl 5 was daunting, and the
developers were presumably daunted.

Topaz と Ponie は記憶にあった。Ponie は書かれているように Perl 5 を実装するものだけど。



A間さんの本は二度と買わないと思ってましたが、またつつきたくなるような話が (んな時間的金銭的余裕があるかというと…)。









他人様のblog の、それもコメントをきっかけに書くのもどうかなあとか思って 自重してみたり。


例によって reddit 経由で。 Advice from an old programmer : programming

Advice From An Old Programmer — Learn Python The Hard Way, 2nd Edition

Advice From An Old Programmer¶

You have finished this book and have decided to continue with programming. Maybe it 
will be a career for you, or maybe it will be a hobby. You will need some advice to 
make sure you continue on the right path, and get the most enjoyment out of your newly 
chosen hobby.


To this I have one just piece of advice: they can go to hell. The world needs more 
weird people who know how things work and who love to figure it all out. When they 
treat you like this, just remember that this is your journey, not theirs. Being 
different is not a crime, and people who tell you it is are just jealous that you have 
picked up a skill they never in their wildest dreams could acquire.

You can code. They cannot. That is pretty damn cool.

© Copyright 2010, Zed A. Shaw. Last updated on Jun 17, 2011. Created using Sphinx 1.0.7.

あ、Zed。でも Copyright 2010 と思ったら

Advice from an old programmer : programming

This is an inspiring post. I blogged on this about an year ago, surprisingly with the 
same title :D



■_ final β

正規表現の文字クラスの実装方針がいろいろ揺れてるみたいです (locale にどう対応するかとか)。

[bug-gawk] Final gawk 4.0 beta test tar ball now available

From:  Aharon Robbins
Subject:[bug-gawk] Final gawk 4.0 beta test tar ball now available
Date: 	Fri, 17 Jun 2011 11:16:38 +0300

Hi All.


The primary change here is the implementation of Rational Range
Interpretation and documentation thereof.

Please try this out.  I would like to make the real release next week sometime.

AS ALWAYS:  *P*L*E*A*S*E* report bugs to `bug-gawk AT gnu.org'; it's ok to
post here too, but at least CC the bug address so that I see the mail.





■_ partial matching

正規表現 Part8 
180 デフォルトの名無しさん [] 2011/06/17(金) 01:19:28.83 ID: Be:

181 デフォルトの名無しさん [sage] 2011/06/17(金) 05:08:04.43 ID: Be:
    > もうちょっと食わせれば完全にマッチする

182 デフォルトの名無しさん [sage] 2011/06/17(金) 07:06:16.71 ID: Be:
    java.util.regex.MatcherのhitEnd(), requireEnd()とか、PCREのpartial matchingとか? 

お、PCREにそんな機能あったんだ。 一時期 GNU sed で使われた Rx ってライブラリにもあったけど ライブラリ自体がほっぽり出されたからなあ。









InfoQ: Visual Studioヘルプファイルのパッケージング InfoQ: REST APIの良い、悪い、醜い

■_ JavaCC


void ExternalDeclaration() : {}
	( LOOKAHEAD( FunctionDefinition() ) FunctionDefinition() | Declaration())

void FunctionDefinition() : {}
	[LOOKAHEAD(DeclarationSpecifiers()) DeclarationSpecifiers()] Declarator() [ DeclarationList() ]

LOOKAHEAD の引数(?)って、関数の戻り値みたいんで指定できるのね。 あれ、でも↑ だと void だ。

■_ pure

D はよくわからん。

Implementing Pure Functions | Dr Dobb's Journal

A while back, I wrote an article explaining how the D programming language's 
"pure" annotation could be applied to functions. A pure function does what 
you'd expect — the compiler enforces purity of the function. The function may not have 
any side effects, may not rely on any mutable data, and is statically checkable.


import std.stdio;

pure int square(int x)
    writefln("square(%d)", x);
    return x * x;

これは writeln が「不純」なので square も「純粋」にはなれず

import std.stdio;

int square_debug(int x)
    writefln("square(%d)", x);
    return x * x;

pure alias int function(int) fp_t;

pure int square(int x)
    auto fp = cast(fp_t)&square_debug;
    return (*fp)(x);


import std.stdio;

pure int square(int x)
    debug writefln("square(%d)", x);
    return x * x;

debug などというものを持ち出してきて「解決」…でいいのかな?


■_ Objective-C Blocks vs. C++0x Lambdas: Fight!

#3 まだ終わってねえ

意図的に日本語にしていない部分があります(しっくりする表現が思いつかなかったとか)。 そゆことで。

mikeash.com: Friday Q&A 2011-06-03: Objective-C Blocks vs. C++0x Lambdas: Fight!

Friday Q&A 2011-06-03: Objective-C Blocks vs. C++0x Lambdas: Fight!

Blocks are perhaps the most significant new language feature introduced by Apple in 
years, and I've written a lot about them before. The new C++ standard, C++0x, 
introduces lambdas, a similar feature. Today, I want to discuss the two features and 
how they are alike and how they differ, a topic suggested by David Dunham.

ブロックはおそらく、ここ数年のうちに Appleによって導入された最も significant な新しい言語
機能です。これについては以前に多くのことを書いています。C++ の新標準 C++0x では類似の機能
である lambad を導入しました。今日は、これら二つの機能であるとかどれだけ似たものであるのか
トピックは David Dunham が提案したものです。


I will refer to Apple's blocks extension as "Objective-C blocks" even though 
this is not entirely correct. They are actually an addition to C (and can even be used 
in C++), with some extra behaviors to make them more useful in Objective-C. However, 
they are deeply intertwined with Objective-C in their implementation, and "C 
blocks" is vague, so I think that "Objective-C blocks" is the best way 
to refer to them here.

正確ではない部分もありますが、ここでは Apple のブロック拡張を“Objective-C のブロック”と見な
します。実際にはこれは Objective-C において自身を一層有用にさせるちょっとした追加機能 (some 
extra behaviors) を持っている C に対する (C++でも使用可能な) 追加です。
しかし、その実装においてブロックは Objective-C と深く結びついているので、
“C のブロック”というのは vague (あいまい、ぼんやりとした) です。
ですからわたしは、ここでは "Objective-C のブロック" とするのがブロックを表す

C++0x lambdas are part of C++ only and can't be used from C. Presumably they can be 
used in Objective-C++ if the compiler supports C++0x.

C++0x の lambda は C++ のみの一部であり、C から使うことはできません。
Presumably they can be used in Objective-C++ if the compiler supports C++0x.

For a generic term to refer to both Objective-C blocks and C++0x lambdas, I will use 
"anonymous function".

Objective-C のブロックとC++0xのlambda を指す一般的な用語として、
“無名関数”("anonymous function") を使うことにします。


Both Objective-C blocks and C++0x lambdas have the same basic goal: to allow writing 
anonymous inline functions. Called closures, blocks, lambdas, or just anonymous 
functions, these are a common feature in higher level languages. They are extremely 
useful for building convenient, succint libraries for things like array iteration, 
multithreading, delayed computation, and many others.

Objective-C のブロック、C++0xのlambdaの両方とも同一の basic goal を持っています:
無名のインライン関数 (anonymous inline functions)を書くことを可能にする
より高水準の言語 (higher level languages) においては一般的な機能です。

As lower level languages, C and C++ had no concept of anonymous functions. To add them, 
new syntax had to be created. Because of this, Objective-C blocks and C++0x lambdas 
ended up with somewhat different syntax. An empty Objective-C block looks like this:

比較的低水準の言語である C や C++ は無名関数というコンセプトを持っていませんでした。
このために、Objective-C のブロックと C++0x の lambda は異なる構文となってしまいました。
空の Objective-C ブロックは次のような外見です:


Whereas an empty C++0x lambda looks like this:


So far not much different. They both use the standard C {} symbols to separate a block 
of code, with a special symbol to indicate that this is a block or lambda, not a 
normal C block. In both cases, the {} section takes normal code.

それほど違いはありません。両者ともコードのブロックを分けるために標準の C の {} シンボ
ルを使っていて、さらに通常のブロックではなくブロックや lambda であることを示す特殊なシ
ンボルを伴っています。そしてどちらの場合も {} セクションは通常のコードを取ります。

The anonymous function can take arguments by writing them in parentheses, in the style 
of function arguments, after the leading bit:

leading bit の後に関数形式でカッコの中に引数を書くことにより無名関数は引数を取れます:

    ^(int x, NSString *y){} // ObjC, take int and NSString*
    [](int x, std::string y){} // C++, take int and std::string

In both languages, a value can be returned, and the return type can be inferred from 
the return statement:

その戻り値の型は return 文から推測可能です:

    ^{ return 42; } // ObjC, returns int
    []{ return 42; } // C++, returns int

Here, the two features begin to diverge. With C++0x lambdas, the return type can only 
be inferred if the lambda contains a single statement, and that statement is a return 
statement. So while the above is valid, this is not:

ここから二つの機能の diverge が始まります。
C++0x の lambda ではそれがただ一つの文からなっているときにのみ
戻り値の型の推測が可能で、さらにその文は return 文でなければなりません。
ですから、上の例は vaild なものですが、次の例は違います:

    []{ if(something) return 42; else return 43; }

In a more complicated lambda with an inferred return type, the return type is always 
inferred to be void. The code above will therefore produce an error, because it's 
invalid to return 42 from something with a return type of void.

inferred return type を持ったもっと複雑な lambda ではその戻り値の型は常に void である
と推測されます。戻り値の型が void であるなにかが 42 を返すことは invalid なので上記の

In contrast, Objective-C blocks do return type inference no matter how complicated the 
code is inside of the block. If no return statements are present, the type is inferred 
as void. Otherwise, it examines all of the return statements in the block. If they all 
return the same type, then the return type of the block is inferred to be that same 
type. If they conflict, an error is generated. Thus, the equivalent Objective-C 
example to the invalid C++0x lambda example works fine:

対照的に、Objective-C のブロックはその内部にあるコードがどれほど複雑であるかは関係なく
戻り値型の推測を行います。もし return 文がブロックになければ、そのブロックの型は void 
と推測されます。衝突があった場合にはエラーが発生します。したがって、先の C++0x lambda 
の invalid な例と等価な Objective-C での例は正しく動作します:

    ^{ if(something) return 42; else return 43; }

Both features also allow the explicit declaration of a return type. This is essential 
with C++0x lambdas, where it's the only way to have a complicated lambda return a 
value. It's merely a convenience in Objective-C, but often useful to avoid having to 
cast in return statements.

どちらの機能も戻り値の型の explicit な宣言が可能です。これは C++0x lambda の essential 
で、ある値を返す複雑な lambda を持つための唯一の方法です。これは Objective-C では単に 
covenience にすぎませんが、return 文の cast を取り除くのにしばしば有用です。

With Objective-C blocks, the return type is declared immediately after the ^. In C++0x, 
the return type is declared by placing ->type after the lambda's argument list. 
Here are those two examples with explicit return types, which allows it to work in 
both languages:

Objective-C のブロックでは戻り値の型は ^ の直後で宣言されます。
C++0x では lambda の引数リストの直後に -> を置くことで戻り値の型が宣言されます。
ここで、それぞれの言語で動作する explicit な return typeを持った

    []()->int { if(something) return 42; else return 43; }
    ^int { if(something) return 42; else return 43; }

Note that an arguments declaration is required for C++0x lambdas, although it can be 
empty, if an explicit return type is declared. Objective-C blocks can declare either a 
return type or an argument list separately, or have both together. For completeness, 
here is the same example with an argument list:

戻り値の型を explicit に宣言している場合には、引数がなかったとしても引数宣言が必須であること
に注意してください。Objective-C のブロックでは戻り値の型や引数リストを分割してもまとめても宣
For completeness, 引数リストを持った例を挙げます:

    ^int (void) { if(something) return 42; else return 43; }

Finally, both Objective-C blocks and C++0x lambdas are called in the same way: use the 
standard () operator on an expression of the appropriate type. Pass arguments if they 
are required. This calls the anonymous function.

Objective-C のブロックと C++0x の lambda はどちらも same way で呼び出されます:
適切な型の式に対して標準の () 演算子を使います。


Objective-C blocks introduce a new class of language-level types to represent block 
types. They match the standard (but tricky) syntax for C function pointer types, but 
with a ^ in place of the *:

Objective-C のブロックではブロック型を表現するために言語レベルの型として新しいクラスを導入しました。
それは (トリッキーではあるものの) C の関数ポインター型を表す標準の構文とマッチするものですが、
* が ^ で置き換っています:

    void (*)(int) // function pointer taking int and returning void
    void (^)(int) // block taking int and returning void

These types can be used for function/method parameters, return types, local variables, 
instance variables, etc.


C++0x takes a completely different approach. Lambdas have a unique anonymous type 
which implements operator(). In other words, you can call it, but otherwise you don't 
have an accessible type the way Objective-C blocks do. In order to store them in 
variables, pass them to functions, or return them from functions, C++ templates or the 
C++0x auto keyword (which infers the type of a variable from the type of its 
initializer) must be used.

C++0x は全く異なるアプローチを採用しました。
lambda は operator() を実装している unique な無名型を持ちます。
Objective-C のブロックのような accessible type をあなたは持っていません。
lambda を変数に格納したり、関数に渡したり、あるいは関数から返すためには
C++ のテンプレートもしくは C++0x の予約語 auto 
(変数の型をその initializer の型から推測します) 

Captured Variables

One of the most significant features of these anonymous functions is the ability to 
capture variables from the enclosing scope. For example:

これら無名関数の最も significant な機能の一つが
無名関数を囲むスコープにある変数を捕獲する能力 (ability) です。

    int x = 42;
    void (^block)(void) = ^{ printf("%d\n", x); };
    block(); // prints 42

The two constructs handle variable capture significantly differently, so I'll take 
them one at a time.

二つの constructs の handle variable capture は
significantly differently なので、一つずつ説明します。

Objective-C blocks can capture variables from the enclosing scope by simply referring 
to them within the block, as seen above. By default, all captured variables are copied 
at the point where the block is created and cannot be modified from within the block.

これまで見てきたように、Objective-C のブロックはそのブロックを囲むスコープの中で

If a block captures another block variable, that block's memory is automatically 
managed. It's copied and released as necessary. Objective-C object pointers are also 
automatically managed by retaining and releasing them as necessary. This deep, 
implicit integration with Objective-C memory management makes a lot of tasks 
significantly easier, because most of the time blocks automatically do the right thing 
with the variables they capture.

あるブロックが別のブロックの変数を capture したときそのブロックのメモリーは自動的に管理されます。
Objective-C のオブジェクトポインターもまた、必要に応じて retain と release をすることで
自動的に管理されます。この deep な implicit integration with Objective-C のメモリ管理は
多くのタスクを significantly に簡単にします。

For cases where the block needs to be able to modify a captured variable, the variable 
must be declared with the special__block qualifier to mark it as being mutable:

その変数が mutableであることを示すために
特別な __block qualifier をつけて宣言しなければなりません

    __block int x = 42;
    void (^block)(void) = ^{ x = 43; };
    block(); // x is now 43

It is important to note that the automatic memory management of block and object 
pointers does not occur for variables qualified with __block, so the programmer needs 
to make sure that everything is built to tolerate that. For primitives like x above, 
there is no concern.

ブロックやオブジェクトポインターの自動メモリ管理は __block で修飾された変数に対しては行われない
ことに注意を払うことは重要で、プログラマーはすべてが built to tolerate that であることを
make sure する必要があります。
上記の例の x のようなプリミティブに対しては concern はありません。

It should come as no surprise that C++0x lambdas offer considerably greater 
flexibility but also considerably greater complication in this area. The overall 
philosophy of C++ appears to be to give the programmer as many tools and choices as 
possible, which has its pros and cons.

C++0x の lambda が consideably  greater flexibility だけではなく
considerably greater complication in this area も offer していることは should come as no surprise。
(長所も短所も含めて) 可能な限り多くのツールと選択肢をプログラマーに与えるために
The overall philosophy of C++ は appears しています。

The initial [] which begins a C++0x lambda controls how local variables are captured. 
If it's left empty like that, then no variables can be captured at all. In order to 
capture variables, it's necessary to tell the compiler what you want to do.

C++0x の lambda の頭にある [] はローカル変数がどのように捕獲されるのかを control します。
[] が空のままであれば捕獲できる変数はありません。

The most explicit way to do this is to list the variables to be captured inside the []. 
Any variable listed directly by name is captured by value. Any variable listed with a 
leading & is captured by reference. For example:

これを行う最も explicitなやり方は []の内側に捕獲する変数を列挙することです。by name で
列挙されたすべての変数は by value で捕獲されますが、& が前置された変数は by reference

    int x = 42;
    int y = 99;
    auto lambda = [x, &y]{ y = 100; };
    lambda(); // y is now 100

It's not possible to modify x in this case, as a lambda's operator() is const by 
default. However, this can be overridden by declaring it to be mutable:

この場合 x を変更することはできません。
lambda の operator() がデフォルトで const であるので
しかし、mutalbe であると宣言することでこれを上書きできます:

    int x = 42;
    int y = 99;
    auto lambda = [x, &y]() mutable {
        x++, y++;
        printf("%d, %d\n", x, y);
    lambda(); // prints 43, 100
    printf("%d, %d\n", x, y); // prints 42, 100
    lambda(); // prints 44, 101!

Because x is captured by value, changes made from within the lambda are not seen 
outside of it. There are essentially two copies of x at this point, and neither one 
affects the other.

x は by value で捕獲されているので、lambda の内側でなされた変更は lambda の外側には及びません。
本質的にはこの時点で x の実体が二つ存在していて、

It can be inconvenient to list every variable to be captured, so it is possible to 
specify a default capture behavior by putting either = or & within the []. For 

捕獲するためにすべての変数を列挙するのは不便ですが、[] の中に = か &を置くことに

    int x = 42;
    int y = 99;
    auto lambda = [&] {
        x++, y++;
    lambda(); // x, y are now 43, 100

It's even possible to combine the two, to have a default capture with exceptions:


    int x = 42;
    int y = 99;
    int z = 1001;
    auto lambda = [=, &z] {
        // can't modify x or y here, but we can read them
        // ここでは x と y は変更できない。読むことはできる。
        printf("%d, %d, %d\n", x, y, z);
    lambda(); // prints 42, 99, 1002
    // z is now 1002

By allowing each lambda to specify how it captures things, the C++0x system allows 
more flexibility. With Objective-C blocks, a given variable is either __block or it's 
not. Every block which captures that variable must capture it in the same way. C++0x 
lambdas allow each lambda to make its own choice on how to capture. The mutable 
keyword even allows them to capture by value but retain the ability to change the 
copied value internally. The downside is considerably increased complexity.

それぞれの lambda でどのように捕獲を行うかを指定できるようにすることで、C++0x のシステ
ムはより柔軟性を持ったものになります。Objective-C のブロックでは、与えられた変数は 
__block かそうでないかのいずれかです。そのような変数を捕獲しているすべてのブロックは同
様のやり方でもって該当する変数を捕獲しなければなりません。C++0x の lambda では各 
lambda がそれぞれ自分がどのように捕獲するかを選択できるようにしています。予約語 
mutable は by value での捕獲を可能にしますが、内部的にコピーした値を変更する能力 
(ability) を retain します。この downside は considerably に複雑さを増加させます。

Memory Management

Both Objective-C blocks and C++0x lambdas start their lives as stack objects. After 
that point, however, they diverge significantly.

Objective-C のブロックとC++0xの lambda の両方ともスタックオブジェクトとしてその生涯が
始まります。しかしある時点で、それらは significantly に diverge します。

Objective-C blocks are also Objective-C objects. Like all Objective-C objects, they 
are stored by reference, never by value. When a block literal is written, the block 
object is created on the stack, and the literal expression evaluates to the address of 
that block.

Objective-C のブロックは Objective-C のオブジェクトでもあります。すべての Objective-C 
オブジェクトと同様にブロックは by reference で格納され、by value で格納されることは決
evaluates to the address of that block.

In order for a block to outlive its slot on the stack, it must be copied. Because the 
value is just a reference, simply assigning it with = is not enough:

あるブロックが outlive its slot on the stack するためにはコピーされなければなりません。
スタック上に置かれているのは単なる reference なので、
= を使った単純な代入では不十分です:

    void (^block)(void);
        block = ^{ printf("hello world"); };
    block(); // bad!

Instead, it must be copied, either by using the Objective-C copy method, or the C 
Block_copy function:

単純な代入ではなしに、Objective-C の copy メソッドか C の Block_copy 関数を使うかして

    void (^block)(void);
        block = ^{ printf("hello world"); };
        block = [block copy];
    block(); // good!

Blocks follow standard Objective-C reference counting semantics. Each copy must be 
balanced with a release or autorelease, and each Block_copy must be balanced with a 
Block_release. The first copy gets the block onto the heap, subsequent ones simply 
increment the reference count. When the last live reference is released, the block is 
destroyed, and any captured objects or blocks are released.

ブロックは Objecive-C の標準である参照カウント方式のセマンティクスに従います。それぞれ
のコピーは release か autorelease を使ってバランスさせなければいけませんし、Block_copy 
はそれぞれが Block_relase とバランスしていなければなりません。最初のコピーはブロックを

C++0x lambdas are stored by value, not by reference. They can be copied onto the heap 
if needed, but the process is entirely manual. All captured variables are stored as 
member variables within the anonymous lambda object, so when the lambda is copied, 
those get copied as well, firing the appropriate constructors and destructors.

C++0x の lambda は by reference ではなく by value で格納されます。必要があればヒープに
コピーできますが、そのための手続きは完全に手作業です。すべての捕獲変数は無名 lambda オ
ブジェクト内にメンバー変数として格納されます。そのため、lambda がコピーされたときには

One extremely important aspect of this behavior is that variables which are captured 
by reference are stored as references within the lambda object. They get no special 
treatment in this respect. This means that a lambda which accesses one of those 
variables after the original enclosing scope has been destroyed is engaging in 
undefined behavior and will likely crash. Compare this to __block variables, where the 
storage is transparently moved to the heap and is guaranteed to live at least as long 
as the block does.

この動作のひとつの extremely important な aspect は、by reference で捕獲された変数が 
lambda オブジェクトの中で reference として格納されるということです。それらの変数は 
this respect において 特別な扱いを受けません。これはつまり、original enclosing scope 
が破棄された後でそういった変数のどれか一つにでもアクセスする lambda は未定義動作を 
engaging してたぶんクラッシュするだろうということです。これを __block 変数と比較すると、
storage の場所がヒープへと transparently に move し、少なくともブロックと同じ長さの寿
命が gurantee されます。

On the other hand, as long as nothing is captured by reference, a C++0x lambda can be 
returned without any extra work. The return will copy it and the copy will continue to 
function. With Objective-C blocks, they must be explicitly copied before returning, 
otherwise they become immediately invalid.

その一方で、 by reference で捕獲されていないので C++0x の lambda は一切 extra work 
をすることなく return できます。
The return will copy it and the copy will continue to function. 
Objective-C のブロックの場合は return する前に explicitly にコピーしなければならず、
さもなければ即座に invalid なものになってしまいます。


Objective-C blocks are objects which contain an embedded function pointer. A block 
call translates to a call to that function pointer, passing the block as an implicit 

Objective-C のブロックは埋め込まれた関数ポインターを持っているオブジェクトです。

    // equivalent to:

The cost of calling a block is therefore about the same as the cost of calling a C 
function. It's slightly higher due to the need to look up the implementation pointer 
first, but just slightly.

ブロック呼び出しのコストはしたがって、 C の関数呼び出しのコストと概ね同じものです。
最初に implementation pointer の look up が必要である分、

Opportunities for optimization are rare in most use cases. For example, this code 
calls a method to iterate over an array with a block:

例として、次のようなブロック中にある配列を iterate over するメソッドを呼び出すコードを挙げます:

    [array do: ^(id obj) {
        NSLog(@"Obj is %@", obj);

The implementation of -do: can't know anything about the block which is passed to it 
here, so it must perform the full dereference and call for each iteration of the loop.

この例の -do: の実装は渡されたブロックについて何も知ることができないので、
ループの iteration ごとに full dereference と呼び出しを行わなければなりません。

The cases where blocks can be optimized are mostly cases where they're not needed in 
the first place, for example where they are defined and then called in the same scope. 
One place where useful optimizations could be made are inline functions which take 
block parameters, since the optimizer is able to improve the inlined code based on the 
calling code. However, as far as I know, no current blocks-capable compilers perform 
any of these optimizations, although I haven't investigated it thoroughly.

ブロックが最適化可能であるようなケースは、たいていはそのブロックが in the first place 
です。useful な最適化が可能であるかもしれない場所の一つがブロックパラメーターを引数に
とるインライン関数です。それは、オプティマイザーが calling code に基づいてinline され
although I haven't investigated it thoroughly.
このような最適化の何かを行う block-capable なコンパイラーは現状でありません。

C++0x lambdas are objects with a operator(). There is no dynamic dispatch involved, so 
calling the lambda works out to be a simple function call, with no dereferencing ahead 
of time.

C++0x のlambda は operator() を持ったオブジェクトです。
これは動的ディスパッチが involve されないので、lambda の呼び出しは単純な関数呼び出しとして
dereferene の ahead of time もなく works out します

Because passing a lambda to another function involves templates, there are further 
opportunities for optimization. Consider this code to iterate over a vector:

別の関数に lambda を渡すことによって template を invlove するので、
あるベクターを iterate する次のコードで考えてみましょう:

    for_each(v.begin(), v.end(), [](int x) {
        printf("x is %d\n", x);

for_each is a template function, which means that it gets specialized for this 
particular type. This makes it an excellent candidate for inlining, and it's likely 
that an optimizing compiler will end up generating code for the above which would be 
just as good as the equivalent for loop.

この for_each は特定の型に対して特殊化されたテンプレート関数です。
This makes it an excellent candidate for inlining, 
インライン展開の excellent candidate にする
and it's likely 
that an optimizing compiler will end up generating code for the above 
which would be just as good as the equivalent for loop.
最適化コンパイラーが最終的に for ループと同程度に優れているであろうコードを生成する

This is a typical tradeoff between C++ and Objective-C. C++ often favors the fastest 
possible generated code at the level of individual functions, sacrificing ease and 
speed of compilation and sometimes ease of programming to get it. Objective-C more 
often favors implementations which are simpler to create, compile, and use, at the 
cost of additional runtime overhead.

これは C++ と Objecive-C との間にある典型的なトレードオフです。
C++ はしばしば ease and speed of compilation だとか、
ときには ease of programming to get it まで犠牲にしても
可能な限り高速な生成コードを favor します。
Objective-C は additional runtime overhead のコストの点で、
作成やコンパイル、あるいは使うのがシンプルである実装をより一層 favor します


Objective-C blocks and C++0x lambdas are similar language features with similar goals 
but considerably different approaches. Objective-C blocks are somewhat simpler to 
write and to use, especially in the case of using them for asynchronous or background 
tasks where the block has to be copied and kept alive beyond the lifetime of the scope 
where it was created. C++0x lambdas ultimately provide more flexibility and potential 
speed, but at the cost of considerable added complexity. In comparing the two, I 
believe that Apple ultimately made the better set of tradeoffs, at least for the cases 
where I am likely to use blocks in my own programming.

Objectice-C のブロックと C++0x の lambda は、似通った目標を持っているけれども異なるア
プローチを採用している類似の言語機能です。Objective-C のブロックは書いたり使ったりする
のが簡単な、somewhat で、特にブロックがコピーされなければならなかったり、また、作られ
たスコープの lifetime を越えて keep alive されなければならない非同期なタスクやバックグ
ラウンドタスクに使うようなケースで使われるものです。C++0x の lambda は
more flexibility と potential speed を  ultimately に provide しますが、
cost of considerable な complexity を付加します。
Apple は、最終的に better set of tradeoff を made するとわたしは確信していします。

That wraps things up for this week. Come back in another 14 days for the next baffling 
edition. As I say every time, Friday Q&A is driven by reader ideas. If you have a 
topic that you would like to see covered here, please send it in. Did you enjoy this 
article? I'm selling a whole book full of them. It's available for iBooks and Kindle, 
plus a direct download in PDF and ePub format. It's also available in paper for the 
old-fashioned. Click here for more information.

When not writing these blog posts, I put this stuff into action over at Rogue Amoeba, 
where we create great audio software for the Mac.





金が出ればやる気が出るとは限らないが、金が出なければやる気も出ない。 てなもんで。

■_ An open letter to those who want to start programming


An open letter to those who want to start programming - Solace In Random Lines

An open letter to those who want to start programming

First off, welcome to the fraternity. There aren't too many people who want to create 
stuff and solve problems. You are a hacker. You are one of those who wants to do 
something interesting.

    “When you don't create things, you become defined by your tastes rather than ability."

    – WhyTheLuckyStiff

Take the words below with a pinch of salt. All these come from me – a bag-and-tag 
programmer. I love to get things working, rather than sit at something and 
over-optimize it.

Start creating something just for fun. That's a great start! There's no way you will 
start if you say you “need to learn before doing”. Everybody's got to start 
somewhere. Fire up your editor and start writing code.

Choose a good language. One that you think you can produce something useful in short time.

So let C not be your first language. That might give you the satisfaction of doing 
things the really old-n-geeky way. C was the solution to the problem Assembly Language 
was. It offers better syntactic sugar than it's prominent predecessor – Assemble 
Language. But today, C (or C++) is not a language that you can produce something very 
quickly. I would suggest that you use a dynamic language – I won't sideline any 
options. Choose a language whose syntax (and documentation) you think you might be 
comfortable with. For this, you might want to spend some time trying out different 
languages for a few hours. The purpose of choosing such a language is not to make you 
feel better and that programming is easy. Completing stuff faster and being able to 
see the output keeps you motivated. Don't choose a language that requires a special 
heavy-weight IDE (tool that helps you write code and run it) to program better in the 
language. All you should need is a text editor.

ですから、最初の言語として C を選んではいけません。
C を選ぶことで、古き良きギーク流のことをしているという満足が得られるかもしれません。
C はアセンブリ言語が解決しようとしてた問題を解決したものでした。
C はそれ以前のもの、つまりアセンブリ言語よりもまともな構文糖 (syntactic sugar) を
もたらしました。しかし今日にあっては、C (や C++) はあなたがすばやく何かを作れる

あなたが comfortable であると思うような構文(とドキュメント)を備えた言語を選びましょう。

Choose a good editor.

Use an operating system that'll teach you something.

Don't copy-paste files to backup stuff.

Know where to get help.

Develop your netiquette.

Write opensource code.


Scala: The Static Language that Feels Dynamic への反応?

Whiley | Language Complexity?

Language Complexity?
By Dave, on June 13th, 2011

Some languages are complex, others are simple … right?  C++ versus just about 
anything else is a good example here.  But, it begs the question: what makes a 
language complex?

C++ とそのほかの言語というのはその良い例です。しかし、ひとつの質問が浮かび上がります。

So, I've just been reading Bruce Eckel's Artima article on Scala.  It's actually a 
nice article, and I enjoyed it.  But, one thing bugged me — and, it's nicely 
summarised in this quote:

そこでわたしは Bruce Eckel の Scala についての Artima article を読みました。
それはとてもすばらしい atricle で、楽しめるものでした。
けれどもひとつのことがわたしを bugged させました。

    But you can see from the code above that learning Scala should be a lot easier than
    learning Java! There's none of the horrible Java ceremony necessary just to write
    “Hello, world!” — in Scala you can actually create a one-line script …

    認識できるでしょう! Scala ではただ単に "Hello, world!"を書くためだけに Java では必須の







Amazon.co.jp: Scala実践プログラミング―オープンソース徹底活用: 小笠原 啓: 本 がないかと秋葉原のあそことあそこに行ってみたけどまだ(?)なかった。 Amazon.co.jp: Scheme修行: Daniel P. Friedman and Matthias Felleisen, 元吉 文男, 横山 晶一: 本 はたくさんあった。

Scala 本では Amazon.co.jp: Scalaではじめるプログラミング―「Java」「.NET」のソフト資産を生かして開発を効率化! (I/O BOOKS): 赤間 世紀: 本 があった。が(以下略)







■_ gawk 4 β

bug-gawk Archives にアナウンスがなかったのに、3.1.85 が出てるとかいう話を聞いたので なんじゃそりゃあと思い調べてみたら、分離前のMLにあった○| ̄|_

2nd gawk 4.0 beta tarball available

From: 	Aharon Robbins
Subject: 	2nd gawk 4.0 beta tarball available
Date: 	Tue, 07 Jun 2011 10:33:42 +0300

Hello Everyone.

The next beta tarball for gawk 4.0 is at


There are a number of bug fixes, including a better job of making [a-z]
ranges work how G-d intended.



まあそれほど大きな変更ではなさげ。 文字クラスの扱いについては、ほかの人から質問が出てるみたいだけど。

■_ Scala

なんか海の向こうでも騒動? Scala: The Static Language that Feels Dynamic (Bruce Eckel) : programming 伸びてます。

Scala: The Static Language that Feels Dynamic


The highest complement you can deliver in the Python world is to say that something is 
"Pythonic" -- that it feels and fits into the Python way of thinking. I 
never imagined that a static language could feel this way, but Scala does -- and 
possibly even better. 


■_ vim の


pattern - vimdoc-ja

4. パターンの概要					*pattern-overview*

量指定子の概要。					*/multi* *E61* *E62*
詳しい説明や使用例は、リンク先を参照してください。			*E64*

     'magic' 'nomagic'	アトムがいくつマッチするか
|/star|	*	\*	0 以上		最長一致
|/\+|	\+	\+	1 以上		最長一致 (*)
|/\=|	\=	\=	0 か 1		最長一致 (*)
|/\?|	\?	\?	0 か 1		最長一致 (*)

|/\{|	\{n,m}	\{n,m}	n 以上 m 以下	最長一致 (*)
	\{n}	\{n}	n		正確に指定した数だけ (*)
	\{n,}	\{n,}	n 以上		最長一致 (*)
	\{,m}	\{,m}	0 以上 m 以下	最長一致 (*)
	\{}	\{}	0 以上		最長一致 (*と同じ) (*)

|/\{-|	\{-n,m}	\{-n,m}	n 以上 m 以下	最短一致 (*)
	\{-n}	\{-n}	n		正確に指定した数だけ (*)
	\{-n,}	\{-n,}	n 以上		最短一致 (*)
	\{-,m}	\{-,m}	0 以上 m 以下	最短一致 (*)
	\{-}	\{-}	0 以上		最短一致 (*)

|/\@>|	\@>	\@>	1	強欲な量指定子 (*)
|/\@=|	\@=	\@=	なし	幅ゼロの肯定先読み |/zero-width| (*)
|/\@!|	\@!	\@!	なし	幅ゼロの否定先読み |/zero-width| (*)
|/\@<=|	\@<=	\@<=	なし	幅ゼロの肯定後読み |/zero-width| (*)
|/\@<!|	\@<!	\@<!	なし	幅ゼロの否定後読み |/zero-width| (*)

(*) {Vi にはない機能です}

普通のアトムの概要					*/ordinary-atom*

      magic   nomagic	マッチするもの
|/^|	^	^	行頭 (パターンの先頭にある場合だけ) |/zero-width|
|/\^|	\^	\^	リテラル文字 '^'
|/\_^|	\_^	\_^	行頭 (どこでも使える) |/zero-width|
|/$|	$	$	行末 (パターンの末尾にある場合だけ) |/zero-width|
|/\$|	\$	\$	リテラル文字 '$'
|/\_$|	\_$	\_$	行末 (どこでも使える) |/zero-width|
|/.|	.	\.	何か 1 文字 (改行以外)
|/\_.|	\_.	\_.	何か 1 文字 (改行含む)
|/\<|	\<	\<	単語の先頭 |/zero-width|
|/\>|	\>	\>	単語の末尾 |/zero-width|
|/\zs|	\zs	\zs	なし。マッチの開始地点を設定します
|/\ze|	\ze	\ze	なし。マッチの終了地点を設定します
|/\%^|	\%^	\%^	ファイルの先頭 |/zero-width|		*E71*
|/\%$|	\%$	\%$	ファイルの末尾 |/zero-width|
|/\%V|	\%V	\%V	選択範囲内 |/zero-width|
|/\%#|	\%#	\%#	カーソル位置 |/zero-width|
|/\%'m|	\%'m	\%'m	マーク m の位置 |/zero-width|
|/\%l|	\%23l	\%23l	23行目 |/zero-width|
|/\%c|	\%23c	\%23c	23列目 |/zero-width|
|/\%v|	\%23v	\%23v	23列目 (表示単位) |/zero-width|

文字クラス {Vi にはない機能です}:				*/character-classes*
|/\i|	\i	\i	識別子文字 (オプション 'isident' を参照)
|/\I|	\I	\I	"\i" と同じですが、数字は除外します
|/\k|	\k	\k	キーワード文字 (オプション 'iskeyword' を参照)
|/\K|	\K	\K	"\k" と同じですが、数字は除外します
|/\f|	\f	\f	ファイル名の文字 (オプション 'isfname' を参照)
|/\F|	\F	\F	"\f" と同じですが、数字は除外します
|/\p|	\p	\p	印字可能文字 (オプション 'isprint' を参照)
|/\P|	\P	\P	"\p" と同じですが、数字は除外します
|/\s|	\s	\s	空白文字: <Space> と <Tab>
|/\S|	\S	\S	空白文字以外。\s の反対です
|/\d|	\d	\d	数字				[0-9]
|/\D|	\D	\D	数字以外			[^0-9]
|/\x|	\x	\x	16 進数字			[0-9A-Fa-f]
|/\X|	\X	\X	16 進数字以外			[^0-9A-Fa-f]
|/\o|	\o	\o	8 進数字			[0-7]
|/\O|	\O	\O	8 進数字以外			[^0-7]
|/\w|	\w	\w	単語を構成する文字		[0-9A-Za-z_]
|/\W|	\W	\W	単語を構成する文字以外		[^0-9A-Za-z_]
|/\h|	\h	\h	単語の先頭の文字		[A-Za-z_]
|/\H|	\H	\H	単語の先頭の文字以外		[^A-Za-z_]
|/\a|	\a	\a	英字				[A-Za-z]
|/\A|	\A	\A	英字以外			[^A-Za-z]
|/\l|	\l	\l	小文字英字			[a-z]
|/\L|	\L	\L	小文字英字以外			[^a-z]
|/\u|	\u	\u	大文字英字			[A-Z]
|/\U|	\U	\U	大文字英字以外			[^A-Z]
|/\_|	\_x	\_x	x は上記の文字クラスのどれかです。文字クラスと改行が

\@<=	幅ゼロの肯定後読み。|/zero-width| {Vi にはない機能です}
	Perl の "(?<=pattern)" と同じですが、Vimでは可変長パターンも使えます。
	Example			マッチするもの
	\(an\_s\+\)\@<=file	"an" と空白文字 (改行含む) の後の "file"

	"\zs" を使ってください |/\zs|。次のものは上記の例と同じものにマッチし

	"\@<=" と "\@<!" は直前の文字がマッチしているかどうかをチェックしま
	し、処理時間を制限するために、マッチの現在行と、(もしあれば) 1 つ前の
	"\@<=" や "\@<!" の後にくるパターンは最初にチェックされます。そのため、
	"\1" のような、\(\) の前方参照は機能しません。そのときは次のようにしま
	Example			マッチするもの
	\1\@<=,\([a-z]\+\)	"abc,abc" の ",abc"



■_ Open Source Project Maintainer Sarcastic Response Cheat Sheet


plope - Open Source Project Maintainer Sarcastic Response Cheat Sheet
Open Source Project Maintainer Sarcastic Response Cheat Sheet


Need a sarcastic response to a support interaction as an open source project 
maintainer? Look no further!

1. I'll just retype the docs into this email for you.


2. Please send me an email personally, because the mailing list is full of other people
   who can help.


3. I don't need to see any code to answer that.


4. Just paste the very last line of the traceback please, I've memorized all the
   potential codepaths of your application.


5. Of course I believe you've found a fundamental bug in the system. You've been using
   it for almost 10 minutes.

6. Why would you learn to use an interactive debugger?

7. Don't sweat it, I am a master at Engrish.

8. That docs typo is important enough for me to fix right now; don't bother creating
   an issue for it.


9. Please don't submit a pull request, just type the diff manually into IRC, I'll take
   care of it right now.

10. Let's talk about variable names, I really wasn't doing anything else.


11. When I said 'dont do it that way', I was just making idle conversation.

12. I love answering the same question from you every two weeks.


13. It totally makes sense for you to do it the hard way over and over.

14. Please, please let me convince you to use my free software because I know you're
    going to contribute back later.

15. The dogma you've gained from your six months of experience is indeed how everyone
    should do it.

16. You're right, it is too complex. Why didn't I think of that?


17. Ignoring conventions is completely reasonable at your experience level.


Created by chrism

どうもニュアンスがよくわからんところがあるな ○| ̄|_








↑というのが今日のお題ということでメモに残っていたんだけど、 はて、どういう文を書こうと思っていたのだっけw

■_ embedded →

一時期、embedded をそのまま日本語にした感のある「埋め込み」ってのも よく見かけたような気が。

組み込みプログラマー雑談スレッド その19 

774 仕様書無しさん [sage] 2011/06/08(水) 19:56:26.00 ID: Be:


775 仕様書無しさん [sage] 2011/06/08(水) 20:01:23.42 ID: Be:

776 仕様書無しさん [] 2011/06/08(水) 21:36:36.28 ID: Be:


777 仕様書無しさん [sage] 2011/06/08(水) 21:57:47.71 ID: Be:

778 仕様書無しさん [sage] 2011/06/08(水) 23:26:24.34 ID: Be:

779 仕様書無しさん [sage] 2011/06/09(木) 07:24:35.24 ID: Be:

780 仕様書無しさん [sage] 2011/06/09(木) 07:39:59.11 ID: Be:

793 仕様書無しさん [sage] 2011/06/11(土) 16:18:07.40 ID: Be:


794 仕様書無しさん [sage] 2011/06/11(土) 19:01:17.79 ID: Be:

■_ Oz

そいやガウディ本あともう少しのところまで読んだけど完走してないや ○| ̄|_

プログラミング言語 Scala 6冊目

92 デフォルトの名無しさん [sage] 2011/06/12(日) 12:12:35.32 ID: Be:

93 デフォルトの名無しさん [sage] 2011/06/12(日) 12:44:38.86 ID: Be:


94 デフォルトの名無しさん [] 2011/06/12(日) 12:50:02.02 ID: Be:

95 デフォルトの名無しさん [sage] 2011/06/12(日) 12:52:46.73 ID: Be:


96 デフォルトの名無しさん [sage] 2011/06/12(日) 12:55:32.07 ID: Be:


99 デフォルトの名無しさん [sage] 2011/06/12(日) 13:08:12.37 ID: Be:


110 デフォルトの名無しさん [sage] 2011/06/12(日) 13:54:27.52 ID: Be:

114 デフォルトの名無しさん [sage] 2011/06/12(日) 15:00:04.28 ID: Be:


Oz のチュートリアルってのはこれか。

Tutorial of Oz

This tutorial introduces the Oz programming language and the Mozart programming system.

The tutorial covers most of the concepts of Oz in an informal way. It is suitable as 
first reading for programmers who want to be able to quickly start writing programs 
without any particular theoretical background. The document is deliberately informal 
and thus complements other Oz documentation.



"My current theory is that programming is quite literally writing. The vast majority of programming is not conceptually difficult (contrary to what a lot of people would have you believe). We only make it difficult because we suck at writing." Interesting point. : programming


■_ NetRexx


NetRexx is now open source...does it matter? : programming

Yes, APL, Lisp, Forth, and S/360 assembler are each minor inspirations to Rexx. But, 
compare the string formatting functions to those in Python.

Rexx is also the origin of the popular long-precision Decimal datatype in Java and C#.

Rexx has a cool "parse" statement and has associative arrays.

Rexx essentially has a universal datatype.

Rexx resembles the current wave of dynamic languages.

All that said, this is 20 years too late. Rexx is now historical. Python has superseded it.

(Disclaimer: I wrote a lot of Rexx code in the 80s and 90s.)


■_ 読んだ


チェックしたところをまとめるのめんどい (しかもホワイトバランスなんか変だ) ○| ̄|_

Coders at Work プログラミングの技をめぐる探求 ユニコード戦記 ─文字符号の国際標準化バトル
とりあえず両方ともオススメ。 で、きちんとした文章書かないからアフィリエイトも伸びないのよねw




カミソリシュート―V9巨人に立ち向かったホエールズのエース (ベースボール・マガジン社新書)


■_ New Features of Perl 5.14: unicode_strings

unicode 文字列とかPythonのような。 つーても実体は違うのだろうけど

New Features of Perl 5.14: unicode_strings - Perl.com

New Features of Perl 5.14: unicode_strings

By chromatic on June 8, 2011 11:12 AM

Perl 5.14 is now available. While this latest major release of Perl 5 brings with it 
many bugfixes, updates to the core libraries, and the usual performance improvements, 
it also includes a few nice new features.

Perl 5.14 が利用可能になっています。これはPerl 5の最新のメジャーリリースであり、
たくさんのバグフィックス、コアライブラリの更新、そして usual な性能の向上がなされ
ていますが、いくつかの niceな新機能もあります。

One such feature is the new unicode_strings feature, enabled with use feature 
'unicode_strings'; or use feature ':5.14';. (Perl 5.12 first introduced this feature, 
though it remained incomplete until the development of 5.14. Fortunately, you can 
write use feature ':5.12'; while running with 5.14 and still get all of the benefits 
of the improved form in Perl 5.14.)

そういった機能の一つが新しい unicode_strings 機能です。これは
use feature 'unicode_strings'; もしくは use feature ':5.14'; とすることで

unicode_strings tells the Perl 5 compiler to assume Unicode semantics for all string 
operations within the enclosing lexical scope. In other words, Perl will treat all 
strings as if they contain Unicode characters and not merely bytes. This fixes an 
issue when your code handles text outside of the strict ASCII range.

unicode_strings は Perl 5コンパイラーに対し、現在の位置を取り囲むレキシカルスコープ
(うまくねー)における文字列操作すべてにおいてUnicode semantics を仮定するように
指示します。言い換えれば、Perl はすべての文字列が Unicode 文字を保持していて
strict な ASCII の範囲の外側にあるテキストを扱うときの問題を解決します。

For example, what should Perl assume if you read a character with a code point between 
128 and 255? It's obviously not ASCII text. Is it Latin-1? Is it a raw byte? What 
should happen?

読んだとしたら、Perlはすべきことはなんでしょうか? ASCIIでないことは明らかです。
Latin-1でしょうか? raw byte でしょうか? 何がおきるべきでしょうか?

If you intend it as a Latin-1 character (Ö, for example), then the regular expression 
metacharacter \w should match it, because an O even with a diaresis is still a letter. 
The Perl 5 documentation refers to this as "character semantics".

あなたがそのようなキャラクター (たとえば Ö) を Latin-1 のものとして扱いたいのなら、
正規表現のメタキャラクターの \w はそれにマッチすべきです。
なぜなら、diaresis がついていても O は文字には違いないからです。
Perl 5のドキュメントはこれを "character semantics" としています。

If you intend it as the byte value 214, then \w should not match it (though why are 
you using a regular expression against it?). The Perl 5 documentation refers to this 
as "byte semantics".

これを byte value の 214 としたいのであれば、\w はそれにマッチすべきではありません
(なぜそんなものに対して正規表現を使おうというのでしょう?)。Perl 5のドキュメントは
これを "byte semantics" としています。

Now assume you have several strings from several places and you don't know the exact 
encodings of all of those sources and you want to concatenate two strings or 
interpolate them into a third string. What happens?

第三の文字列へ interpolate したいとします。何が起きるでしょうか?

With unicode_strings in effect, Perl 5 prefers to use character semantics for all 
string operations. You can override this lexically with no feature 'unicode_strings'; 
or use locale;.

unicode_string が有効であるとき、Perl 5はすべての文字列操作に対して character
semantics の使用を prefer します。これは no feature 'unicode_strings'; 
もしくは use locale; によってオーバーライド可能です。

For more information, see perldoc feature and especially The Unicode Bug" in 
perldoc perlunicode.

■_ NetRexx

now open source ってあるけど、ダウンロードページ見るとパッケージの日付が2005年なんですけど。 そこからぜんぜん更新されていないってことなんだろうか。

NetRexx is now open source...does it matter? : programming

NetRexx is now open source...does it matter? (netrexx.org)

What the hell is NetRexx? (Their website also seems to be down or perpetually loading.)

A compiler/interpreter of object-oriented version of REXX to Java bytecode.

And REXX is one of oldest scripting languages (created in 1979).

So assuming that it (at one point) cost money, it would be a safe assumption that it's 
a language in high demand.

Didn't cost money, just wasn't open-source. Just like the Java JDK it runs on, until a 
few years ago.

There are quite a few free interpreters for other versions of Rexx out there (Regina, 
Rexx/imc etc.). And on some platforms it was the scripting language (Amiga, OS/2, IBM 
systems). It never got quite popular on the current crop of systems (Windows, free 
Unices). Compared to languages like Python or Ruby, it's syntax has a few historical 

At this point, probably not. I've never heard of a single piece of software written in 

I click on "examples" and see no code. I possibly will never take a look at 
your language again. You failed to get a new user.

Wow, that's awesome. Finally I can make my OS/2 scripts webscale.

Regina はちょっとだけいじったな。


■_ fork が共にありますように

2. May the fork be with you がよいな。 …ってスターウォーズネタは大丈夫だよね?


From CVS to Git, 9 Things I've Learned « EclipseSource Blog

From CVS to Git, 9 Things I've Learned

I decided to record some of things I learned while moving from CVS (a centralized 
version control system) to git (a distributed version control system).

1. Commit early, commit often

2. May the fork be with you

3. Check your head

4. RTFL: Read The Frickin (ref)Log

5. To pull or to fetch, that is the question

6. Shut-up and just branch

7. Stash it, don't trash it

8. Play the blame game

9. Those who don't learn from history, are destined to repeat it

一つ前へ 2011年6月(上旬)
一つ後へ 2011年6月(下旬)



メールの宛先はこちらkbk AT kt DOT rim DOT or DOT jp