ときどきの雑記帖'

最新ページへのリンク
目次ページへのリンク

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

ホームへ

2013年06月20日

■_

用途が違うから当然と言えば当然のことなんだけど、 HP 15C と HP 12C とで演算キー(の一部)が違うのね。 hp 12c Platinum ブラック 金融電卓 日マニュアル付 HP 15c 関数電卓 復刻版 日本語マニュアル付属

■_ Some Dark Cornrers of C

これは何ヶ月か前にも話題に上ってたはずだけど Some Dark Corners of C : programming

Some Dark Corners of C : programming

Anyone who write y+++++x deserves whatever pain the language may inflict upon them.


Haven't you ever seen the "goes to" operator?

  int y = 10;
  while (y --> 0) { // As "y" goes to zero
      // Do stuff
  }

Or "runs to" operator?

  int y = 10;
  while (y ----> 0) { // As "y" runs to zero
      // Do stuff
  }
for i rockets to zero....

    for (i = 10; 0 <=~~-- i;)

edit: actually, i rockets to zero with a winking smiley


What exactly do the tildes accomplish?


Tildes invert the bits of the operand. In this case it does nothing since it's used twice.


May god have mercy on our souls! That's witchcraft!


bitwise not. Two of them in a row accomplish nothing as they cancel each other out. Well, nothing except
looking like rocket exhaust.


    ~3 is one's complement of 3.
    -3 is two's complement of 3.


The "runs to" operator isn't valid C++ code due to modifying the value of a variable twice in an
expression. Well unless I have parsed it wrong. Though perhaps it is valid in C?


It isn't valid because y-- returns an rvalue, and then tries -- on that rvalue, which isn't allowed.

Just for completeness, it would be valid C++ if y had a non-builtin type with a suitable operator--(int). The
restriction isn't on modifying a variable twice in an expression but on modifying twice without an intervening
sequence point (NB: C++11 changed the vocabulary a bit, I'm using outdated terminology but the semantics is
the same, AFAIK).

(And as byuu helpfully noted, it's invalid C.)


It is pretty scary the way the C++ overloaded operators can change semantics of the language. Things like
operator&&/|| bypassing short-circuiting, operator--(int) returning lvalues, etc.

I never like to say there's no use for things, because that's way too short sighted, but it's pretty horrifying
to think of postfix-decrement returning an lvalue.

この後も色々面白いものが。 しかし、----> はどうよと思ってたら(ry

■_

Bjarne Again: Hallelujah for C++ • The Register の最初の方にある 'The most awesome thing about Delphi is that it is not C++'. ってなにw

■_

■_

余裕が削られていく日々

2013年06月19日

■_

アド・アストラ4巻、Kindle版を買ってみた。 読んでみた感じ、見開きを除けば満足できるような気がした。 もちろん同じものを見ても不満を覚える人はいるだろうし、そういった感想を否定しない。 見開きについては、たとえば見開きの上半分が見開きで下半分は普通にコマ割りされてる (う、言葉で書くと説明しづらい。実例出せば一発なんだろうけど)体裁のものが いくつかかあって、台詞や場面の流れが把握しづらかった。 右ページ上→右ページ下→左ページ上→左ページ下ではなく、 右ページ上→左ページ上→右ページ下→左ページ下で読まなきゃいけないとかね。 アド・アストラ 4 ─スキピオとハンニバル─ (ヤングジャンプコミックス・ウルトラ)
アド・アストラ 4 ─スキピオとハンニバル─ (ヤングジャンプコミックス・ウルトラ)

■_

■_

翻訳進まないー あれだけ省力しているのに

■_

Monday was my 46th birthday and likely my last. Anything awesome I should try after I die? | Aaron Winborn

■_

C++11 The Future is Here // ACCU 2013 Keynote, Bjarne Stroustrup : programmingC++11 The Future is Here スライドの最初の方、なーんか見覚えが

C++ つながり Bjarne Again: Hallelujah for C++ • The Register

■_

ろぶすたー? Lobster: a new game programming language, now available on github : programming

2013年06月18日

■_

自衛隊メンタル教官が教える 心の疲れをとる技術 (朝日新書)
自衛隊メンタル教官が教える 心の疲れをとる技術 (朝日新書) 通勤の隙間時間にちょこちょこ(twitterせずにw)読んでたのだけど結構お勧め。 特に、部下やらいる人向けなんじゃないでしょうか。 「ムリをしてしまう」流れとかそれへの対処等々なるほどというものがあります。 が、今の自分では実践できんw

■_

わたしは彼 (John) とはなんの接点がもありませんが、やろうとしていることは応援したいと思いました。 無理にとは言いませんができましたら。

■_

Real World OCaml | Hacker News Windowsには冷たいらしいです

■_

72時間限定で 40%引きらしい (クーポンコードの入力を忘れずに) Realm of Racket | No Starch Press

■_

■_

ちと身辺が慌ただしく。

2013年06月17日

■_

すぽすっぽ先生のお話が C++11 The Future is Here Bjarne Stroustrup keynotes on what C++ is in general, how C++ 11 makes simple things even simpler, resource management, generic programming, and concurrency.

年配の方のとんでもない運転の自転車を見かけるなど (ベル鳴らしっぱなしだった)

なぜか今まで開封すらしていなかった HP-15Cを使い始める。 HP 15c 関数電卓 復刻版 日本語マニュアル付属
HP 15c 関数電卓 復刻版 日本語マニュアル付属

■_ 難読コード

読んでたら頭がくらくらしてきたw C code - 60 lines - codepad

■_

■_

作業間に合わず ○| ̄|_

えーとなんだっけ、Apple II用のプリンスオブペルシャのソースコード解説とかPrince Of Persia Code Review : programming Prince Of Persia Code Review Part 1

TojiCode: A Tale of two Web Technologies に対する反応が HN と reddit で大違いとか A Tale of two Web Technologies | Hacker News Mozilla's Brendan Eich is sure that JavaScript can evolve enough not to need a replacement (in Dart) : programming

2013年06月16日

■_

ちょっと記憶違いでした>「思考のための道具」 検索しても見つからないわけだ。 Island Life - 子どもは何にも知らないの そう思う人にはDaniel HillisのThe Pattern on the Stone (翻訳: 思考する機械 コンピュータ) を勧めとく。 ということでぺたぺた 思考する機械コンピュータ (サイエンス・マスターズ)
思考する機械コンピュータ (サイエンス・マスターズ) 初めて知ったのだけど原著ってこんな表紙だったのね The Pattern On The Stone: The Simple Ideas That Make Computers Work (Science Masters)
The Pattern On The Stone: The Simple Ideas That Make Computers Work (Science Masters)

↓この猫さんたち、出勤時によく見かけるのよね。

ボーナス出るからって買うのをペンディングしてた電書を買いまくると 破滅の音が聞こえちゃうからなあ(一時に比べてどんだけ減ったか) オーバーシー・パブリッシング - GNU開発ツール O'Reilly Japan - 入門 ClojureScript O'Reilly Japan - 例題で学ぶ微分方程式 Amazon.co.jp: The School of Niklaus Wirth: The Art of Simplicity eBook: Laszlo Boszormenyi, Jurg Gutknecht, Gustav Pomberger: Kindleストア あと三つくらいあったはず…

■_

2199の鑑賞前の喫茶店の前に紀伊國屋書店新宿本店をうろうろしてたんですが C本の集まった棚を見ているとこう(省略されました)

dicipline ってすぐ意味忘れるんだよなあ Amazon.co.jp: ディシプリンド・アジャイル・デリバリー エンタープライズ・アジャイル実践ガイド: Scott W. Ambler, Mark Lines, 藤井 智弘, 熱海 英樹, 天野 武彦, 江木 典之, 岡 大勝, 大澤 浩二, 中佐藤 麻記子, 永田 渉, 西山 泰男, 三宅 和之, 和田 洋: 本

Gold にちょっと色つけて出してみた The Untold History of Japanese Game Developers by John Szczepaniak — Kickstarter

■_ 気になる

Tiger bookのところで関連書籍として出てきたんだけど気になるなこの本 Engineering a Compiler, Second Edition: Keith Cooper, Linda Torczon: 9780120884780: Amazon.com: Books

Engineering a Compiler, Second Edition: Keith Cooper, Linda Torczon: 9780120884780: Amazon.com: Books

As computing has changed, so has the role of both the compiler and the compiler writer. The proliferation of
processors, environments, and constraints demands an equally large number of compilers. To adapt, compiler
writers retarget code generators, add optimizations, and work on issues such as code space or power consumption.

Engineering a Compiler re-balances the curriculum for an introductory course in compiler construction to
reflect the issues that arise in today's practice. Authors Keith Cooper and Linda Torczon convey both the art
and the science of compiler construction and show best practice algorithms for the major problems inside a
compiler.

■_

■_

ついったから

あ、なんか RubyKaigiの会場でまつもとさんと話したこととちょっと関係ありな気が

もうひとつ

もういっちょ。

後ろ二つを起点にちょっと書こうと思ったのだけど時間が(お約束

2013年06月15日

■_

ついに初日に行くという事態に >2199イベント上映

んでまあ18時過ぎ開始の上映回だったので、積ん読山から持ってきた本でも読んで 時間潰そうと思って靖国通りを挟んで新宿ピカデリーの反対側にある 某チェーンの喫茶店に行ったんですがひどかったw

「いらっしゃいませ。お一人様ですね。禁煙席喫煙席どちらをご希望ですか」 「あ、できれば禁煙席で」 「申し訳ありません。禁煙席は現在満席でございます」 「あー、じゃあ喫煙席でも良いですよ」 「申し訳ありません。喫煙席も満席で…」 …なんで最初に満席だって言わないんだよ!w

十分ばかり待って席が空いたのですが、その後も「満席」と知らずに店に入ってくる人が結構いました。 わたしと同じように空きを待つ人もあれば諦めてしまった人も。 店内を見回してみると、四人席を一人で「占領」してパソコン開いて「ノマド」(ってなんですか) している人がちらほら。 中には天井向いて寝ちゃっているのとか 結構響く声で商談ぽい電話をしているのとか。 なんつーかさー、静かに本読めるような環境ないのかよ○| ̄|_ (「ふつーの会話」も結構大きな声でしてたような気がしないでもない)

んでまあ2199の感想は細かいところをつついたらキリがないのでおいといて、 良かったと思います。割に。 ただ、七色星団の戦いの決着ついたところで今回の半分なので、 後半部分がちと… 最後の最後の BGM のアレにはニヤッと来ましたが :) そうそう、オリジナルのときもあった、 「宇宙空母から発艦した雷撃機が甲板から離れた直後に重みでちょっと沈み込む」というのを 始めとしてあれやこれをきっちりやってましたね。

■_

で。TIOBE index。 6月のデータを見ると

1 	C 	17.809%
2 	Java 	16.656%
3 	Objective-C 	10.356%
4 	C++ 	8.819%
5 	PHP 	5.987%
6 	C# 	5.783%
7 	(Visual) Basic 	4.348%
8 	Python 	4.183%
9 	Perl 	2.273%
10 	JavaScript 	1.654%
11 	Ruby 	1.479%
12 	Visual Basic .NET 	1.067%
13 	Transact-SQL 	0.913%
14 	Lisp 	0.879%
15 	Pascal 	0.779%
16 	Bash 	0.711%
17 	PL/SQL 	0.657%
18 	Delphi/Object Pascal 	0.602%
19 	Ada 	0.575%
20 	MATLAB 	0.563%

21 	SAS 	0.543%
22 	Lua 	0.537%
23 	Assembly 	0.500%
24 	R 	0.480%
25 	D 	0.474%
26 	COBOL 	0.441%
27 	ABAP 	0.436%
28 	Fortran 	0.407%
29 	Scheme 	0.381%
30 	Haskell 	0.322%
31 	Erlang 	0.317%
32 	Prolog 	0.313%
33 	Scratch 	0.308%
34 	Scala 	0.290%
35 	Logo 	0.270%
36 	Groovy 	0.269%
37 	NXT-G 	0.235%
38 	Smalltalk 	0.231%
39 	APL 	0.222%
40 	Forth 	0.212%
41 	ML 	0.204%
42 	ActionScript 	0.198%
43 	F# 	0.166%
44 	JScript.NET 	0.153%
45 	Awk 	0.153%
46 	Tcl 	0.144%
47 	ATLAS 	0.143%
48 	RPG (OS/400) 	0.140%
49 	PL/I 	0.137%
50 	Algol 	0.135%

謎のindex値ですが、これ全部足すと100になるっぽいですね。 今月以外のデータが分かりませんが、過去の上位言語のindex値推移グラフなんかを見ると 上位言語の「占有率」が下がっているような。 いやまあ「謎な数値」なのであれこれ憶測するのは無駄な気もしますが、 初期には1位と2位とか3位くらいまででもう「合計」が50%を超えているんですよね。 そして現在に近づくにつれて50%に合計が達するのが低い順位になっているような…

TIOBE Software: Tiobe Index

    Q: I would like to have the complete data set of the TIOBE index. Is this possible?

    A: We spent a lot of effort to obtain all the data and keep the TIOBE index up to date. In order to
       compensate a bit for this, we ask a fee of 5,000 US$ for the complete data set. The data set runs from
       June 2001 till today. It started with 25 languages back in 2001, and now measures more than 150
       languages once a month. The data are availabe in comma separated format. Please contact sales@tiobe.com
       for more information.

そもそも初期に比べて「尻尾が長く」なってますわね。

■_

オブジェクト指向批判記事のフォーマルな補足 - 標高+1m からコメント欄に オブジェクト指向をちゃんと知った上でオブジェクト指向はクソだと声高に主張する人があと100人は必要 - 標高+1m "Tools for Thought"が読み物として面白いですよ。日本語訳も出ています(「思考のための道具」)。

「思考のための道具」って以前(結構前) shiro さんもお勧めしてたような記憶が。違ったかな (裏でぐぐってたらしい) 思考のための道具―異端の天才たちはコンピュータに何を求めたか?
思考のための道具―異端の天才たちはコンピュータに何を求めたか? 新 思考のための道具 知性を拡張するためのテクノロジー ― その歴史と未来
新 思考のための道具 知性を拡張するためのテクノロジー ― その歴史と未来

■_

問題の説明が不十分でした?

■_

なんつーかその、某方面で良くでてくる「撲滅」とか「観点」とかって言葉がキライなんですね。

■_

2013年06月14日

■_

で、この本。 Amazon.co.jp: How We Test Software at Microsoft eBook: Alan Page, Ken Johnston, Bj Rollison: Kindleストア 紙本とKindle版とで価格は 紙の本の価格: ¥ 4,581 Kindle 価格: ¥ 1,931 のようになっているんですが、Microsoft Pressの本も扱っているオライリーのサイトを見ると How We Test Software at Microsoft® - O'Reilly Media Ebook: $35.99 Formats: APK, DAISY, ePub, Mobi, PDF Mobi (Kindle) だけじゃなくて各種フォーマットもあるし、 もちろん DRM Free。半額セールの対象になるのを待ってそこで買った方が良いのかなあ。 あ、この本はAmazonでもインストールできるデバイスの数に制限なしだったかも

■_ TIOBE index

3ヶ月分くらいで良いから過去のデータ無いものかな(50位位までは欲しい)。 FAQ 見ると、最初期からのデータを5000ドルで売るとかあるみたいなんだけど。

■_ 圏論

また別のスライドが Category Theory for Programming 3ページ目にこんなのが credit to Tokuhiro Kawai (川井徳寛)

で、redditでの反応から Category Theory for Programming : programming

Category Theory for Programming : programming

I know these javascript-powered presentations are the new hotness, but I still like to rant about usability:

    the arrow that looks like a button to advance to the next slide, but disappears as soon as I try to move my mouse anywhere near it

    the explanatory text in a tiny, low-contrast font that didn't immediately indicate to me that it was referring to keyboard arrows

    fucking with my alt-left history behaviour: how am I supposed to even return to reddit and complain?

    I'm not even sure what "swipe" is supposed to mean, but apparently I can't do it with a mouse

    nicely confusing combination of keyboard and mouse controls: a very obvious button to press to make it go full screen, but other than that the mouse is almost entirely useless

    I love keyboard interfaces. Mostly because moving between keyboard and mouse is anti-ergonomic. But this
    forces me to transition when I first get to the page (yep, the vast majority of your users got there by
    clicking something), and twice again whenever I suspect something on a page might be an interesting link

I know this presentation wasn't about UX, and it looks like a neat one worth reading, but what is /r/programming
if not for bitching?

印刷しようとするとどうなるんだろう

■_

1000近くまで伸びているこの話題 Working at Microsoft : programming 8 months in Microsoft, I learned these | /home/alp

8 months in Microsoft, I learned these | /home/alp

8 months in Microsoft, I learned these
by Ahmet Alp Balkan

Two years ago today, I started Microsoft Windows Azure as an intern, in the very same team I joined right
after college and I am working for last 8 months.

I decided to summarize a few points I learned so far in this job during last 8 months. This may sound like
the way things work are crappy, it is not. I learned that one will see this sort of problems in all large
scale companies. Most of them are not specific to Microsoft at all. Every company has its own problems. I
am not saying that I am unhappy and not complaining. These are purely a few lessons I was not aware of in
the college (expectations vs reality sort of article). Read on:

で、説明は抜きで項目を抜き出すとこう

Hacker News でもとりあげられてたか(多分見落とした)

(This post made it to the top of Hacker News and /r/programming. Thanks everyone for comments and support.
There are over 1,000 comments on HN, Reddit and below, I did not have a chance to read them all, sorry if I
missed yours.)

© 2013 — Ahmet Alp Balkan

■_

これはGCのあの方もチェックしていましたが Removing Garbage Collection From the Rust Language - pcwalton このblogの他の記事もメモリ管理周りの話で なおかつ結構面白いです。って実は斜め読みしかしてないんですがw Safe Manual Memory Management - pcwalton Performance of Sequential Rust Programs - pcwalton A Hard Case for Memory Safety - pcwalton An Overview of Memory Management in Rust - pcwalton

■_

2013年06月13日

■_

匿名さまよりまた wishlist からのお届け物が。ありがとうございます。 ああ、パワーローダー乗り回してみたい(謎) パワーローダー (エイリアン2) - Wikipedia

例の話題には触れません。

■_ TAPL 読書会

23章つづき。

(defun insert-to-list (compare elem lst)
  (if (null lst)
      (list elem)
    (if (funcall compare elem (car lst))
	(cons elem lst)
      (cons (car lst) (insert-to-list elem (cdr lst))))))

(defun ex24-4-4 (lst)
  (if (null lst)
      '()
    (insert-to-list #'< (car lst) (ex24-4-4 (cdr lst)))))

Lisp で書いてどうするという話がありますが

■_ Mikado Method

調べてみたら数年前から名前が出てきてたのね Mikadoメソッド - レガシーソフトウェアのリファクタリング手法 大規模なリファクタリングを行う方法 大規模なリファクタリングにおいて今,注目を集めているアプローチがある。それが ミカドメソッド(Mikado Method) だ。 このミカドメソッドの歴史は,Daniel Brolund,Ola Ellnestam 両氏の行った仕事に関係している。 名称はミカドゲームに由来するものだ。 Mikadoゲーム云々はこちらにも。時期的にはほぼ同じですね。 晴れ - 今日も反省の色なし(masayangの日記

■_ 現代思想

これは気になる。 といいつつチューリングの増刊号も買ったものの以下略だった 現代思想2012年11月臨時増刊号 総特集=チューリング
現代思想2012年11月臨時増刊号 総特集=チューリング

お、こんなのも出てるのか 現代思想 2013年7月号 特集=ネグリ+ハート 〈帝国〉・マルチチュード・コモンウェルス
現代思想 2013年7月号 特集=ネグリ+ハート 〈帝国〉・マルチチュード・コモンウェルス

■_

SQL はまあ良いとしてもHTMLとかXMLて… 10 programming languages that are in demand by employers

■_ TIOBE index

例によって例のごとしなんですが 6月プログラミング言語人気 | 開発・SE | マイナビニュース

ふと気になってTIOBEのサイトを見に行ったんですよ。 TIOBE Software: Tiobe Index そうしたら 「Very Long Term History」とかいう項目で To see the bigger picture, please find the positions of the top 10 programming languages from 5, 15 and 25 years ago in the table below. というのがあったり、static typing と dynamic typing のトレンド比較があったり なかなか楽しい。というかなんでこの辺スルーするのかなあ>日本語記事 いやまあスペースの都合もあるんでしょうけども。

あと、index の値でいくつかのグループに分けられるような気がした。 誰かやってみて(ry

■_ 定額小為替

コメント欄に shiro さん発見。いやだからどうしたというわけではないんですが。 以前は通販で結構使ってたような記憶があるんですが、って最近でも 年に一、二回は使ってるか。 雑誌等の応募者全員プレゼントなんかでありますね。 買いに行くのが結構大変なんだよなあ。時間的に(檜山さんの記事にある通り)。 小額決済は大変です - 檜山正幸のキマイラ飼育記 定額小為替(http://www.jp-bank.japanpost.jp/kojin/tukau/sokin/hikoza/kj_tk_sk_hkz_kogawase.html)ってはじめて使いましたよ。100円分の証書の発行手数料が100円かかります。 定額小為替、私が中高生の頃は手数料10円とかだった気がします。でも切手の値上がり率を考えたらそんなものかもしれませんね…と思ってぐぐったら値上げされたの2007年なんですね。

みねこあさんもけっこう使っていたに違いない。 などと言ってみる。

■_

■_ (un)boxing

やっぱりさあ、boxing を「ボックス化」とか unboxing を「ボックス化解除」って訳にしちゃうのは良くないと思うんですよ Unboxing and first impressions of Nokia's latest flagship Windows Phone, the Lumia 925 | Windows Phone Central

ボックス化 - Wikipedia ボックス化とボックス化解除 (C# プログラミング ガイド) ボックス化、ボックス化解除 - ぐるぐる~ KEN's .NET [IL5] ボックス化ってなんだ?

2013年06月12日

■_

時間がなかった。

■_

The D Programming Language Conference 2013 三日目のスライドのリンクが貼られ始めたのでチェック

■_

■_

Tips for Writing Functional Programming Tutorials 斜め読みしかしてないんだけど、 Don't talk about currying. なにこれw

2013年06月11日

■_

Amazon.co.jp: C for Programmers with an Introduction to C11 (Deitel Developer Series): Paul Deitel, Harvey Deitel: 洋書 の Kindle 版のサンプルを読んだのだけど、 頭の方なのであまりそそられるものがなかったw とはいえコラムなんかは興味深いものがあった。 で、買う気はそれなりにあるんだけど pbookだと5400円くらいでkindle版だと3000円ちょっと。 これがDRMフリーで、他のフォーマットも別途の支払いなしに入手できるという pragprog みたいなものだったら悩むこともないんだけど、 制限付きだともうちょっと安くしてくれないかなあなどと思ってしまったり。

■_ -> → .

5でも演算子の入れ替えやっちゃう? [PATCH] use dots - allow '.' instead of '->' everywhere and concatwith '

折角なのでコード部分の差分を見てみよう

[PATCH] use dots - allow '.' instead of '->' everywhere and concatwith '

As discussed at YAPC, this patch adds the pragma "use dots" allowing users to
write . instead of -> in all places.  Infix ~ (a la Perl 6) provides string
concatenation.

To any skeptics, I suggest you find a nice big OO module of your own and
globally replace arrows with dots, then just look at it.  You'll be amazed
how much easier it is to read (and write) modern Perl this way.

Under "use dots", "->" is disallowed by default to avoid user confusion.
Any user who uses dots will also be reading a lot of code that doesn't.  We
want any arrows present to be a signal that dot is concatenation.  In cases
where intermixing is Really Wanted, "use dots 'mixed'" is available, but not
recommended.

Incidentally, Leon Brocard had the same basic idea a few years ago, but his
implementation didn't mature.  For example, it looks like it wouldn't
properly handle autoquoting of method names.  Also, he made it a feature.
This seems good at first, but we don't want "use v5.20" to imply "use dots".

This patch is also pushed in branch "chip/dots".

diff --git a/toke.c b/toke.c
index d3bc457..b3f6824 100644
--- a/toke.c
+++ b/toke.c
@@ -4585,6 +4585,23 @@ S_word_takes_any_delimeter(char *p, STRLEN len)
 	    (p[0] == 'q' && strchr("qwxr", p[1]))));
 }
 
+/* coordinate with dots.pm */
+
+#define HINT_DOTS_ENABLED 0x00000001
+#define HINT_DOTS_MIXED   0x00000002
+
+#define hint_dots()  S_hint_dots(aTHX)
+STATIC U32
+S_hint_dots(pTHX) {
+    HV * const hinthv = GvHV(PL_hintgv);
+    if (hinthv) {
+        SV ** const svp = hv_fetchs(hinthv, "dots", FALSE);
+        if (svp)
+            return SvUV(*svp);
+    }
+    return 0;
+}
+
 /*
   yylex
 
@@ -5613,40 +5630,41 @@ Perl_yylex(pTHX)
 		s = --PL_bufptr;
 	    }
 	}
-	{
-	    const char tmp = *s++;
-	    if (*s == tmp) {
-		s++;
-		if (PL_expect == XOPERATOR)
-		    TERM(POSTDEC);
-		else
-		    OPERATOR(PREDEC);
-	    }
-	    else if (*s == '>') {
-		s++;
-		s = SKIPSPACE1(s);
-		if (isIDFIRST_lazy_if(s,UTF)) {
-		    s = force_word(s,METHOD,FALSE,TRUE,FALSE);
-		    TOKEN(ARROW);
-		}
-		else if (*s == '$')
-		    OPERATOR(ARROW);
-		else
-		    TERM(ARROW);
-	    }
-	    if (PL_expect == XOPERATOR) {
-		if (*s == '=' && !PL_lex_allbrackets &&
-			PL_lex_fakeeof >= LEX_FAKEEOF_ASSIGN) {
-		    s--;
-		    TOKEN(0);
-		}
-		Aop(OP_SUBTRACT);
+	s++;
+	if (*s == '-') {
+	    s++;
+	    if (PL_expect == XOPERATOR)
+		TERM(POSTDEC);
+	    else
+		OPERATOR(PREDEC);
+	}
+	else if (*s == '>') {
+	    s++;
+	    if ((hint_dots() & (HINT_DOTS_ENABLED|HINT_DOTS_MIXED)) == HINT_DOTS_ENABLED)
+	        Perl_croak(aTHX_ "use dots in effect; replace '->' with '.'");
+	  arrow:
+	    s = SKIPSPACE1(s);
+	    if (isIDFIRST_lazy_if(s,UTF)) {
+		s = force_word(s,METHOD,FALSE,TRUE,FALSE);
+		TOKEN(ARROW);
 	    }
-	    else {
-		if (isSPACE(*s) || !isSPACE(*PL_bufptr))
-		    check_uni();
-		OPERATOR('-');		/* unary minus */
+	    else if (*s == '$')
+		OPERATOR(ARROW);
+	    else
+		TERM(ARROW);
+	}
+	if (PL_expect == XOPERATOR) {
+	    if (*s == '=' && !PL_lex_allbrackets &&
+	    	PL_lex_fakeeof >= LEX_FAKEEOF_ASSIGN) {
+		s--;
+		TOKEN(0);
 	    }
+	    Aop(OP_SUBTRACT);
+	}
+	else {
+	    if (isSPACE(*s) || !isSPACE(*PL_bufptr))
+		check_uni();
+	    OPERATOR('-');		/* unary minus */
 	}
 
     case '+':
@@ -5746,7 +5764,10 @@ Perl_yylex(pTHX)
 	    Eop(OP_SMARTMATCH);
 	}
 	s++;
-	OPERATOR('~');
+        if (PL_expect == XOPERATOR && (hint_dots() & HINT_DOTS_ENABLED))
+            Aop(OP_CONCAT);
+        else
+            OPERATOR('~');
     case ',':
 	if (!PL_lex_allbrackets && PL_lex_fakeeof >= LEX_FAKEEOF_COMMA)
 	    TOKEN(0);
@@ -6693,11 +6714,13 @@ Perl_yylex(pTHX)
 		    pl_yylval.ival = 0;
 		OPERATOR(DOTDOT);
 	    }
-	    if (*s == '=' && !PL_lex_allbrackets &&
-		    PL_lex_fakeeof >= LEX_FAKEEOF_ASSIGN) {
-		s--;
-		TOKEN(0);
-	    }
+            if (hint_dots() & HINT_DOTS_ENABLED)
+                goto arrow;
+            if (*s == '=' && !PL_lex_allbrackets &&
+                    PL_lex_fakeeof >= LEX_FAKEEOF_ASSIGN) {
+                s--;
+                TOKEN(0);
+            }
 	    Aop(OP_CONCAT);
 	}
 	/* FALL THROUGH */

差分以外のところも見ないと…という部分もあるけどまあ想像できる感じ?

■_ コードの重さ

コードに重さがあるとは?

The weight of code | The Endeavour

Bjorn is discussing the ferrite core memory of the Apollo guidance system.

    These are very, very robust memory systems. … But the problem is that they actually have weight to them.
    Core memory actually weighs a bunch, so when you’re writing your program for the lunar module … every
    line of code that you wrote had a consequence in weight. And you could measure how heavy your code was at
    the end of a compile line. … It’s an interesting analogy to keep in mind because in fact even today our
    code has weight. It doesn’t really have physical weight … Our code has psychological weight because
    every line of code we write has to be maintained. It has to be supported. It has to be operated.
  

つまり、コアメモリを使っていたのでプログラム(コード)が大きくなると、 それを収めるためのコアも増えてその重さが…と。 磁気コアメモリ - Wikipedia

元記事にはビデオのリンクもありまする。

コアメモリ、大学の講義で現物をみた記憶が。 使用済みのものを一部分切り取ったものでしたが。 稼働しているものを見たことはない。はず。

■_ Java は

このところすっかり嫌われ者の位置に置かれている感じのするJava ですが 学ぶ価値あるよなぜなら…ということで色々と

Why Java is still relevant — I.M.H.O. — Medium

Why Java is still relevant

Or why it’s not a bad idea learning it even if you hate it

Java is probably one of the most “love to hate” languages out there. According to this HN poll it is the
2nd most hated language among the poll participants (statistically insignificant, but still noteworthy),
only 2 points behind PHP. Certainly not a great place to be.

There are many reasons why not to like Java, but there are also quite a few good reasons to learn it, even
if you don’t like it. Actually there is an increasing number of reasons to start trying to like it again,
or at least to hate it less.

So here are a few reasons why I think Java is still relevant for learning:

X uses it (where X = Google, Amazon, Square etc…)

Google is using Java widely, and contributed a lot to the ecosystem (Google Guava, GWT, Guice etc). So if
you want to work for Google, knowing Java will not be a hindrance.

The same applies for other big names, such as Amazon, Netflix, EBay, Linkedin etc. Some known startups also
use Java as their main stack such as Square, Yammer etc.

Knowing Java will probably be considered a benefit if you want to work for any of these companies, and many others.

It’s not your grandmother’s Java anymore

From Java 8, you’ll be able to use lambda expressions, for example:

  Stream.of(1, 2, 3, 4, 5, 6, 7)
   .map(x -> x * x).filter(x -> x % 2 == 0)
   .reduce(0, (sum, x) -> sum + x);

Yep, this is Java above. Coming soon to a theater near you.

(ざっくり略)

Conclusion

Java is still around, live and kicking, and still evolving. Writing it off completely as obsolete is not
something that will benefit any developer. You don’t have to like it in order to learn it, but there are
more and more reasons that help you even like it a little.

Also sometimes knowing how things are done the wrong way might help you know how to do it right.

■_


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

ホームへ


リンクはご自由にどうぞ

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