<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mzp</author_name>
  <author_url>https://blog.hatena.ne.jp/mzp/</author_url>
  <blog_title>みずぴー日記</blog_title>
  <blog_url>https://mzp.hatenadiary.org/</blog_url>
  <categories>
    <anon>OCaml</anon>
    <anon>30分プログラム</anon>
  </categories>
  <description>30分プログラム、その183。camlp4で計算機をつくってみる。いきなりcamlp4をバリバリつかうのは大変そうなので、まずはパーサ部分だけをつかって計算機を作ってみた。 これは、パーサとして使うのもありかもしれない。ただ、どうも字句解析器をつくるのがえらい面倒そうなんだよなぁ。 使い方 $ ./p4 &quot;1+4*2&quot; 9 $ ./p4 42 42 ソースコード (* ocamlc -pp 'camlp4o pa_extend.cmo' -I +camlp4 gramlib.cma 183-p4.ml *) let (@@) f g = f g let ($) f g x = f (g x) …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmzp.hatenadiary.org%2Fentry%2F20071114%2Fexp&quot; title=&quot;camlp4で四則演算。 - みずぴー日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2007-11-14 00:00:00</published>
  <title>camlp4で四則演算。</title>
  <type>rich</type>
  <url>https://mzp.hatenadiary.org/entry/20071114/exp</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
