Warning: this is a rant.
Warning: you have been warned.
Note: actually worthwhile content starts in the second subsection. You are free to skip the first one.
It's great for beginners. Then it turns into a mess.
ASDFではソースファイルを扱うためにいちいちコンポーネントとして登録する必要があり、ディレクトリ中のすべてのソースファイルをまとめて扱うという機能がない。これはpackage-inferred-systemを使った場合も同じで、ASDFが.asdファイルから特定のソースファイルに辿りつくためにはどこかでファイル名を指定する必要がある。この点について、ASDFの拡張を考える。
最初にpackage-inferred-systemを使わない場合(例はfoo.asd)を扱い、その後でpackage-inferred-systemの拡張(例はfoo-infer.asd)について検討する。
このようなコンポーネントはmodule
のサブクラスとして簡単に書ける。ただ、foo.asdでの実装はやや単純すぎるか。実用するとしたら、初回のcomponent-children
の呼び出しでchildren
スロットに結果を保持しておき、2回目以降は、既存のcl-source-file
については新しいオブジェクトを作らないようにするべきだろう。
:recursive t
オプションで、直下だけでなく再帰的にソースファイルを収集するというデザインもありかもしれない。この文章は、 Steve Losh 氏の記事 "A Road to Common Lisp" の翻訳です。
原文はこちらです: http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/
A Road to Common Lisp (Common Lisp への道)
これまで、「最近のCommon Lispをどう学ぶとよいでしょう?」と助言を求めるメールをたくさん受け取ってきました。そこで私は、これまでメールやソーシャルメディアに投稿した全てのアドバイスを書き下すことにしました。これが誰かに有益ならば幸いです。
Libuv and libev, two I/O libraries with similar names, recently had the privilege to use both libraries to write something. Now let's talk about my own subjective expression of common and different points.
The topic of high-performance network programming has been discussed. Asynchronous, asynchronous, or asynchronous. Whether it is epoll or kqueue, it is always indispensable to the asynchronous topic.
Libuv is asynchronous, and libev is synchronous multiplexing IO multiplexing.
Libev is a simple encapsulation of system I/O reuse. Basically, it solves the problem of different APIs between epoll and kqueuq. Ensure that programs written using livev's API can run on most *nix platforms. However, the disadvantages of libev are also obvious. Because it basically just encapsulates the Event Library, it is inconvenient to use. For example, accept(3) requires manual setnonblocking after connection. EAGAIN, EWOULDBLOCK, and EINTER need to be detected when reading from a socket. This is a
(in-package :cl-user) | |
#| | |
(ql:quickload :chirp) | |
(setf chirp:*oauth-api-key* "**************************" | |
chirp:*oauth-api-secret* "***************************" | |
chirp:*oauth-access-token* "*******************************" | |
chirp:*oauth-access-secret* "***************************") | |
|# |
Basic unit type:
λ> replTy "()"
() :: ()
Basic functions:
To remove a submodule you need to:
This post also appears on lisper.in.
Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.
Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):
The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.
$ sudo apt-get install mysql-server mysql-client | |
... output omitted ... | |
$ sudo mysqladmin -u root -h localhost password 'password' | |
... output omitted ... | |
$ mysql -u root -p | |
... output omitted ... | |
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'your_host_name' IDENTIFIED BY "password"; | |
Query OK, 0 rows affected (0.00 sec) | |
mysql> FLUSH PRIVILEGES; |