<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-12373518</id><updated>2011-04-22T12:04:43.786+09:00</updated><title type='text'>lethevert should not be capitalized</title><subtitle type='html'>a blog of a programmer of Concurrent Clean</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>91</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12373518.post-5319444513683158548</id><published>2007-09-17T23:30:00.000+09:00</published><updated>2007-09-17T23:40:29.141+09:00</updated><title type='text'>Clean: Hashtable and Heap</title><content type='html'>I implemented hashtables and heaps in clean.&lt;br /&gt;Hashtables are data structures to store pairs of keys and values and to search values with given keys in a efficient way.&lt;br /&gt;Heaps are data structures to store values and retrieve them in a decreasing (or increasing) order.&lt;br /&gt;Both data structures have unique types because they are imperative data structures&lt;br /&gt;repository: &lt;a href="https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/Data/"&gt;https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/Data/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-5319444513683158548?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/5319444513683158548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=5319444513683158548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/5319444513683158548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/5319444513683158548'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/09/clean-hashtable-and-heap.html' title='Clean: Hashtable and Heap'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-6172401085304978559</id><published>2007-09-08T21:24:00.000+09:00</published><updated>2007-09-08T22:53:54.137+09:00</updated><title type='text'>Clean : PartialReader</title><content type='html'>I created PartialReader module using Reference type.&lt;br /&gt;&lt;a href="https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/IO/" &gt;https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/IO/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The following program is a program which read each line from a given file and write the first 10 lines to standard output.&lt;br /&gt;&lt;pre&gt;module Test&lt;br /&gt;extension for-notation&lt;br /&gt;&lt;br /&gt;import File, StdIO, List, System&lt;br /&gt;&lt;br /&gt;Start w&lt;br /&gt;  = for w&lt;br /&gt;      ? Pass f &lt;- openFileReader path&lt;br /&gt;      out &lt;- stdio&lt;br /&gt;      (ls,f) = readLines f&lt;br /&gt;      out = loop 1 (take 10 ls) out&lt;br /&gt;      ? PassV &lt;- close out&lt;br /&gt;      ? PassV &lt;- close f&lt;br /&gt;      return&lt;br /&gt;    except (Fail msg)&lt;br /&gt;      return&lt;br /&gt;  where&lt;br /&gt;    path = getCommandLine.[1]&lt;br /&gt;&lt;br /&gt;loop n [] out = out&lt;br /&gt;loop n [a:aa] out&lt;br /&gt;  = for out&lt;br /&gt;      ? PassV &lt;- write n $&gt; write " =&gt; " $&gt; writeln a&lt;br /&gt;      continue loop (n + 1) aa&lt;br /&gt;    except (Fail msg)&lt;br /&gt;      return&lt;br /&gt;&lt;/pre&gt;This program works well for a small file. It reads one line, writes the line and repeats the process 10 times. In favor of lazy evaluation strategy, it uses no more memory than to hold only one line.&lt;br /&gt;However, it is not suitable for a large file because it reads not only the first 10 lines but also all of the remaining lines before closing the file handle. PartialReader module is a solution for the problem.&lt;br /&gt;PartialReader module internally uses Reference module and separates a reader handle and a close handle out of the given input stream. The new reader handle is used only for reading bytes and the new close handle only for closing the handle.&lt;br /&gt;PartialReader module defines a useful function 'partialReadLines' that takes an input stream and returns all the lines of the stream and a close handle of the stream. Because both of the return values are lazy ones, unnecessary read actions does not take place.&lt;br /&gt;&lt;pre&gt;Start w&lt;br /&gt;  = for w&lt;br /&gt;      ? Pass f &lt;- openFileReader path&lt;br /&gt;      out &lt;- stdio&lt;br /&gt;      (ls,f) = partialReadLines f // &lt;- change only this line and unnecessary read actions will not take place.&lt;br /&gt;      out = loop 1 (take 10 ls) out&lt;br /&gt;      ? PassV &lt;- close out&lt;br /&gt;      ? PassV &lt;- close f&lt;br /&gt;      return&lt;br /&gt;    except (Fail msg)&lt;br /&gt;      return&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-6172401085304978559?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/6172401085304978559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=6172401085304978559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/6172401085304978559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/6172401085304978559'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/09/clean-partialreader.html' title='Clean : PartialReader'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-2848719255860702629</id><published>2007-09-06T09:09:00.000+09:00</published><updated>2007-09-06T09:22:40.080+09:00</updated><title type='text'>Clean: Alternative Environment</title><content type='html'>I am now working on creating AltEnv library which redefines StdEnv and other libraries so that we can use Clean in some smarter way.&lt;br /&gt;&lt;br /&gt;Most of basic value operations are inherited directly from StdEnv. So is Maybe type.&lt;br /&gt;List functions are redefined so that lazy list and strict lists can be manipulated in the same functions.&lt;br /&gt;I defined deque operations and integrate operations for list and array in the same type classes.&lt;br /&gt;Functions of standard IO and file IO are redefined. In the original version those handles are all of the same type but I think the types of those handles should be distinguished and I redefined them in the way.&lt;br /&gt;&lt;br /&gt;You can get the library in the subverson repository: &lt;a href="https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/"&gt;https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-2848719255860702629?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/2848719255860702629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=2848719255860702629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/2848719255860702629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/2848719255860702629'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/09/clean-alternative-environment.html' title='Clean: Alternative Environment'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-8174198619079379553</id><published>2007-08-19T21:12:00.000+09:00</published><updated>2007-08-19T21:43:09.521+09:00</updated><title type='text'>Clean: Finger trees and String2</title><content type='html'>I made an implementation of Finger trees algorithm in Clean.&lt;br /&gt;Finger trees are persistent sequence data structures which support access to the ends in amortized constant time and concatenation and splitting in time logarithmic in the size of the smaller piece. see &lt;a href="http://www.soi.city.ac.uk/~ross/papers/FingerTree.html"&gt;http://www.soi.city.ac.uk/~ross/papers/FingerTree.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As an application I also made an alternative implementation for string representation. Its performance of manipulating ordinary size strings is only 1.5 to 2 times slower than that of arrays of chars and that for long strings much more efficient.&lt;br /&gt;The idea of creating an efficient string representation for long strings is inspired by the ICFP contest 2007.&lt;br /&gt;&lt;br /&gt;FinterTree module is available at &lt;a href="https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/Data/"&gt;https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/Data/&lt;/a&gt;.&lt;br /&gt;String2 module is available at &lt;a href="https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/Text/"&gt;https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/AltEnv/Text/&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-8174198619079379553?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/8174198619079379553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=8174198619079379553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/8174198619079379553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/8174198619079379553'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/08/finger-trees-and-string2.html' title='Clean: Finger trees and String2'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-1722847666116249410</id><published>2007-08-12T21:37:00.000+09:00</published><updated>2007-08-12T21:48:45.664+09:00</updated><title type='text'>Clean : for-notation</title><content type='html'>A new extension for CleanX was released. It is for-notation extension.&lt;br /&gt;The extension helps writing programs with unique typing.&lt;br /&gt;&lt;br /&gt;Here is a sample program.&lt;br /&gt;&lt;pre&gt;hello f =&lt;br /&gt;    for f&lt;br /&gt;      fwrites "your name? "&lt;br /&gt;      s &lt;- freadline&lt;br /&gt;      s = chop s&lt;br /&gt;      fwrites "Hello, " $&gt; s $&gt; newline&lt;br /&gt;      return&lt;br /&gt;&lt;/pre&gt;This program will be interpreted as the following.&lt;br /&gt;&lt;pre&gt;hello f # f = f |&gt; fwrites "your name? "&lt;br /&gt;          (s,f) = f |&gt; freadline&lt;br /&gt;          s = chop s&lt;br /&gt;          f = f |&gt; fwrites "Hello, " $&gt; s $&gt; newline&lt;br /&gt;        = f&lt;br /&gt;&lt;/pre&gt;See more details at the site: &lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/install/Linux/CleanX/"&gt;installation of CleanX&lt;/a&gt;, &lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/CleanX/ext/for-notation/"&gt;features of for-notation&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-1722847666116249410?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/1722847666116249410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=1722847666116249410' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/1722847666116249410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/1722847666116249410'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/08/clean-for-notation.html' title='Clean : for-notation'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-8223285366310244663</id><published>2007-08-01T23:14:00.000+09:00</published><updated>2007-08-01T23:16:24.514+09:00</updated><title type='text'>Wrong subversion repository url</title><content type='html'>The url I previously wrote in this blog as my subversion repository url was found wrong.&lt;br /&gt;The correct one is &lt;a href="https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv"&gt;https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-8223285366310244663?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/8223285366310244663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=8223285366310244663' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/8223285366310244663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/8223285366310244663'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/08/wrong-subversion-repository-url.html' title='Wrong subversion repository url'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-8155890970159910386</id><published>2007-07-31T00:04:00.000+09:00</published><updated>2007-07-31T00:10:01.893+09:00</updated><title type='text'>Clean Wiki</title><content type='html'>I posted several issues to Clean Wiki these days.&lt;br /&gt;&lt;br /&gt;Installation&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/install/Linux/Clean/"&gt;Clean system&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/install/Linux/Directory/"&gt;Directory library&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/install/Linux/OptEnv/"&gt;OptEnv library&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/install/Linux/CleanX/"&gt;CleanX system (preprocessor)&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/install/Linux/MySQL/"&gt;MySQL 5.0 binding library&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/install/Linux/SQLite/"&gt;SQLite 3 binding library&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Usage of CleanX&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/CleanX/usage/"&gt;General usage&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/CleanX/ext/html/"&gt;HTML extension&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/view/CleanX/ext/for-notation/"&gt;for-notation extension&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-8155890970159910386?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/8155890970159910386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=8155890970159910386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/8155890970159910386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/8155890970159910386'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/07/clean-wiki_31.html' title='Clean Wiki'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-3445880157533858972</id><published>2007-07-01T14:13:00.000+09:00</published><updated>2007-07-01T14:31:46.576+09:00</updated><title type='text'>Clean Wiki</title><content type='html'>I opened a Clean Wiki site which I will accumulate some information related to Clean. Perhaps some will be in Japanese and others in English.&lt;br /&gt;&lt;a href="http://cleanoptenv.sourceforge.jp/wiki/"&gt;http://cleanoptenv.sourceforge.jp/wiki/&lt;/a&gt;&lt;br /&gt;This site is written in Clean. I created some libraries for this purpose, such as&lt;br /&gt;&lt;ul&gt;&lt;li&gt;CGI parser&lt;br /&gt;&lt;/li&gt;&lt;li&gt;SQLite3 Binding&lt;br /&gt;&lt;/li&gt;&lt;li&gt;MySQL5.0 Binding&lt;br /&gt;&lt;/li&gt;&lt;li&gt;HTML templating preprocessor&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;All those libraries are available from my subversion repository.&lt;br /&gt;&lt;a href="https://svn.sourceforge.net/svnroot/cleanoptenv"&gt;https://svn.sourceforge.net/svnroot/cleanoptenv&lt;/a&gt;&lt;br /&gt;Using HTML templating preprocessor, I can write HTML tags within Clean programs. A sample code below;&lt;br /&gt;&lt;pre&gt;vTitles :: ![TitleInfo] -&amp;gt; HtmlData&lt;br /&gt;vTitles tis = body $ HtmlData $ map (\{ti_title} = title ti_title) tis&lt;br /&gt;  where&lt;br /&gt;    body data =&lt;br /&gt;        __HTMLSTART__&lt;br /&gt;        &amp;lt;div id="sidebar"&amp;gt;&lt;br /&gt;        &amp;lt;% data %&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;        __HTMLEND__&lt;br /&gt;&lt;br /&gt;    title t = let urlTitle = mkUrlTitle t in&lt;br /&gt;        __HTMLSTART__&lt;br /&gt;        &amp;lt;a href="&amp;lt;% ROOT %&amp;gt;view/&amp;lt;% urlTitle %&amp;gt;"&amp;gt;&amp;lt;% HtmlText t %&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        __HTMLEND__&lt;br /&gt;&lt;/pre&gt;It makes the code much easier to write, read and maintenance.&lt;br /&gt;I am thinking that such and other syntactic transformation via preprocessing will enables programming much easier. I create CleanX preprocessing framework for this purpose.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-3445880157533858972?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/3445880157533858972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=3445880157533858972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/3445880157533858972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/3445880157533858972'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/07/clean-wiki.html' title='Clean Wiki'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-1408911910487429840</id><published>2007-06-04T23:11:00.000+09:00</published><updated>2007-06-04T23:23:10.627+09:00</updated><title type='text'>Concurrent Clean: Unique Typing, Covariance, Contravariance, and Abstract Type</title><content type='html'>We must keep in mind that covariance/contravariance matters are along with unique typing in function types.&lt;br /&gt;Let us think about the following code:&lt;br /&gt;&lt;pre&gt;::R a b :== .(a -&gt; b)&lt;br /&gt;&lt;br /&gt;createR :: *Char -&gt; *(R Int *Char)&lt;br /&gt;createR c = (\i = c)&lt;br /&gt;&lt;br /&gt;f :: u:(R Int *Char) -&gt; u:(R *Int Char)&lt;br /&gt;f r = r&lt;br /&gt;&lt;br /&gt;Start = f (createR 'a')&lt;/pre&gt;&lt;br /&gt;You should look at the type of function 'f' which indicates the covariance of function parameters.&lt;br /&gt;That is why unique abstract type cannot be coerced into non-uniqueness. Look at the following code:&lt;br /&gt;&lt;pre&gt;::R&lt;br /&gt;&lt;br /&gt;createR :: Int -&gt; *R&lt;br /&gt;&lt;br /&gt;f :: *R -&gt; R&lt;br /&gt;f r = r&lt;br /&gt;&lt;br /&gt;Start = f (createR 1)&lt;/pre&gt;&lt;br /&gt;The code is not valid because there are no information deciding whether the abstract type R is covariant or contravariant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-1408911910487429840?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/1408911910487429840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=1408911910487429840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/1408911910487429840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/1408911910487429840'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/06/concurrent-clean-unique-typing.html' title='Concurrent Clean: Unique Typing, Covariance, Contravariance, and Abstract Type'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-2899485024941924178</id><published>2007-05-01T22:56:00.000+09:00</published><updated>2007-05-01T23:08:48.645+09:00</updated><title type='text'>MySQL binding is ready!</title><content type='html'>I finished my first work of making MySQL binding. It supports simple operation for MySQL database.&lt;br /&gt;You can get it from subversion repository at https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk. You need to download DB/MySQL as well as OptEnv.&lt;br /&gt;I show a sample program below.&lt;br /&gt;&lt;br /&gt;Main.icl&lt;pre&gt;module Main&lt;br /&gt;&lt;br /&gt;import MySQL, StdDebug&lt;br /&gt;&lt;br /&gt;Start w # (mConn,w) = MySQLOpen host port db user pass [] w&lt;br /&gt;        = case mConn of&lt;br /&gt;            Fail e = trace_n e w&lt;br /&gt;            Pass conn&lt;br /&gt;              # (mStmt,conn) = sqlOpenStatement sql [] conn&lt;br /&gt;                conn = case mStmt of&lt;br /&gt;                         Fail e = trace_n e conn&lt;br /&gt;                         Pass stmt&lt;br /&gt;                           # stmt = run stmt&lt;br /&gt;                             (mErr,conn) = sqlCloseStatement stmt conn&lt;br /&gt;                           = case mErr of&lt;br /&gt;                               Nothing = conn&lt;br /&gt;                               Just e  = trace_n e conn&lt;br /&gt;                (mErr,w) = sqlClose conn w&lt;br /&gt;              = case mErr of&lt;br /&gt;                  Nothing = w&lt;br /&gt;                  Just e  = trace_n e w&lt;br /&gt;  where&lt;br /&gt;    host = "localhost"&lt;br /&gt;    port = 0&lt;br /&gt;    db   = "cleanoptenv"&lt;br /&gt;    user = "lethevert"&lt;br /&gt;    pass = "lethevert"&lt;br /&gt;    sql = "SELECT * FROM TBL1 WHERE STR = ? AND NUM = ?"&lt;br /&gt;    run stmt&lt;br /&gt;        # (mErr,stmt) = sqlBind [SQL_TEXT "Hello", SQL_INT 1] stmt&lt;br /&gt;        = case mErr of&lt;br /&gt;            Just e = trace_n e stmt&lt;br /&gt;            Nothing&lt;br /&gt;              # (mErr,stmt) = sqlQuery stmt&lt;br /&gt;              = case mErr of&lt;br /&gt;                  Just e = trace_n e stmt&lt;br /&gt;                  Nothing&lt;br /&gt;                    # (cols,stmt) = sqlColumns stmt&lt;br /&gt;                      stmt = showCols (size cols) cols stmt&lt;br /&gt;                    = each stmt&lt;br /&gt;    showCols :: !Int !{!String} !*MySQLStmt -&gt; *MySQLStmt&lt;br /&gt;    showCols 0 cols stmt = stmt&lt;br /&gt;    showCols idx cols stmt = let nidx = dec idx&lt;br /&gt;                             in showCols nidx cols (trace_n cols.[nidx] stmt)&lt;br /&gt;    each :: !*MySQLStmt -&gt; *MySQLStmt&lt;br /&gt;    each stmt&lt;br /&gt;        # (mNext,stmt) = sqlFetch stmt&lt;br /&gt;        = case mNext of&lt;br /&gt;            Fail e = trace_n e stmt&lt;br /&gt;            Pass False = stmt&lt;br /&gt;            Pass True # (mData,stmt) = sqlResults stmt&lt;br /&gt;                      = case mData of&lt;br /&gt;                          Fail e = trace_n e stmt&lt;br /&gt;                          Pass data # stmt = showResults (size data) data stmt&lt;br /&gt;                                    = each stmt&lt;br /&gt;    showResults 0 data stmt = stmt&lt;br /&gt;    showResults idx data stmt = let nidx = dec idx&lt;br /&gt;                                in showResults nidx data (trace_n data.[nidx] stmt)&lt;br /&gt;&lt;/pre&gt;mysql.lo&lt;pre&gt;-lmysqlclient&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To compile the program, enter the following command:&lt;br /&gt;&lt;pre&gt;clm -sl mysql Main -o Main&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-2899485024941924178?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/2899485024941924178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=2899485024941924178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/2899485024941924178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/2899485024941924178'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/05/mysql-binding-is-ready.html' title='MySQL binding is ready!'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-9013965406627055351</id><published>2007-04-27T22:05:00.000+09:00</published><updated>2007-04-27T23:05:32.124+09:00</updated><title type='text'>Concurrent Clean : Reference Type</title><content type='html'>Two days ago I was thinking about how to implement lazy IO in general way. I worked out the code below;&lt;br /&gt;&lt;pre&gt;    # (ls,inF) = readlines inF&lt;br /&gt;      outF = writelines (take 10 ls) outF&lt;/pre&gt;&lt;br /&gt;It is sure that this program's input and output are performed in turn. But it has a problem. When closing inF file handle, the remaining input actions will be performed, and it is very inefficient if the input file is very long.&lt;br /&gt;If I change the structure of the program I can achieve disirable characteristics but it reduces the virtue of pure functional programing style.&lt;br /&gt;The reference type is the solution, which I finally reached. The combination of pure functional programming and reference type seems paradoxical but Clean's uniqueness typing enables it.&lt;br /&gt;Reference type has three characteristics;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;its value is updated according not to lexical order but to runtime order&lt;br /&gt;&lt;/li&gt;&lt;li&gt;it can be copied but not shared&lt;br /&gt;&lt;/li&gt;&lt;li&gt;its value is accessed safely in semantics with uniqueness type&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The data type is an abstract data type.&lt;br /&gt;&lt;pre&gt;::*Ref a&lt;/pre&gt;&lt;br /&gt;The basic operaions include&lt;br /&gt;&lt;ul&gt;&lt;li&gt;refer :: !.a -&gt; *(Ref .a)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;copy :: !*(Ref .a) -&gt; (!*(Ref .a), !*(Ref .a))&lt;br /&gt;&lt;/li&gt;&lt;li&gt;apply :: !.(.a -&gt; .a) !*(Ref .a) -&gt; *(Ref .a)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;access :: !.(.a -&gt; (.b,.a)) !*(Ref .a) -&gt; (!.b, !*(Ref .a))&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The program below is a sample of coroutine communicating each other using reference type.&lt;br /&gt;&lt;pre&gt;Start w&lt;br /&gt;    # (ri1,ri2) = copy (refer 1)&lt;br /&gt;      ls1 = process 1 ri1&lt;br /&gt;      ls2 = process 2 ri2&lt;br /&gt;      ls = interleave ls1 ls2&lt;br /&gt;    = take 10 ls&lt;br /&gt;&lt;br /&gt;process a ri&lt;br /&gt;    # (e,ri) = access f ri&lt;br /&gt;    = [e:process a ri]&lt;br /&gt;  where&lt;br /&gt;    f i = (i,i+a)&lt;br /&gt;&lt;br /&gt;interleave [a:aa] bb&lt;br /&gt;    = [a:interleave bb aa]&lt;/pre&gt;&lt;br /&gt;It produces&lt;br /&gt;&lt;pre&gt;[1,2,4,5,7,8,10,11,13,14]&lt;/pre&gt;&lt;br /&gt;The module of the reference type implementation is OptReference, which is found in the subversion repository at https://cleanoptenv.svn.sourceforge.net/svnroot/cleanoptenv/trunk/OptEnv.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-9013965406627055351?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/9013965406627055351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=9013965406627055351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/9013965406627055351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/9013965406627055351'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/04/concurrent-clean-reference-type.html' title='Concurrent Clean : Reference Type'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-6421308180651066550</id><published>2007-03-21T19:54:00.000+09:00</published><updated>2007-03-21T19:59:49.961+09:00</updated><title type='text'>Concurrent Clean : CGI test</title><content type='html'>I am trying to create CGI by Clean.&lt;br /&gt;I succeeded receiving CGI parameters from web pages.&lt;br /&gt;These are samples:&lt;ul&gt;&lt;li&gt;GET method: &lt;a href="http://cleanoptenv.sourceforge.jp/form/"&gt;http://cleanoptenv.sourceforge.jp/form/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;POST method: &lt;a href="http://cleanoptenv.sourceforge.jp/formpost/"&gt;http://cleanoptenv.sourceforge.jp/formpost/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-6421308180651066550?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/6421308180651066550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=6421308180651066550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/6421308180651066550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/6421308180651066550'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/03/concurrent-clean-cgi-test.html' title='Concurrent Clean : CGI test'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-3414869840740690761</id><published>2007-03-04T14:46:00.000+09:00</published><updated>2007-03-04T15:21:53.998+09:00</updated><title type='text'>Concurrent Clean : not to wait at the end of the execution of Clean program</title><content type='html'>use this patch file.&lt;br /&gt;&lt;pre&gt;--- wcon.c 2006-06-07 19:06:02.000000000 +0900&lt;br /&gt;+++ wcon.c.new 2007-03-04 14:34:24.000000000 +0900&lt;br /&gt;@@ -1723,11 +1723,11 @@&lt;br /&gt; &lt;br /&gt; #ifdef WINDOWS&lt;br /&gt; # if 1&lt;br /&gt;- if ( (!(flags &amp; NO_RESULT_MASK) || (flags &amp; SHOW_EXECUTION_TIME_MASK) || execution_aborted || (console_window_visible &amp;&amp; !console_allocated) ) &amp;&amp; !console_flag)&lt;br /&gt;+// if ( (!(flags &amp; NO_RESULT_MASK) || (flags &amp; SHOW_EXECUTION_TIME_MASK) || execution_aborted || (console_window_visible &amp;&amp; !console_allocated) ) &amp;&amp; !console_flag)&lt;br /&gt; # else&lt;br /&gt;- if ( (!(flags &amp; NO_RESULT_MASK) || (flags &amp; SHOW_EXECUTION_TIME_MASK) || execution_aborted) &amp;&amp; !console_flag)&lt;br /&gt;+// if ( (!(flags &amp; NO_RESULT_MASK) || (flags &amp; SHOW_EXECUTION_TIME_MASK) || execution_aborted) &amp;&amp; !console_flag)&lt;br /&gt; # endif&lt;br /&gt;-  wait_for_key_press();&lt;br /&gt;+//  wait_for_key_press();&lt;br /&gt; &lt;br /&gt;  if (std_output_to_file)&lt;br /&gt;   flush_file_buffer (&amp;file_table[1]);&lt;/pre&gt;&lt;br /&gt;and execute 'build_windows_object_files.sh.'&lt;br /&gt;Not to use makefile, which is broken.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-3414869840740690761?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/3414869840740690761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=3414869840740690761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/3414869840740690761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/3414869840740690761'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2007/03/concurrent-clean-makefile-in.html' title='Concurrent Clean : not to wait at the end of the execution of Clean program'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116596547621175645</id><published>2006-12-13T08:17:00.000+09:00</published><updated>2006-12-13T08:17:56.213+09:00</updated><title type='text'>'Practical Random Number Generation in Software'</title><content type='html'>&lt;a href="http://www.acsac.org/2003/abstracts/79.html"&gt;http://www.acsac.org/2003/abstracts/79.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The paper proposes solutions to many of the issues that real software-based random number infrastructures have encountered. It includes two main chapters: 4.PRGN Design and 5.Entropy Harvester Design.&lt;br /&gt;&lt;br /&gt;The 4th chapter 'PRNG Design' consists of 3 sections.&lt;br /&gt;&lt;br /&gt;The first section of the 4th chapter describes how to reseed a PRNG (pseudo-random number generator). There are two type of reseeding used and each has its own reason. The first type of reseed is called an external reseed whereas the second is called a self-reseed named for the origins of their seed.&lt;br /&gt;&lt;br /&gt;The second section alerts the danger of careless usage of fork() function. It also prescribes how to design a library to avoid such a danger.&lt;br /&gt;&lt;br /&gt;The third section discusses how to initialize PRNG safely. Some devices can be provided some entropy by users in setup time while others cannot.&lt;br /&gt;&lt;br /&gt;The 5th chapter 'Entropy Harvester Design' consists of 4 sections.&lt;br /&gt;&lt;br /&gt;The first section of the 5th chapter discusses various hash functions to whitening entropy before seeding to PRNG. It introduces a non-cryptgraphic hash function, hash127, which can also be useful for the purpose.&lt;br /&gt;&lt;br /&gt;The second section discusses about entropy estimation. First it points out some problems existing entropy estimators have. Then it discusses the usage of a general-purpose compression function for getting an upper bound on the amount of entropy. Finally it describes some aspects on how to use entropy estimators.&lt;br /&gt;&lt;br /&gt;The third section argues how to combine multiple entropy sources to seed PRNG.&lt;br /&gt;&lt;br /&gt;The forth section lists other considerations about entropy infrastructures.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116596547621175645?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116596547621175645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116596547621175645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116596547621175645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116596547621175645'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/12/practical-random-number-generation-in_12.html' title='&apos;Practical Random Number Generation in Software&apos;'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116579392235751989</id><published>2006-12-11T08:30:00.000+09:00</published><updated>2006-12-11T08:38:42.356+09:00</updated><title type='text'>'Computing ε-Free NFA from Regular Expressions in O(n log^2(n)) Time'</title><content type='html'>&lt;a href="http://citeseer.ist.psu.edu/471736.html"&gt;http://citeseer.ist.psu.edu/471736.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This paper shows a sequential algorithm to convert a regular expression of size n to an equivalent &amp;#949;-free NFA of size O(n log^2(n)) in time O(n log(n) + size of the output) while the previous algorithm takes roughly cubic time. It also shows a paralell algorithm performed in time O(log(n)) using O(n + (size of the output)/log(n)) processors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116579392235751989?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116579392235751989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116579392235751989' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116579392235751989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116579392235751989'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/12/computing-free-nfa-from-regular.html' title='&apos;Computing &amp;#949;-Free NFA from Regular Expressions in O(n log^2(n)) Time&apos;'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116579307738457037</id><published>2006-12-11T07:47:00.000+09:00</published><updated>2006-12-11T08:27:50.780+09:00</updated><title type='text'>'Translating Regular Expressions into Small ε-Free Nondeterministic Finit Automata'</title><content type='html'>&lt;a href="http://citeseer.ist.psu.edu/hromkovic97translating.html"&gt;http://citeseer.ist.psu.edu/hromkovic97translating.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This paper shows how to convert a regular expression of size n to an equivalent NFA of size O(n(log n)^2) in polynomial time. It also shows this construction is almost optimal by proving a lower bound of &amp;#937;(n log n) for a regular expression defined by (a1+&amp;#949;)(a2+&amp;#949;)...(aN+&amp;#949;).&lt;br /&gt;&lt;br /&gt;The starting point of this construction is what is called 'position automaton' and this new system is called 'common follow sets automaton.' The idea behind is to decompose the follow set of each position into some subsets. These subsets become the state of this automaton. The common use of subsets in the decomposition of different follow sets will give the desired complexity bounds.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116579307738457037?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116579307738457037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116579307738457037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116579307738457037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116579307738457037'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/12/translating-regular-expressions-into.html' title='&apos;Translating Regular Expressions into Small &amp;#949;-Free Nondeterministic Finit Automata&apos;'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116467284804338954</id><published>2006-11-28T08:58:00.000+09:00</published><updated>2006-11-28T09:14:54.473+09:00</updated><title type='text'>'Modern Information Retrieval' (2)</title><content type='html'>&lt;a href="http://www.ischool.berkeley.edu/~hearst/irbook/"&gt;http://www.ischool.berkeley.edu/~hearst/irbook/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have read chapter 6 and 7.&lt;br /&gt;&lt;br /&gt;Chapter 6 is rather a short chapter which includes metadata, entropy, text model, similarity model, markup languages (including sgml, html, xml) and multimedia formats.&lt;br /&gt;&lt;br /&gt;Chapter 7 introduces text operations. The contents are devided mainly into 2 part: document preprocessing and text compression. There are 5 operations illustrated related to document preprocessing: lexical analysis, stopwords, stemming, indexing and thesauri. The methods of text compressions are devided mainly into 3 part: statistical methods, dictionary methods and inverted file compression.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116467284804338954?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116467284804338954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116467284804338954' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116467284804338954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116467284804338954'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/11/modern-information-retrieval-2.html' title='&apos;Modern Information Retrieval&apos; (2)'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116363551994166855</id><published>2006-11-16T07:52:00.000+09:00</published><updated>2006-11-16T09:08:35.213+09:00</updated><title type='text'>'Towards a Strongly Typed Functional Operating System'</title><content type='html'>&lt;a href="http://citeseer.ist.psu.edu/642407.html"&gt;http://citeseer.ist.psu.edu/642407.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Famke is presented in this paper. It is a library for Clean that creates and manages threads and processes on a network of computers and communicates between them in a type sefe manner. Finally an interactive shell is introduced, which uses a functional-style command language and it type-checks the command line before performing it.&lt;br /&gt;&lt;br /&gt;Clean has a dynamic type system in addition to its static type system. It provides a type pattern and a run-time unification which helps communicating between different processes sometimes on different machines and reading and writing a file in a type safe manner.&lt;br /&gt;&lt;br /&gt;Though Clean has no feature to handle threads, Famke succeeds to implement threads using continuation. The implementation uses a cooperative scheduling and programs should explicitly yield. Then some monadic combinators are defined to hide an explicit yields in functions of return, &gt;&gt;= and &gt;&gt;.&lt;br /&gt;&lt;br /&gt;A program using threads or processes may fail because of external conditions. Exception is an elegant solution to deal with such errors. Though there is no exception handling mechanism in Clean, the thread implementation above can easily extend to include exceptions by adding another continuation to handle exceptional state. In addition exceptions are implemented with dynamics to deal with any type of error state in the same expression.&lt;br /&gt;&lt;br /&gt;Signals are also introduced for throwing and catching exceptions between different threads.&lt;br /&gt;&lt;br /&gt;Preemptive processes are implemented using Windows processes. A process can have multiple threads inside. Ports are introduced to communicate between processes. In contrast with M-vars and channels, ports have only one reader, the thread that create the port, and the restriction lowers complexity of administration and implementation. The actual sending/receiving of messages is done via Windows using the mail slot interface.&lt;br /&gt;&lt;br /&gt;Finally a shell is provided to interact with Famke library. It includes functional style commands, type safe redirection and interactive thread/process interfaces.&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;P.S.&lt;br /&gt;The shell implementation reminds me of the interactive shell of Erlang.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116363551994166855?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116363551994166855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116363551994166855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116363551994166855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116363551994166855'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/11/towards-strongly-typed-functional.html' title='&apos;Towards a Strongly Typed Functional Operating System&apos;'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116334300218625052</id><published>2006-11-12T23:48:00.000+09:00</published><updated>2006-11-12T23:50:02.200+09:00</updated><title type='text'>CGI by Clean</title><content type='html'>I made some CGI programs in Clean.&lt;br /&gt;&lt;br /&gt;show environment variables&lt;br /&gt;&lt;a href="http://cleanoptenv.sourceforge.net/query/1?query=1"&gt;http://cleanoptenv.sourceforge.net/query/1?query=1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;counter&lt;br /&gt;&lt;a href="http://cleanoptenv.sourceforge.net/count/"&gt;http://cleanoptenv.sourceforge.net/count/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116334300218625052?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116334300218625052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116334300218625052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116334300218625052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116334300218625052'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/11/cgi-by-clean.html' title='CGI by Clean'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116299376071011255</id><published>2006-11-08T22:44:00.000+09:00</published><updated>2006-11-08T22:50:51.253+09:00</updated><title type='text'>Optional Libraries and Preprocessors for Clean</title><content type='html'>Some libraries and preprocessors I made was published as 'Optional Libraries and Preprocessors for Clean' in the site &lt;a href="http://sourceforge.net/projects/cleanoptenv"&gt;http://sourceforge.net/projects/cleanoptenv&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It includes some text operation functions, a regular expression library, a html templating preprocessor and the like. I am planning to build a wiki-like CMS web application and on the way libraries and preprocessors I make will be added to the site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116299376071011255?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116299376071011255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116299376071011255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116299376071011255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116299376071011255'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/11/optional-libraries-and-preprocessors.html' title='Optional Libraries and Preprocessors for Clean'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116299335302623789</id><published>2006-11-08T22:18:00.000+09:00</published><updated>2006-11-08T22:43:12.670+09:00</updated><title type='text'>'Modern Information Retrieval' (1)</title><content type='html'>I am reading a book on information retrieval. What I choosed is &lt;a href="http://www.ischool.berkeley.edu/~hearst/irbook/"&gt;http://www.ischool.berkeley.edu/~hearst/irbook/&lt;/a&gt;. It is an elementary book presenting an over view of research in IR from a computer scientist's prespective.&lt;br /&gt;&lt;br /&gt;I have read chapter 1 thru 5.&lt;br /&gt;&lt;br /&gt;Chapter 1 overviews the research field and the contents of the book.&lt;br /&gt;&lt;br /&gt;Chapter 2 classifies models of IR system and describes characteristics of each model. The models are 3 classic models (boolean, vector, probabilistic) and 6 alternative models (fuzzy, extended boolean, generalized vector, latent semantic index, neural networks, inference network, belief network) and 2 structured models (non-overlapping lists, proximal nodes) and 3 browsing models (flat, structure guided, hypertext).&lt;br /&gt;&lt;br /&gt;Chapter 3 discusses retrieval performance evaluation and covers some test collections.&lt;br /&gt;&lt;br /&gt;Chapter 4 classifies query languages. It covers 4 keyword based querying (single-word, context, boolean, natural language) and pattern matching and 3 structural queries (fixed, hypertext, hierarchical).&lt;br /&gt;&lt;br /&gt;Chapter 5 discusses query operations which is a combination of two strategies: term weighting and query expansion. Approaches are grouped in 3 categories: user relevance feedback, local analysis and global analysis.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116299335302623789?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116299335302623789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116299335302623789' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116299335302623789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116299335302623789'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/11/modern-information-retrieval-1.html' title='&apos;Modern Information Retrieval&apos; (1)'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116178495491087688</id><published>2006-10-25T22:52:00.000+09:00</published><updated>2006-10-25T23:02:34.960+09:00</updated><title type='text'>a document for ABC machine instructions</title><content type='html'>I have written a document for ABC machine instructions.&lt;br /&gt;&lt;a href="http://cleanj.sourceforge.net/abc_inst.html"&gt;http://cleanj.sourceforge.net/abc_inst.html&lt;/a&gt;&lt;br /&gt;The document does not describe all the instructions but it is enough to develop such a program as CleanJ.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116178495491087688?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116178495491087688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116178495491087688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116178495491087688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116178495491087688'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/document-for-abc-machine-instructions.html' title='a document for ABC machine instructions'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116100909844016938</id><published>2006-10-16T23:30:00.000+09:00</published><updated>2006-10-16T23:36:31.286+09:00</updated><title type='text'>What does this program means?</title><content type='html'>This program can be compiled. But what does this means?&lt;br /&gt;&lt;pre&gt;module Synonym&lt;br /&gt;&lt;br /&gt;import StdEnv&lt;br /&gt;&lt;br /&gt;::Number a | Arith a :== a&lt;br /&gt;&lt;br /&gt;Start :: Number String&lt;br /&gt;Start = "aaa"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is also.&lt;br /&gt;&lt;pre&gt;module TypeDef&lt;br /&gt;&lt;br /&gt;import StdEnv&lt;br /&gt;&lt;br /&gt;::Number a | Arith a = Number a&lt;br /&gt;&lt;br /&gt;Start :: Number String&lt;br /&gt;Start = Number "aaa"&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116100909844016938?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116100909844016938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116100909844016938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116100909844016938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116100909844016938'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/what-does-this-program-means.html' title='What does this program means?'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116089756006647070</id><published>2006-10-15T16:16:00.000+09:00</published><updated>2006-10-15T16:32:40.100+09:00</updated><title type='text'>generic function for unboxed array</title><content type='html'>This is a sample program of generic function for unboxed array:&lt;br /&gt;&lt;pre&gt;generic gEq a :: a a -&gt; Bool&lt;br /&gt;gEq{|Int|} a b = a == b&lt;br /&gt;gEq{|Real|} a b = a == b&lt;br /&gt;gEq{|Char|} a b = a == b&lt;br /&gt;gEq{|Bool|} a b = a == b&lt;br /&gt;gEq{|{#}|} f aa bb = eqArray f aa bb&lt;br /&gt;&lt;br /&gt;eqArray f aa bb :== sa==sb &amp;&amp; eqArray (dec sa)&lt;br /&gt;  where&lt;br /&gt;    sa = size aa&lt;br /&gt;    sb = size bb&lt;br /&gt;&lt;br /&gt;    eqArray 0 = f aa.[0] bb.[0]&lt;br /&gt;    eqArray i | f aa.[i] bb.[i] = eqArray (dec i)&lt;br /&gt;    eqArray _ = False&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But this program brings compile error.&lt;br /&gt;&lt;pre&gt;Overloading error [Eq.icl,22,gEq__#Array]: internal overloading of "size" could not be solved&lt;/pre&gt;&lt;br /&gt;It is because size function for each unboxed array is separate definition and type specification is needed to identify the corresponding definition. Then the plausible program:&lt;br /&gt;&lt;pre&gt;gEq{|{#Int}|} f aa bb = eqArray f aa bb&lt;br /&gt;gEq{|{#Char}|} f aa bb = eqArray f aa bb&lt;br /&gt;gEq{|{#Real}|} f aa bb = eqArray f aa bb&lt;br /&gt;gEq{|{#Bool}|} f aa bb = eqArray f aa bb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;will leads to the error:&lt;br /&gt;&lt;pre&gt;Parse error [Eq.icl,23:11,generic type, no constructor arguments allowd]:  |} expected&lt;/pre&gt;&lt;br /&gt;But this is only a syntax matter. To get off this problem the program should be modified as follows:&lt;br /&gt;&lt;pre&gt;::IntArray :== {#Int}&lt;br /&gt;::RealArray :== {#Real}&lt;br /&gt;::BoolArray :== {#Bool}&lt;br /&gt;&lt;br /&gt;generic gEq a :: a a -&gt; Bool&lt;br /&gt;gEq{|String|} aa bb = eqArray (==) aa bb&lt;br /&gt;gEq{|IntArray|} aa bb = eqArray (==) aa bb&lt;br /&gt;gEq{|RealArray|} aa bb = eqArray (==) aa bb&lt;br /&gt;gEq{|BoolArray|} aa bb = eqArray (==) aa bb&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116089756006647070?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116089756006647070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116089756006647070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116089756006647070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116089756006647070'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/generic-function-for-unboxed-array.html' title='generic function for unboxed array'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116089547134337961</id><published>2006-10-15T15:54:00.000+09:00</published><updated>2006-10-15T15:57:51.356+09:00</updated><title type='text'>Re: Verious Types</title><content type='html'>Map function for Fix type constructor:&lt;br /&gt;&lt;pre&gt;module Recursive&lt;br /&gt;&lt;br /&gt;::Fix f = In (f (Fix f))&lt;br /&gt;::ListBase a b = NilL | ConsL a b&lt;br /&gt;::List a :== Fix (ListBase a)&lt;br /&gt;&lt;br /&gt;mapListBase :: A.a1 a2 b1 b2: (a1 -&gt; a2) (b1 -&gt; b2) (ListBase a1 b1) -&gt; ListBase a2 b2&lt;br /&gt;mapListBase mapa mapb NilL = NilL&lt;br /&gt;mapListBase mapa mapb (ConsL a b) = ConsL (mapa a) (mapb b)&lt;br /&gt;&lt;br /&gt;mapFix :: A.f1 f2: (A.a1 a2: (a1 -&gt; a2) -&gt; (f1 a1) -&gt; (f2 a2)) (Fix f1) -&gt; Fix f2&lt;br /&gt;mapFix mapf (In v) = In (mapf (mapFix mapf) v)&lt;br /&gt;&lt;br /&gt;mapList :: A.a1 a2: (a1 -&gt; a2) -&gt; ((List a1) -&gt; (List a2))&lt;br /&gt;mapList mapa = mapFix (mapListBase mapa)&lt;br /&gt;&lt;br /&gt;add :: !Int !Int -&gt; Int&lt;br /&gt;add a b&lt;br /&gt;    = code inline {&lt;br /&gt;        addI&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;Start :: (List Int, List Int)&lt;br /&gt;Start = (ls, mapList (add 1) ls)&lt;br /&gt;  where&lt;br /&gt;    ls = In (ConsL 2 (In (ConsL 3 (In (ConsL 5 (In NilL))))))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This sample shows that Clean 2.1.1 has a support for Rank-2 polymorphism.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116089547134337961?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116089547134337961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116089547134337961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116089547134337961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116089547134337961'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/re-verious-types.html' title='Re: Verious Types'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116082242533959182</id><published>2006-10-14T16:37:00.000+09:00</published><updated>2006-10-14T19:49:34.313+09:00</updated><title type='text'>'Haskell on a Shared-Memory Multiprocessor'</title><content type='html'>&lt;a href="http://research.microsoft.com/~simonpj/papers/parallel/index.htm"&gt;http://research.microsoft.com/~simonpj/papers/parallel/index.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This paper explains how to modify present implementation of GHC which targets an uniprocessor system (Uni-GHC) for a shared-memory multiprocessor system (SMP-GHC), and shows how the performance of the SMP-GHC implementation is.&lt;br /&gt;&lt;br /&gt;Threading model in Uni-GHC is, roughly speeking, that many Haskell threads running on a single OS thread, called a worker-thread. Since each Haskell thread is switched by a worker thread at a carefully controlled point, any racing condition of updating thunks occurs.&lt;br /&gt;&lt;br /&gt;SMP-GHC creates multiple worker thread to run Haskell code in parallel on separate CPUs and some racing conditions of updating thunks occur. If every thunk is locked to guard thunks from the racing condition, the performance becomes lower and the performance merit of multiprocessor system vanishes.&lt;br /&gt;&lt;br /&gt;Instead of locking thunks the approach this paper adopted is evaluating thunks with no locking instructions whatsoever. The key idea is that since a thunk always represents a pure expression it does not matter if two threads evaluate the same thunk. Two points are needed to consider.&lt;br /&gt;&lt;br /&gt;The first thing is to ensure that if two threads succeed in entering the same thunk, they do not trip over each other. Thinking about the situation that thread A and thread B simultaneously evaluating the same thunk, it will go wrong if the evaluation will proceed as the following: thread B reads the entry code; thread A reads the entry code; thread A reads the arguments; thread A evaluates the thunk; thread A writes the result; thread B reads the arguments. In the last step thread B will read the result of evaluation of thread A. The solution to this race condition is to separate the memory area for arguments and that for a result.&lt;br /&gt;&lt;br /&gt;The second problem occurs if one thread reads a thunk just as another thread is updating it. Thinking about the following process: Thread A writes an end mark in the header of the thunk; Thread B reads the header of the thunk and thinks that the thunk is already evaluated; Thread B tries to read the result but thread A has not write the result yet. If a hardware guarantees the order of instruction this problem is solved by writing a result before an end mark. Otherwise a memory fence is needed before executing update code for thunk.&lt;br /&gt;&lt;br /&gt;To run Haskell code on SMP machine the ideas above are sufficient but there are aditional ideas for avoiding a duplicate evalutation of an expensive thunk.&lt;br /&gt;&lt;br /&gt;One of these ideas is black-holing. The basic idea is that after starting evaluation of a thunk the thread 'claims the thunk' to gain exclusive access to the thunk. If the thunk is already claimed by another thread the thread will blocked until the evaluating thread completes the evaluation of the thunk. After the evaluation is over the stack of the blocked thread will be truncated to skip the evaluation of the thunk.&lt;br /&gt;&lt;br /&gt;Another idea is Grey-holing, where a thread claims the thunk just when entering the thunk without locking.&lt;br /&gt;&lt;br /&gt;The STM implementation on SMP system is also described. The basic idea is to implement per-TVar locks using atomic CAS instructions.&lt;br /&gt;&lt;br /&gt;To measure the efficiency of the implementation, &lt;a href="http://www.dcs.gla.ac.uk/fp/software/ghc/nofib.html"&gt;88 programs of nofib benchmark suite&lt;/a&gt; and GHC itself with --make option are used. The result is satisfactory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116082242533959182?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116082242533959182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116082242533959182' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116082242533959182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116082242533959182'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/haskell-on-shared-memory.html' title='&apos;Haskell on a Shared-Memory Multiprocessor&apos;'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116066428676780056</id><published>2006-10-12T23:22:00.000+09:00</published><updated>2006-10-12T23:45:54.410+09:00</updated><title type='text'>Verious Types</title><content type='html'>Follow chapter 1 of the paper of 'Generic haskell: practice and theory' (2003) in the site &lt;a href="http://www.cs.uu.nl/~johanj/publications/publications.html"&gt;http://www.cs.uu.nl/~johanj/publications/publications.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;First, generic Rose type:&lt;br /&gt;&lt;pre&gt;module GRose&lt;br /&gt;&lt;br /&gt;::GRose f a = GBranch a (f (GRose f a))&lt;br /&gt;::Rose a :== GRose [] a&lt;br /&gt;&lt;br /&gt;Start :: Rose Int&lt;br /&gt;Start = GBranch 1 [GBranch 2 [], GBranch 3 [GBranch 4 []]]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Second, recursive type:&lt;br /&gt;&lt;pre&gt;module Recursive&lt;br /&gt;&lt;br /&gt;::Fix f = In (f (Fix f))&lt;br /&gt;::ListBase a b = NilL | ConsL a b&lt;br /&gt;::List a :== Fix (ListBase a)&lt;br /&gt;&lt;br /&gt;Start :: List Int&lt;br /&gt;Start = In (ConsL 2 (In (ConsL 3 (In (ConsL 5 (In NilL)))))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Third, a linear nested type of Perfect type:&lt;br /&gt;&lt;pre&gt;module Perfect&lt;br /&gt;&lt;br /&gt;::Fork a = Fork a a&lt;br /&gt;::Perfect a = ZeroP a | SuccP (Perfect (Fork a))&lt;br /&gt;&lt;br /&gt;Start :: Perfect Int&lt;br /&gt;Start = SuccP (SuccP (SuccP (ZeroP (Fork (Fork (Fork 2 3)&lt;br /&gt;                                               (Fork 5 7))&lt;br /&gt;                                         (Fork (Fork 11 13)&lt;br /&gt;                                               (Fork 17 19))))))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Fourth, another linear nested type of Okasaki's binary random-access liss:&lt;br /&gt;&lt;pre&gt;module Sequ&lt;br /&gt;&lt;br /&gt;::Fork a = Fork a a&lt;br /&gt;::Sequ a = EndS&lt;br /&gt;         | ZeroS (Sequ (Fork a))&lt;br /&gt;         | OneS a (Sequ (Fork a))&lt;br /&gt;&lt;br /&gt;Start :: Sequ Int&lt;br /&gt;Start = ZeroS (OneS (Fork 2 3) (OneS (Fork (Fork 5 7) (Fork 11 13)) EndS))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Fifth, a non-linear nested type:&lt;br /&gt;&lt;pre&gt;module Bush&lt;br /&gt;&lt;br /&gt;::Bush a = NilB | ConsB a (Bush (Bush a))&lt;br /&gt;&lt;br /&gt;Start :: Bush Int&lt;br /&gt;Start = ConsB 1 (ConsB (ConsB 2 NilB)&lt;br /&gt;                (ConsB (ConsB (ConsB 3 NilB) NilB) NilB))&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116066428676780056?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116066428676780056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116066428676780056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116066428676780056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116066428676780056'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/verious-types.html' title='Verious Types'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116049255954623387</id><published>2006-10-11T00:00:00.000+09:00</published><updated>2006-10-11T00:05:26.393+09:00</updated><title type='text'>Re: SQLite3 binding for Clean</title><content type='html'>Now the package is available here: &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=179225"&gt;http://sourceforge.net/project/showfiles.php?group_id=179225&lt;/a&gt;&lt;br /&gt;Suversion repository can be browsed here: &lt;a href="http://svn.sourceforge.net/viewvc/cleansqlite/trunk/"&gt;http://svn.sourceforge.net/viewvc/cleansqlite/trunk/&lt;/a&gt;&lt;br /&gt;It is distributed under the modified BSD license.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116049255954623387?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116049255954623387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116049255954623387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116049255954623387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116049255954623387'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/re-sqlite3-binding-for-clean_10.html' title='Re: SQLite3 binding for Clean'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116040352613785222</id><published>2006-10-09T23:16:00.000+09:00</published><updated>2006-10-09T23:30:33.153+09:00</updated><title type='text'>Re: SQLite3 binding for Clean</title><content type='html'>I have finished my first attempt to make SQLite3 binding for Clean. This is for Windows Environment but It can be ported to other OS with a little work.&lt;br /&gt;I applied a new project to sourceforge.net and soon I will register the package there.&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;This is a sample application:&lt;br /&gt;&lt;pre&gt;Start w # (c,w) = sql_open "db" w&lt;br /&gt;          (s,c) = sql_connection_status c&lt;br /&gt;        | s &lt;&gt; SQL_OK = trace (toString s +++ "\n") ({},[],w)&lt;br /&gt;        # (mst,c) = sql_prepare "SELECT i,r,t FROM tbl1" c&lt;br /&gt;          (nml,rsl,c) = case mst of&lt;br /&gt;                          Nothing # (st,c) = sql_connection_status c&lt;br /&gt;                                  = trace (toString st +++ "\n") ({},[],c)&lt;br /&gt;                          Just st # (nml,st) = sql_column_names st&lt;br /&gt;                                    (rsl,st) = each st&lt;br /&gt;                                    c = sql_finalize st c&lt;br /&gt;                                  = (nml,rsl,c)&lt;br /&gt;          w = sql_close c w&lt;br /&gt;        = (nml,rsl,w)&lt;br /&gt;  where&lt;br /&gt;    each st # st = sql_step st&lt;br /&gt;              (mrs,st) = sql_column_values st&lt;br /&gt;            = case mrs of&lt;br /&gt;                Nothing = ([],st)&lt;br /&gt;                Just rs # (rsl,st) = each st&lt;br /&gt;                        = ([rs:rsl],st)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116040352613785222?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116040352613785222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116040352613785222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116040352613785222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116040352613785222'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/re-sqlite3-binding-for-clean.html' title='Re: SQLite3 binding for Clean'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116031358737145148</id><published>2006-10-08T22:17:00.000+09:00</published><updated>2006-10-08T22:19:47.550+09:00</updated><title type='text'>SQLite3 binding for Clean</title><content type='html'>I am trying to make SQLite3 binding for Clean now. So, what happend to your plan to write document of ABC machine instruction?&lt;br /&gt;Well well...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116031358737145148?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116031358737145148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116031358737145148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116031358737145148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116031358737145148'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/sqlite3-binding-for-clean.html' title='SQLite3 binding for Clean'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116020294571739904</id><published>2006-10-07T15:31:00.000+09:00</published><updated>2006-10-07T15:35:57.326+09:00</updated><title type='text'>Re: deepSeq</title><content type='html'>&lt;a href="http://lethevert.blogspot.com/2006/10/deepseq.html"&gt;Previously I shown my deepSeq function implementation&lt;/a&gt;, but I made an error in it.&lt;br /&gt;&lt;br /&gt;I previously write:&lt;br /&gt;&lt;pre&gt;gDeepSeq {|{}|}     f     a            w = seqArray f a w&lt;br /&gt;gDeepSeq {|{!}|}    f     a            w = (a,w)&lt;br /&gt;gDeepSeq {|{#}|}    f     a            w = (a,w)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But to think of a strict array of a record with lazy field, this deepSeq function will not work correctly. I should write instead:&lt;br /&gt;&lt;pre&gt;gDeepSeq {|{}|}     f     a            w = seqArray f a w&lt;br /&gt;gDeepSeq {|{!}|}    f     a            w = seqArray f a w&lt;br /&gt;gDeepSeq {|{#}|}    f     a            w = seqArray f a w&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116020294571739904?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116020294571739904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116020294571739904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116020294571739904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116020294571739904'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/re-deepseq.html' title='Re: deepSeq'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116014565541963260</id><published>2006-10-06T22:40:00.000+09:00</published><updated>2006-10-07T00:08:24.543+09:00</updated><title type='text'>Transaction</title><content type='html'>I devised a function bridging unique type variables and lazy data structures. Transaction is a name I gave to the function. I am not sure the name is appropriate.&lt;br /&gt;&lt;br /&gt;Unique type is good to describe an ordered process but is not convenient to combine with list manipulation function or the like. Transaction function is a solution for the problem.&lt;br /&gt;&lt;br /&gt;Transaction.icl&lt;pre&gt;definition module Transaction&lt;br /&gt;&lt;br /&gt;import DeepSeq&lt;br /&gt;&lt;br /&gt;transaction&lt;br /&gt;    generator&lt;br /&gt;    reducer&lt;br /&gt;    unique&lt;br /&gt;    world&lt;br /&gt;    :== transaction world&lt;br /&gt;  where&lt;br /&gt;    transaction world&lt;br /&gt;        # (unique1, unique2) = double unique&lt;br /&gt;          (result, world) = reducer (generator unique1) world&lt;br /&gt;          (result, world) = deepSeq result world&lt;br /&gt;        = (result, unique2, world)&lt;br /&gt;&lt;br /&gt;    double :: *v -&gt; *(*v,*v)&lt;br /&gt;    double v&lt;br /&gt;        = code {&lt;br /&gt;            push_a 0&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This function is based on the fact that unique type variable is not usually copied but updated imperatively through the whole process.&lt;br /&gt;Double function is a magic function; it takes a pointer to a thunk and return two copy of it. The two copy of the pointer share the same thunk. Then one is passed to the generator function and generator function produces a lazy structure of read data from it. Reducer will reduce the input and return a final value which may contain a lazy thunks related to the original input unique type variable.&lt;br /&gt;DeepSeq function is applied to the final value to sweep out the unevaluated thunks related to the first copy of the unique variable. After that the second copy of the unique variable is returned with the final result of reduce function.&lt;br /&gt;&lt;br /&gt;This is an example with Parser Library for parsing a s-expression style text. The Parser Library of Clean needs input data to be in lazy list type. It is not applicable to the File type of Clean I/O library. Then transaction function is usefull for bridging them.&lt;br /&gt;&lt;pre&gt;module ParseExpr&lt;br /&gt;&lt;br /&gt;import StdEnv, OptEnv, Parsers, Tran2&lt;br /&gt;&lt;br /&gt;Start :: *World -&gt; ([(Tree String)],*World)&lt;br /&gt;Start w&lt;br /&gt;    # (f, w) = stdio w&lt;br /&gt;      (r, f, w) = w --&gt; transaction gen_input parse_input f&lt;br /&gt;      (_, w) = trace "fclose" $ fclose f w&lt;br /&gt;    = (r,w)&lt;br /&gt;&lt;br /&gt;gen_input f&lt;br /&gt;    # (_,c,f) = trace "freadc" $ freadc f&lt;br /&gt;    = [c:gen_input f]&lt;br /&gt;&lt;br /&gt;parse_input input w&lt;br /&gt;    = case parse (first sexpr) input "" "" of&lt;br /&gt;        (Succ ls) = (ls,w)&lt;br /&gt;        _         = ([],w)&lt;br /&gt;&lt;br /&gt;sexpr =  symbol '(' &amp;&gt; list &lt;&amp; symbol ')' &lt;@ (\tt = B tt)&lt;br /&gt;     &lt;|&gt; atom                             &lt;@ (\t  = L t )&lt;br /&gt;&lt;br /&gt;atom = &lt;+&gt; (satisfy \x = not (isMember x ['()'])&lt;br /&gt;                      &amp;&amp; isPrint x&lt;br /&gt;                      &amp;&amp; not (isSpace x)) &lt;@ \t = toString t&lt;br /&gt;&lt;br /&gt;list =  sexpr          &lt;&amp;&gt; \t  =&lt;br /&gt;        &lt;*&gt; (ds sexpr) &lt;@  \tt = [t:tt]&lt;br /&gt;&lt;br /&gt;::Tree a = L a | B [Tree a]&lt;br /&gt;derive gDeepSeq Tree&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116014565541963260?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116014565541963260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116014565541963260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116014565541963260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116014565541963260'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/transaction.html' title='Transaction'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-116006015301923450</id><published>2006-10-05T23:47:00.000+09:00</published><updated>2006-10-05T23:57:41.116+09:00</updated><title type='text'>deepSeq</title><content type='html'>I was implemented a 'deepSeq' function which evaluates every thunk in the argument. It can be instantiate for user defined types because it is defined as a generic function.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;DeepSeq.dcl&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;definition module DeepSeq&lt;br /&gt;&lt;br /&gt;import StdGeneric, GenBimap&lt;br /&gt;&lt;br /&gt;deepSeq :== gDeepSeq{|*|}&lt;br /&gt;generic gDeepSeq a :: !a !.w -&gt; (!a,!.w)&lt;br /&gt;derive gDeepSeq Int, Real, Char, Bool, {}, {!}, {#}&lt;br /&gt;derive gDeepSeq UNIT, PAIR, EITHER, CONS, FIELD, OBJECT&lt;br /&gt;derive gDeepSeq []&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;DeepSeq.icl&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;implementation module DeepSeq&lt;br /&gt;&lt;br /&gt;import StdEnv, StdGeneric, GenBimap&lt;br /&gt;&lt;br /&gt;deepSeq :== gDeepSeq{|*|}&lt;br /&gt;&lt;br /&gt;generic gDeepSeq a :: !a !.w -&gt; (!a,!.w)&lt;br /&gt;gDeepSeq {|Int|}          a            w = (a,w)&lt;br /&gt;gDeepSeq {|Real|}         a            w = (a,w)&lt;br /&gt;gDeepSeq {|Char|}         a            w = (a,w)&lt;br /&gt;gDeepSeq {|Bool|}         a            w = (a,w)&lt;br /&gt;gDeepSeq {|UNIT|}         a            w = (a,w)&lt;br /&gt;gDeepSeq {|{}|}     f     a            w = seqArray f a w&lt;br /&gt;gDeepSeq {|{!}|}    f     a            w = (a,w)&lt;br /&gt;gDeepSeq {|{#}|}    f     a            w = (a,w)&lt;br /&gt;gDeepSeq {|PAIR|}   fx fy (PAIR a1 a2) w # (a1,w) = fx a1 w&lt;br /&gt;                                           (a2,w) = fy a2 w&lt;br /&gt;                                         = (PAIR a1 a2,w)&lt;br /&gt;gDeepSeq {|EITHER|} fl fr (LEFT a)     w # (a,w) = fl a w&lt;br /&gt;                                         = (LEFT a,w)&lt;br /&gt;gDeepSeq {|EITHER|} fl fr (RIGHT a)    w # (a,w) = fr a w&lt;br /&gt;                                         = (RIGHT a,w)&lt;br /&gt;gDeepSeq {|CONS|}   f     (CONS a)     w # (a,w) = f a w&lt;br /&gt;                                         = (CONS a,w)&lt;br /&gt;gDeepSeq {|FIELD|}  f     (FIELD a)    w # (a,w) = f a w&lt;br /&gt;                                         = (FIELD a,w)&lt;br /&gt;gDeepSeq {|OBJECT|} f     (OBJECT a)   w # (a,w) = f a w&lt;br /&gt;                                         = (OBJECT a,w)&lt;br /&gt;&lt;br /&gt;seqArray f ar w = seqArray 0 ar w&lt;br /&gt;  where&lt;br /&gt;    s = size ar&lt;br /&gt;    seqArray i ar w | i &gt;= s = (ar,w)&lt;br /&gt;    seqArray i ar w          # (_,w) = f ar.[i] w&lt;br /&gt;                             = seqArray (inc i) ar w&lt;br /&gt;&lt;br /&gt;derive gDeepSeq []&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-116006015301923450?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/116006015301923450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=116006015301923450' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116006015301923450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/116006015301923450'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/deepseq.html' title='deepSeq'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115997309414647994</id><published>2006-10-04T22:56:00.000+09:00</published><updated>2006-10-04T23:47:42.340+09:00</updated><title type='text'>'Lock Free Data Structures using STM in Haskell'</title><content type='html'>&lt;a href="http://research.microsoft.com/~simonpj/papers/stm/lock-free.htm"&gt;http://research.microsoft.com/~simonpj/papers/stm/lock-free.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The paper explores the feasibility of lock free data structure using STM (software transactional memory) in Haskell on the aspects of both software engeering and performance. STM is a mechanism for coordinating concurrent threads. STM offers a higher level of abstraction than the tranditional combination of locks and condition variables.&lt;br /&gt;&lt;br /&gt;STM is implemented as a STM Monad and 'atomically' function combines a STM Monad and an IO Monad.&lt;br /&gt;'Atomically' executes a received monad atomically - i.e. no concurrent transaction has committed conflicting updates. In addition it is rubust to exceptions. If an exception raised inside the transaction, no update is made.&lt;br /&gt;&lt;pre&gt;atomically :: STM a -&gt; IO a&lt;/pre&gt;&lt;br /&gt;Transactional variables or 'TVars' are used to reading and writing a value.&lt;br /&gt;&lt;pre&gt;data TVar a&lt;br /&gt;newTVar :: a -&gt; STM (TVar a)&lt;br /&gt;readTVar :: TVar a -&gt; STM a&lt;br /&gt;writeTVar :: TVar a -&gt; a -&gt; STM ()&lt;/pre&gt;&lt;br /&gt;A tansaction can block using 'retry.'&lt;br /&gt;The semantics of retry is to abort the current atomic transaction, and re-run it after one of the transactional variables has been updated.&lt;br /&gt;&lt;pre&gt;retry :: STM a&lt;/pre&gt;&lt;br /&gt;The orElse combinator allows two transactions to be tried in sequence. (s1 `orElse` s2) is a transaction that first attemps s1; if it calls retry, then s2 is tried instead; if that retries as well, then the entire call to orElse retries.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ArrayBlockingQueue.html"&gt;ArrayBlockingQueue&lt;/a&gt; class from JSR-166 is selected as the bases for the experiment. The conventional locking implementation uses semaphores and mutexes carefully and its program is rather long while STM implementation uses neither semaphores nore mutexes and its program is simple.&lt;br /&gt;&lt;br /&gt;Performances are mesured under conditions which varies on a number of processors (1 to 8) and a number of worker threads (2 to 14). In almost every case the STM version was faster than the locking version running on the same number of processors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115997309414647994?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115997309414647994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115997309414647994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115997309414647994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115997309414647994'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/10/lock-free-data-structures-using-stm-in.html' title='&apos;Lock Free Data Structures using STM in Haskell&apos;'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115945339073299052</id><published>2006-09-28T22:20:00.000+09:00</published><updated>2006-09-28T23:23:10.816+09:00</updated><title type='text'>'MapReduce: Simplified Data Processing on Large Clusters'</title><content type='html'>&lt;a href="http://labs.google.com/papers/mapreduce.html"&gt;http://labs.google.com/papers/mapreduce.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This paper is an introduction of MapReduce, a library for paralell execution on a large cluster of commodity machines.&lt;br /&gt;&lt;br /&gt;The approach of the MapReduce library is providing restricted programming models and using the restrictions to parallelize the computation automatically. The user of the library expresses the computation as two functions: Map and Reduce, both of which are user defined functions. A Map function reads a set of input key/value pairs and produces a set of intermediate key/value pairs while a Reduce function read the intermediate set and produce a set of final output values.&lt;br /&gt;&lt;br /&gt;The instances of the Map function and the Reduce function are distributed to machines in the cluster and each instance is executed in parallel. The input files of the Map function and the final output files of Recude function are on GFS while the intermediate files are on each Local Disk of the machine where each Map function allocated. To conserve network bandwidth each instance of the Map function is allocated to the machine where the block of input data is stored. (GFS divides each file into 64 MB blocks, and stored several copies of each block (typically 3 copies) on different machines.)&lt;br /&gt;&lt;br /&gt;One of the copies of the program is special - the master. It decides which machine should execute each piece of task of a Map function or a Reduce function. It also detect worker failures and re-schedule their failed tasks. Status informations are available through an internal HTTP server of the master.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115945339073299052?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115945339073299052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115945339073299052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115945339073299052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115945339073299052'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/mapreduce-simplified-data-processing.html' title='&apos;MapReduce: Simplified Data Processing on Large Clusters&apos;'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115919673980987670</id><published>2006-09-25T23:09:00.000+09:00</published><updated>2006-09-26T00:07:37.236+09:00</updated><title type='text'>'Interpreting the Data: Parallel Analysis with Sawzall'</title><content type='html'>&lt;a href="http://labs.google.com/papers/sawzall.html"&gt;http://labs.google.com/papers/sawzall.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This paper is an introduction of Sawzall, a DSL for processing extremely large data set effectively using masive parallelism.&lt;br /&gt;&lt;br /&gt;Sawzall is a statically typed, interpreted scripting language. The most unique feature of the language is that a program source is correspondent with only one record of input data. The interpreter repeats the defined process every record. Parallel execution is enabled because no intermediate state are shared in the repetition.&lt;br /&gt;&lt;br /&gt;The first stage of execution steps is to read raw data sets, process each record and emitting the result, while the second stage is to aggregate all the emitted data, collate them and write the result to file. The whole process is executed in a batch style.&lt;br /&gt;&lt;br /&gt;Aggregation is done outside the language. A number of aggregators are defined in advance and new aggregators can be created if needed. An aggregator can be indexed so that emitted data are aggregated in each index. For example, 'sum' aggregater indexed by string data is suitable to classify stored web pages by its belonging country and count a number of record of each country.&lt;br /&gt;&lt;br /&gt;Sawzall is built upon some Google infrastructure. Protocol Buffers are used to describe the format of permanent records stored on disk. The data sets are often stored in GFS, the Google File System. Software called the Workqueue is handled scheduling a job to run on a cluster of machines. MapReduce is a library for application that run on the Workqueue and Sawzall's data processing system is built on top of it. Its interpreter runs in the map phase.&lt;br /&gt;&lt;br /&gt;Most Sawzall jobs do very little processing per record and are therefore I/O bound; for most of the rest, the CPU spends the majority of its time in various run-time operations such as parsing protocol buffers. The key performance metric for the system is how the speed scales as machines are added when processing a large data set. A test shows that it is almost linearly scaled (only 30% degraded) over the range of 50 to 600 machines.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115919673980987670?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115919673980987670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115919673980987670' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115919673980987670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115919673980987670'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/interpreting-data-parallel-analysis.html' title='&apos;Interpreting the Data: Parallel Analysis with Sawzall&apos;'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115914331102478407</id><published>2006-09-25T08:55:00.000+09:00</published><updated>2006-09-25T09:15:12.006+09:00</updated><title type='text'>'--&gt;' operator</title><content type='html'>'--&gt;' operator which is defined in OptEnv module in CleanJ package is very useful. The definition is the following:&lt;br /&gt;&lt;pre&gt;(--&gt;) infixl 0 //:: .a (.a -&gt; .b) -&gt; .b&lt;br /&gt;(--&gt;) a f :== f a&lt;/pre&gt;The operator is often used with unique type like&lt;br /&gt;&lt;pre&gt;print f = f --&gt; fwrites "Hello "&lt;br /&gt;            --&gt; fwrites "World!"&lt;br /&gt;            --&gt; fwrites "\n"&lt;/pre&gt;instead of a common use like&lt;br /&gt;&lt;pre&gt;print f # f = fwrites "Hello "&lt;br /&gt;          f = fwrites "World!"&lt;br /&gt;          f = fwrites "\n"&lt;br /&gt;        = f&lt;/pre&gt;&lt;br /&gt;The operator can be used with '$' operator which corresponds with that of Haskell and is also defined in OptEnv module, whose definition is the following:&lt;br /&gt;&lt;pre&gt;($) infixr 1 //:: (a -&gt; z) a -&gt; z&lt;br /&gt;($) f a :== f a&lt;/pre&gt;The combination of '--&gt;' and '$' is such that&lt;br /&gt;&lt;pre&gt;print :: ![String] !*File -&gt; *File&lt;br /&gt;print ss f = f --&gt; seq $ map fwrites ss&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115914331102478407?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115914331102478407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115914331102478407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115914331102478407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115914331102478407'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/operator.html' title='&apos;--&gt;&apos; operator'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115893583214477599</id><published>2006-09-22T23:07:00.000+09:00</published><updated>2006-09-22T23:37:12.263+09:00</updated><title type='text'>TAPL Chapter 30 thru 32</title><content type='html'>In chapter 30, System F&amp;omega; is discussed. System F&amp;omega; is a combination of System F which includes unbounded quantification introduced in chapter 23 and 24, and type operators  which is introduced in chapter 29.&lt;br /&gt;&lt;br /&gt;In chapter 31, Sytem F&amp;omega; is extended with System F&lt;:, yielding System F&amp;omega;&lt;:. This interesting feature is the extention of the subtyping relation from kind * to types of higher kinds, that is establishing a subtype relation between not only types but type operators. In this chapter, the description remains to be an introduction and proofs of fundamental properties are omitted.&lt;br /&gt;&lt;br /&gt;In chapter 32, the pure functional interpretation of objects in System F&amp;omega;&lt;: is introduced. To cope with the problem of adding new instance variables in subclasses, a primitive for in-place polimorphic update of record fields is introduced.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115893583214477599?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115893583214477599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115893583214477599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115893583214477599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115893583214477599'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/tapl-chapter-30-thru-32.html' title='TAPL Chapter 30 thru 32'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115867452660726868</id><published>2006-09-19T22:59:00.000+09:00</published><updated>2006-09-19T23:02:06.683+09:00</updated><title type='text'>The documentation of ABC machine instructions</title><content type='html'>I started writing the documentation of ABC machine instructions.&lt;br /&gt;&lt;br /&gt;I have published the working document at the web site:&lt;br /&gt;  &lt;a href="http://cleanj.sourceforge.net/abc_inst.html"&gt;http://cleanj.sourceforge.net/abc_inst.html&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115867452660726868?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115867452660726868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115867452660726868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115867452660726868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115867452660726868'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/documentation-of-abc-machine.html' title='The documentation of ABC machine instructions'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115867114813979116</id><published>2006-09-19T22:05:00.000+09:00</published><updated>2006-09-19T22:05:48.150+09:00</updated><title type='text'>One liner by C</title><content type='html'>&lt;pre&gt;$ echo "main(){printf(\"hello 1 liner.\");}" | gcc -xc -; ./a.exe&lt;br /&gt;hello 1 liner.&lt;/pre&gt;needs cygwin.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115867114813979116?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115867114813979116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115867114813979116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115867114813979116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115867114813979116'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/one-liner-by-c.html' title='One liner by C'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115849795848552575</id><published>2006-09-17T21:49:00.000+09:00</published><updated>2006-09-17T21:59:18.496+09:00</updated><title type='text'>CleanJ version 0.9 released</title><content type='html'>The work of packaging the current project is over and version 0.9 is released.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/cleanj/"&gt;http://sourceforge.net/projects/cleanj/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Before releasing it, I tested translating cleanj.exe into Java program and then translating some libraries of original clean distribution using the translated cleanj.exe, and I noticed that this translation is totally inefficient that it is not suitable for a practical use.&lt;br /&gt;&lt;br /&gt;After the release, I am planning to write some documentation of ABC machine instructions and to improve the efficiency of the translation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115849795848552575?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115849795848552575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115849795848552575' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115849795848552575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115849795848552575'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/cleanj-version-09-released.html' title='CleanJ version 0.9 released'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115815948000596065</id><published>2006-09-13T23:33:00.000+09:00</published><updated>2006-09-13T23:58:00.426+09:00</updated><title type='text'>TAPL Chapter 25 thru 29</title><content type='html'>I have read chapter 25 through 29.&lt;br /&gt;&lt;br /&gt;The chapter 25 explains some implementation of System F which is a symply typed lambda calculus with universal  and existential quantifiers.&lt;br /&gt;&lt;br /&gt;The chapter 26 introduces bounded quantification which combines polymorphism and subtyping. This chapter ilustrates two type of extentions; one is "kernel F&lt;:" and another is "full F&lt;:."&lt;br /&gt;&lt;br /&gt;The chapter 27 is a case study of object encoding with bounded quantification.&lt;br /&gt;&lt;br /&gt;The chapter 28 describes the subtyping and typechecking algolithms for both of kernel and full F&lt;: and shows that full F&lt;: type system is undecidable and has no joins and meets.&lt;br /&gt;&lt;br /&gt;The chapter 29 introduces type operators and kinging. Kings classify types the same as types classify terms.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115815948000596065?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115815948000596065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115815948000596065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115815948000596065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115815948000596065'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/tapl-chapter-25-thru-29.html' title='TAPL Chapter 25 thru 29'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115789926474885488</id><published>2006-09-10T23:25:00.000+09:00</published><updated>2006-09-10T23:44:13.393+09:00</updated><title type='text'>Porting basic libraries is completed</title><content type='html'>I completed porting basic libraries and checked in the last changes.&lt;br /&gt;&lt;br /&gt;The final module is Directory module where I recently working. I also changed the string expresson of boolean values as "True" and "False" instead of "true" and "false" and changed GenParse module of Generic libary according to the change.&lt;br /&gt;&lt;br /&gt;Then I finished all the task of my first trial of porting Clean system to Java VM. Ported libraries are&lt;br /&gt;&lt;ul&gt;&lt;li&gt;StdEnv&lt;/li&gt;&lt;li&gt;StdLib&lt;/li&gt;&lt;li&gt;ArgEnv&lt;/li&gt;&lt;li&gt;Directory&lt;/li&gt;&lt;li&gt;MersenneTwister&lt;/li&gt;&lt;li&gt;Generics&lt;/li&gt;&lt;li&gt;OptEnv&lt;/li&gt;&lt;/ul&gt;After completed the final test to port cleanj.exe and test all tests again with the ported cleanj.exe, I will release it as CleanJ version 0.9.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115789926474885488?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115789926474885488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115789926474885488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115789926474885488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115789926474885488'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/porting-basic-libraries-is-completed.html' title='Porting basic libraries is completed'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115786700298163084</id><published>2006-09-10T14:37:00.000+09:00</published><updated>2006-09-10T14:43:22.990+09:00</updated><title type='text'>ccall and boolean value</title><content type='html'>Clean's Original 'ccall' instruction implementation regards a boolean value as a sort of integer value. However Java VM distinguished these differences strictly. It brings porting ccall intruction difficult without changing the implementation of CleanVM class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115786700298163084?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115786700298163084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115786700298163084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115786700298163084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115786700298163084'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/ccall-and-boolean-value.html' title='ccall and boolean value'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115781759719047707</id><published>2006-09-10T00:40:00.000+09:00</published><updated>2006-09-10T01:01:20.983+09:00</updated><title type='text'>strange behaviour of java.io.File</title><content type='html'>I was suffered from some strange behaviour of java.io.File in implementing setCurrentDirectory function of Directory module.&lt;br /&gt;&lt;br /&gt;The behaviour is that 'new File(currentDir, relativePath)' creates a strange File object which has both an absolute path of 'currentDir/relativePath' and a canonical path of 'currentDir' at the same time. This behaviour leads to determine a nonexistent directory to exist.&lt;br /&gt;&lt;br /&gt;I don't know why this behaviour occured so long, but when I scaned through Directory.icl file today I found the line below;&lt;br /&gt;&lt;pre&gt;(errCode, env) = setCurrentDirectoryC (path_string+++"\0") env&lt;/pre&gt;This is the cause. The character of '\0' makes Java library wrong. I wrote some code to prove this.&lt;br /&gt;&lt;pre&gt;public class test {&lt;br /&gt;&lt;br /&gt;  public static void main(String[] args) throws Exception {&lt;br /&gt;    File f;&lt;br /&gt;    f = p(new File("dummy0\0"));&lt;br /&gt;    f = p(new File(f,"dummy1\0"));&lt;br /&gt;    f = p(new File(f,"dummy2\0"));&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public static File p(File f) throws Exception {&lt;br /&gt;    System.err.println(f.getAbsolutePath());&lt;br /&gt;    try{&lt;br /&gt;      System.err.println(f.getCanonicalPath());&lt;br /&gt;    }catch(Exception e){ e.printStackTrace();}&lt;br /&gt;    return f;&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;The result is below;&lt;br /&gt;&lt;pre&gt;$ java test&lt;br /&gt;c:\test\dummy0&lt;br /&gt;C:\test\dummy0&lt;br /&gt;c:\test\dummy0\dummy1&lt;br /&gt;C:\test\dummy0&lt;br /&gt;c:\test\dummy0\dummy1\dummy2&lt;br /&gt;C:\test\dummy0&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115781759719047707?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115781759719047707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115781759719047707' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115781759719047707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115781759719047707'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/strange-behaviour-of-javaiofile.html' title='strange behaviour of java.io.File'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115781364367621782</id><published>2006-09-09T23:51:00.000+09:00</published><updated>2006-09-09T23:54:03.686+09:00</updated><title type='text'>creation time and owner</title><content type='html'>I don't know how to get a creation time and owner name of some file. I cannot find such a method in class library.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115781364367621782?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115781364367621782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115781364367621782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115781364367621782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115781364367621782'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/creation-time-and-owner.html' title='creation time and owner'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115781274579646493</id><published>2006-09-09T23:32:00.000+09:00</published><updated>2006-09-09T23:39:05.820+09:00</updated><title type='text'>Platform dependency</title><content type='html'>Directory module is a platform dependent module. It has a platform id which classifies unix, windows and mac systems. At first I am planning to port Directory module without adding new platform id, but it may not be a good idea and be better to introduce a platform id of java system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115781274579646493?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115781274579646493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115781274579646493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115781274579646493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115781274579646493'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/platform-dependency.html' title='Platform dependency'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115780978246276829</id><published>2006-09-09T22:25:00.000+09:00</published><updated>2006-09-09T22:55:51.270+09:00</updated><title type='text'>Check-In</title><content type='html'>I checked in my cu(ry&lt;br /&gt;&lt;br /&gt;ArgEnv module and part of Directory module are ported. 'Ccall' instruction is also ported because Directory module uses 'ccall' instruction.&lt;br /&gt;&lt;br /&gt;'Ccall' instruction is these format below;&lt;br /&gt;&lt;pre&gt;  ccall [external c procedure name] "[type string]"&lt;/pre&gt;I introduced a '*$CCALL.java' file to search procedures called by ccall instructions.&lt;br /&gt;&lt;br /&gt;The type string format is '[input value types]:[output value types]:[other value types]' and in the original Clean implementation the head of output value types are interpreted as a return value and the rests are arguments of pointer type. In CleanJ implementation all output value types are interpreted as return values; if no output types are specified the correspondent java return type is void, if only one output type are specified the correspondent java return type is int, double, char[] or Object according to the type, and otherwise it is Object[].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115780978246276829?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115780978246276829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115780978246276829' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115780978246276829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115780978246276829'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/check-in_09.html' title='Check-In'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115746629266611976</id><published>2006-09-05T23:20:00.000+09:00</published><updated>2006-09-06T00:15:36.686+09:00</updated><title type='text'>int getCurrentDirectory_SE(CleanString cs)</title><content type='html'>The title function uses side_effect to transfer current directory path. It modifies input string elements and sets the whole length of the path name.&lt;br /&gt;&lt;br /&gt;When translating it to Java program setting the length of the path name is a challenge because Java array cannot change its length. There are no solution there.&lt;br /&gt;&lt;hr&gt;I solved this problem to modiry Directory.icl file itself.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115746629266611976?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115746629266611976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115746629266611976' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115746629266611976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115746629266611976'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/int-getcurrentdirectorysecleanstring.html' title='int getCurrentDirectory_SE(CleanString cs)'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115745386675298387</id><published>2006-09-05T19:35:00.000+09:00</published><updated>2006-09-05T20:25:16.973+09:00</updated><title type='text'>exit_false</title><content type='html'>I found new instruction, 'exit_false,' in Directory module. This instruction is found in the format of 'exit_false selector_m_error.'&lt;br /&gt;&lt;br /&gt;'Selector_m_error' is defined in '_system.abc' file as below;&lt;br /&gt;&lt;pre&gt;.o 0 0&lt;br /&gt;selector_m_error&lt;br /&gt;   print "Run time error, selector does not match"&lt;br /&gt;   halt&lt;/pre&gt;This means that when jumping to 'select_m_error' label follows executing 'exit_false' instruction. It seems that 'exit_false' is a alias of 'jmp_false.'&lt;br /&gt;&lt;br /&gt;I don't know what sort of programs are compiled to instructions using 'exit_false.'&lt;br /&gt;&lt;hr /&gt;&lt;pre&gt;::A a b = A a&lt;br /&gt;       | B b&lt;br /&gt;&lt;br /&gt;Start = (f (A 1), f (B 'a'))&lt;br /&gt;&lt;br /&gt;f aa = let (A a) = aa&lt;br /&gt;      in a&lt;/pre&gt;will compiled to instructions using 'exit_false.'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115745386675298387?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115745386675298387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115745386675298387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115745386675298387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115745386675298387'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/exitfalse.html' title='exit_false'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115729507020180915</id><published>2006-09-03T23:32:00.000+09:00</published><updated>2006-09-03T23:51:10.230+09:00</updated><title type='text'>Directory</title><content type='html'>I am thinking about porting Directory library. Directory library uses &lt;span style="font-style: italic;"&gt;ccall&lt;/span&gt; instruction.&lt;br /&gt;&lt;br /&gt;StdFile module has rather simple implementation&lt;span style="font-style: italic;"&gt;&lt;/span&gt;, deletating all functions to system module. But Directory module has its own implementation in addition to an external module implemented with c language and uses &lt;span style="font-style: italic;"&gt;ccall&lt;/span&gt; to connect between the Directory module and the external module unlike StdFile module implementation.&lt;br /&gt;&lt;br /&gt;When poring StdFile module I didn't need to implement &lt;span style="font-style: italic;"&gt;ccall&lt;/span&gt; instruction, and When porting ArgEnv module which also uses &lt;span style="font-style: italic;"&gt;ccall&lt;/span&gt; instruction I implant corresponding implementation instead of implementing &lt;span style="font-style: italic;"&gt;ccall&lt;/span&gt; instruction. But it may be better to implement &lt;span style="font-style: italic;"&gt;ccall&lt;/span&gt; instruction when porting Directory library.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115729507020180915?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115729507020180915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115729507020180915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115729507020180915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115729507020180915'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/directory.html' title='Directory'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115729193740976006</id><published>2006-09-03T22:53:00.000+09:00</published><updated>2006-09-03T22:58:57.420+09:00</updated><title type='text'>ArgEnv</title><content type='html'>I completed porting ArgEnv library. This work is rather easy.&lt;br /&gt;&lt;br /&gt;I used &lt;span style="font-style: italic;"&gt;System.getenv()&lt;/span&gt; method to implement &lt;span style="font-style: italic;"&gt;getEnvironmentVariable&lt;/span&gt; function. This method was marked as deprecated before and is available since Java1.5 released. So the &lt;span style="font-style: italic;"&gt;getEnvironmentVariable&lt;/span&gt; function of the ported ArgEnv library is not available before Java1.4.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115729193740976006?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115729193740976006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115729193740976006' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115729193740976006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115729193740976006'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/argenv.html' title='ArgEnv'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115727331554569393</id><published>2006-09-03T17:47:00.000+09:00</published><updated>2006-09-03T17:48:35.553+09:00</updated><title type='text'>Check-In</title><content type='html'>I checked in my current changes. Main changes are  enabling GenParse, GenPrint and StdDebug.&lt;br /&gt;&lt;br /&gt;see &lt;a href="http://svn.sourceforge.net/viewvc/cleanj/"&gt;http://svn.sourceforge.net/viewvc/cleanj/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115727331554569393?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115727331554569393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115727331554569393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115727331554569393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115727331554569393'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/check-in.html' title='Check-In'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115726928606481493</id><published>2006-09-03T16:25:00.000+09:00</published><updated>2006-09-03T16:41:26.073+09:00</updated><title type='text'>GenParse/GenPrint</title><content type='html'>I worked on GenParse/GenPrint today, and fixed Instruction.icl on missing quotation of eqC_b and implementatio of eqAC_a.&lt;br /&gt;&lt;br /&gt;Then I tested a test for GenParse/GenPrint and realized that GenParse on Bool values are not working correctly.&lt;br /&gt;&lt;br /&gt;I decided previously to use Java convention of printing boolean values instead of Clean one, where true value is printed as "true" and false value is printed as "false" instead of Clean convention of "True" and "False". This decision is because of convenience of connecting CleanJ programs to Java programs.&lt;br /&gt;&lt;br /&gt;Because GenParse implementation is expected that Bool values are printed according to Clean convention in input text, when CleanJ prints Bool values in Java convention GenParse failed to parse Bool values correctly.&lt;br /&gt;&lt;br /&gt;So I have changed "True" and "False" to "true" and "false" respectively in GenParse.abc. This change makes a test passes but this prescription is certainly ad-hoc and more consideration needed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115726928606481493?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115726928606481493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115726928606481493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115726928606481493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115726928606481493'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/genparsegenprint.html' title='GenParse/GenPrint'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115720966741043282</id><published>2006-09-02T23:33:00.000+09:00</published><updated>2006-09-03T00:08:45.756+09:00</updated><title type='text'>TAPL Chapter 23 &amp; 24</title><content type='html'>Type quantifiers ∀ and  ∃ are discribed for each in chapter 23 and chapter 24. Chapter 23 studies a system of parametric polimorphism, namely System F and introduces a type quantifier ∀. Chapter 24 introduces an existential type and a type quantifier &amp;exist; and studies module systems of Abstract Data Types and Existential Objects.&lt;br /&gt;&lt;br /&gt;Clean has a module system with a syntax of abstract data types and class type system in addition to an existential type system. These features are all a kind of abstract data types described in Chapter 23 and no syntax exists that is oriented to an existential object approach. Of course using an existential type system we can manually create those kind of objects but that work is rather elaborate and boring.&lt;br /&gt;&lt;br /&gt;I think Clean has ample type features and enough flexibility but is short of syntax sugar and it is better to make some preprocessing system like camlp4 for ocaml.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115720966741043282?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115720966741043282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115720966741043282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115720966741043282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115720966741043282'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/09/tapl-chapter-23-24.html' title='TAPL Chapter 23 &amp; 24'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115695213756088475</id><published>2006-08-31T00:15:00.000+09:00</published><updated>2006-08-31T00:36:29.153+09:00</updated><title type='text'>Check-In</title><content type='html'>I checked in the current change on seek/position operations and data file io operations.&lt;br /&gt;&lt;br /&gt;I previously stated my next job is to port  Directory library and command line argument  supporting library, but before doing them  I will port the remaining of Generics library that was not ported when porting Generics library before porting File I/O.&lt;br /&gt;&lt;br /&gt;The remaining files are GenParse.dcl/icl and GenPrint.dcl/icl.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115695213756088475?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115695213756088475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115695213756088475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115695213756088475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115695213756088475'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/check-in_30.html' title='Check-In'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115689697772475260</id><published>2006-08-30T09:04:00.000+09:00</published><updated>2006-08-30T09:16:41.120+09:00</updated><title type='text'>Implementing file io operations finished</title><content type='html'>I finally implemented clean's all file io operations. I am going to create and run several tests for newly implemented data file io operations, and to check in the results in a few days.&lt;br /&gt;&lt;br /&gt;The remaining jobs are to port Directory library and to support command line arguments by creating ArgEnvJava library similar to ArgEnvWindows or ArgEnvUnix in clean standard library. When those jobs are completed, I will port cleanj.exe to run on cleanj runtime and test all tests under the metacircular translator.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115689697772475260?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115689697772475260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115689697772475260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115689697772475260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115689697772475260'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/implementing-file-io-operations.html' title='Implementing file io operations finished'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115686069330616964</id><published>2006-08-29T23:00:00.000+09:00</published><updated>2006-08-29T23:11:33.333+09:00</updated><title type='text'>TAPL Chapter 22</title><content type='html'>I have read the chapter. It is on type reconstruction. I have found some familiar terms, especially the name of 'Clean.'&lt;br /&gt;&lt;br /&gt;I have heard of Let-polimorphism and value restriction but had no idea what it is before reading it. I also learnt type classes are rooted in type reconstruction of record types and Milner-Mycroft Calculus is an extension to allow polymorphic recursion.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115686069330616964?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115686069330616964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115686069330616964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115686069330616964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115686069330616964'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/tapl-chapter-22.html' title='TAPL Chapter 22'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115668370462375171</id><published>2006-08-27T21:52:00.000+09:00</published><updated>2006-08-27T22:01:44.633+09:00</updated><title type='text'>Handling return code on Clean Text IO operations</title><content type='html'>Clean Text IO operations convert return code from '\r\n' to '\n' when reading text files. This enables for a programmer to treat any type of text file as uniformly having only one type of return code '\n' and this saves much time of programming.&lt;br /&gt;CleanJ also supports this feature.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115668370462375171?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115668370462375171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115668370462375171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115668370462375171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115668370462375171'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/handling-return-code-on-clean-text-io.html' title='Handling return code on Clean Text IO operations'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115660331325550775</id><published>2006-08-26T23:30:00.000+09:00</published><updated>2006-08-26T23:41:53.263+09:00</updated><title type='text'>TAPL Chapter 21</title><content type='html'>I don't proceed CleanJ project for recent 4 days because I have been struggling to understand &lt;a href="http://www.cis.upenn.edu/%7Ebcpierce/tapl/"&gt;TAPL&lt;/a&gt; Chapter 21.&lt;br /&gt;&lt;br /&gt;This chapter describes metatheory of recursive types using coinduction to prove the property of recursive types. It is very hard for me to understand this chapter because I am not familiar with coinduction, and it takes 4 days to read through.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115660331325550775?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115660331325550775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115660331325550775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115660331325550775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115660331325550775'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/tapl-chapter-21.html' title='TAPL Chapter 21'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115608670977379295</id><published>2006-08-21T00:10:00.000+09:00</published><updated>2006-08-21T00:11:49.786+09:00</updated><title type='text'>Check-In</title><content type='html'>I checked in my current code. Test for exceptional situations of text file IO opetations are added to the previous code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115608670977379295?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115608670977379295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115608670977379295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115608670977379295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115608670977379295'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/check-in_20.html' title='Check-In'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115607417744673285</id><published>2006-08-20T20:25:00.000+09:00</published><updated>2006-08-20T20:46:27.980+09:00</updated><title type='text'>Applying fshare to a file of FWriteText mode</title><content type='html'>&lt;pre&gt;Start :: *World -&gt; (Bool, Int, File)&lt;br /&gt;Start w # (_,f,w) = fopen "file/FileShare.test1" FWriteText w&lt;br /&gt;         sf = fshare f&lt;br /&gt;       = sfreadi sf&lt;br /&gt;&lt;/pre&gt;Against the intuition this code doesn't fail, but outputs as below;&lt;br /&gt;&lt;pre&gt;(True,0,(File 0 4254596))&lt;br /&gt;&lt;/pre&gt;Surprisingly this sfreadi function succeeds. It seems a bug.&lt;br /&gt;&lt;br /&gt;I think it should be failed to apply fshare function to a file whose mode is not compatible with share file operations. However, actual fshare function doesn't reject such file objects and sfreadXX functions rejects them.&lt;br /&gt;&lt;br /&gt;I am planning for fshare function of CleanJ to reject these file objects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115607417744673285?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115607417744673285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115607417744673285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115607417744673285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115607417744673285'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/applying-fshare-to-file-of-fwritetext.html' title='Applying fshare to a file of FWriteText mode'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115606046901961856</id><published>2006-08-20T16:26:00.000+09:00</published><updated>2006-08-20T17:31:41.616+09:00</updated><title type='text'>error pattern</title><content type='html'>Summarize error pattern of clean text file io operations.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;sfopen in FWriteText/FAppendText mode&lt;/li&gt;&lt;li&gt;fopen/sfopen/freopen in invalid file mode (ie. mode &amp;lt; 0 or 5 &amp;lt; mode)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;read file operations to a file of FWriteText/FAppendText mode&lt;/li&gt;&lt;li&gt;write file operations to a file of FReadText mode&lt;/li&gt;&lt;li&gt;fshare function to a file of FWriteText/FAppdnText mode&lt;/li&gt;&lt;li&gt;fshare function to standard input/output/error&lt;br /&gt;&lt;/li&gt;&lt;li&gt;share file functions to a non-share file&lt;/li&gt;&lt;li&gt;fseek function to standard input/output/error&lt;br /&gt;&lt;/li&gt;&lt;li&gt;freadline to a file of FReadData mode&lt;/li&gt;&lt;/ul&gt;Additionally, list check point of unknown behaviours.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;fend function to a file of FWriteText/FAppendText mode&lt;/li&gt;&lt;li&gt;fend function to a file of standard input/output/error&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115606046901961856?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115606046901961856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115606046901961856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115606046901961856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115606046901961856'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/error-pattern.html' title='error pattern'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115605736607287325</id><published>2006-08-20T15:55:00.000+09:00</published><updated>2006-08-20T16:02:46.080+09:00</updated><title type='text'>a bug of freadi function</title><content type='html'>Freadi function in FReadText mode may have a bug about the reading error flag.&lt;br /&gt;&lt;pre&gt;(ok,i,s) = freadi s&lt;br /&gt;&lt;/pre&gt;When evaluating this code, a variable 'ok' will always be 'false' even if io operation succeeds and input text format is valid.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115605736607287325?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115605736607287325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115605736607287325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115605736607287325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115605736607287325'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/bug-of-freadi-function.html' title='a bug of freadi function'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115599776715128641</id><published>2006-08-19T23:05:00.000+09:00</published><updated>2006-08-19T23:34:56.490+09:00</updated><title type='text'>Test for Text File IO operation</title><content type='html'>Finally I have finished my work to implement Clean Text File IO operations in CleanJ environment. And I am to test them to check its behaviour. Partly I have some tests but they do not have sufficient coverage, especially on file seek operation, standard error output operation, standard input operation, japanese text handling, and exceptional situation handling.&lt;br /&gt;&lt;br /&gt;Clean File IO function design doesn't have suitable type design and allows inconsistency, and if a program implemented irregularly it will get stuck and show some error messages. Because CleanJ has a policy to mimic Clean behaviour as possible, I have to check as many error messages as possible.&lt;br /&gt;&lt;br /&gt;Besides, Data File IO operations are not implemented yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115599776715128641?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115599776715128641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115599776715128641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115599776715128641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115599776715128641'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/test-for-text-file-io-operation.html' title='Test for Text File IO operation'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115597393064296358</id><published>2006-08-19T16:50:00.000+09:00</published><updated>2006-08-19T16:52:10.650+09:00</updated><title type='text'>Check-In</title><content type='html'>I checked in my current developping code which is changed in its implementation of CleanFile.java from using PushbackReader to using RandomAccessFile.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115597393064296358?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115597393064296358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115597393064296358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115597393064296358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115597393064296358'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/check-in_19.html' title='Check-In'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115591642228829563</id><published>2006-08-19T00:46:00.000+09:00</published><updated>2006-08-19T00:53:42.296+09:00</updated><title type='text'>Implementing normal text file operations finished.</title><content type='html'>Using RandomAccessFile, Charset, CharsetDecoder, ByteBuffer and CharBuffer. Additionally I uses Pattern, Matcher, System.getProperty("line.separator") to handle linefeeds properly according to the system environment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115591642228829563?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115591642228829563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115591642228829563' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115591642228829563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115591642228829563'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/implementing-normal-text-file.html' title='Implementing normal text file operations finished.'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115573681602056791</id><published>2006-08-16T22:38:00.000+09:00</published><updated>2006-08-17T08:46:11.533+09:00</updated><title type='text'>RandomAccessFile and CharsetDecorder</title><content type='html'>Using combination of &lt;a href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/io/RandomAccessFile.html"&gt;RandomAccessFile&lt;/a&gt; and &lt;a href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/nio/charset/CharsetDecoder.html"&gt;CharsetDecorder&lt;/a&gt; seems good but it has essential difficulty in it. In decoding by CharsetDecorder, input byte sequence is copied into &lt;a href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/nio/ByteBuffer.html"&gt;ByteBuffer&lt;/a&gt; and decoded char sequence is got through &lt;a href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/nio/CharBuffer.html"&gt;CharBuffer&lt;/a&gt;.  Since these two buffer are put between RandomAccessFile and CleanJ read operations, pinpointing exact file pointer index is far more difficult than when no decorder exist.&lt;br /&gt;&lt;br /&gt;One solution is to calculate current file pointer index from RandomAccessFile object's file pointer and remaining chars in CharBuffer and remaining bytes in ByteBuffer. It is a general solution but it has some efficiency overhead.&lt;br /&gt;&lt;br /&gt;Another solution is to abandon supporting fposition function and all share file operations, since share file operations uses file pointer to implement them. Fseek function can still be supported but when fposition function is not available, fseek function becomes less important.&lt;br /&gt;&lt;br /&gt;I am still torn apart and seeking other solutions.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;del&gt;I may have misunderstood the behaviour of CharsetDecorder. I am now wondering that the decorder retrieve minimal necessary amount of bytes from provided ByteBuffer and the required information to calculate current file pointer index are just RandomAccessFile object's file pointer and number of remaining bytes in ByteBuffer but number of chars of remaining chars in CharBuffer is not required.&lt;br /&gt;&lt;br /&gt;I am not sure. I will verify it later.&lt;/del&gt;&lt;br /&gt;&lt;hr /&gt;It was not true.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115573681602056791?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115573681602056791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115573681602056791' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115573681602056791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115573681602056791'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/randomaccessfile-and-charsetdecorder.html' title='RandomAccessFile and CharsetDecorder'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115568756386110768</id><published>2006-08-16T08:42:00.000+09:00</published><updated>2006-08-16T09:23:41.850+09:00</updated><title type='text'>difference of char type between clean and cleanj</title><content type='html'>CleanJ is aimed to behave almost the same as clean do, but in spite of the aim those two have some difference. One of the most significant differences is the representation of char type.&lt;br /&gt;&lt;br /&gt;Clean char is one byte, the same as C language. Clean String is a simple array of char and it ignores internationalization. If a program source code is written in Japanese Shift_JIS, then an executable file has Shift_JIS encoded strings. If the executable file read a text file written in Japanese EUC_JP, then a read function offers a EUC_JP encoded string. To resolve this discrepancy is a programmer's responsibility.&lt;br /&gt;&lt;br /&gt;On the other hand, CleanJ char is two byte UTF16 char, the same as Java language. CleanJ String is a simple array of this two byte char. Though a program source code is written in Japanese Shift_JIS, an generated class file has UTF16 encoded strings.&lt;br /&gt;&lt;br /&gt;Now I am trying to match text file read functions to this charset setting. I am planning to transform input text to UTF16 according to environment locale setting with the help of standard class library. While Reader class equips an appropriate decorder, RandomAccessFile doesn't and is required to implement some additional codes manually for decoding an input text from RandomAccessFile.&lt;br /&gt;&lt;br /&gt;One problem exists. This charset policy prevents from handling byte array directly. This is crucial in operating binary data file such as generating Java class file. I don't have final solution to this problem but am thinking these operations are provided by special library of CleanJ distribution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115568756386110768?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115568756386110768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115568756386110768' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115568756386110768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115568756386110768'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/difference-of-char-type-between-clean.html' title='difference of char type between clean and cleanj'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115565323374031309</id><published>2006-08-15T23:31:00.000+09:00</published><updated>2006-08-15T23:47:56.756+09:00</updated><title type='text'>ByteBuffer</title><content type='html'>Charset provides CharsetEncoder/CharsetDecorder which  translate  chars to bytes anc vice versa. When CharsetDecorder decodes bytes, these bytes are provided by ByteBuffer.&lt;br /&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/nio/ByteBuffer.html"&gt;http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/nio/ByteBuffer.html&lt;/a&gt;&lt;br /&gt;ByteBuffer are used as below;&lt;br /&gt;&lt;pre&gt;byte[] in = new byte[size];&lt;br /&gt;ByteBuffer buf = ByteBuffer.wrap(in);&lt;br /&gt;file.readFully(in);&lt;br /&gt;CharBuffer cbuf = charset.decode(buf);&lt;br /&gt;return cbuf.toString();&lt;br /&gt;&lt;/pre&gt;This implementation is only an imaginary code and may have flaws.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115565323374031309?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115565323374031309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115565323374031309' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115565323374031309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115565323374031309'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/bytebuffer.html' title='ByteBuffer'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115560124466665207</id><published>2006-08-15T09:18:00.000+09:00</published><updated>2006-08-15T09:20:44.676+09:00</updated><title type='text'>java.nio.charset.Charset</title><content type='html'>&lt;a href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/nio/charset/Charset.html"&gt;http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/nio/charset/Charset.html &lt;/a&gt;&lt;br /&gt;This is charset encode/decode library class in standard class library.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115560124466665207?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115560124466665207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115560124466665207' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115560124466665207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115560124466665207'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/javaniocharsetcharset.html' title='java.nio.charset.Charset'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115556977376426638</id><published>2006-08-15T00:30:00.000+09:00</published><updated>2006-08-15T00:36:13.780+09:00</updated><title type='text'>RandomAccessFile does not follow locale.</title><content type='html'>Since RandomAccessFile does not follow locale, readChar() method is not suitable for reading text file.&lt;br /&gt;To write function to read char from plain text file seems needed, or does any usefull class exist in standard library?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115556977376426638?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115556977376426638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115556977376426638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115556977376426638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115556977376426638'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/randomaccessfile-does-not-follow.html' title='RandomAccessFile does not follow locale.'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115551512943520344</id><published>2006-08-14T09:22:00.000+09:00</published><updated>2006-08-14T09:26:04.463+09:00</updated><title type='text'>Check-In</title><content type='html'>I checked in my recent updates and current snapshot.&lt;br /&gt;&lt;a href="http://svn.sourceforge.net/viewvc/cleanj/snapshots/"&gt;http://svn.sourceforge.net/viewvc/cleanj/snapshots/&lt;/a&gt;&lt;br /&gt;It enables some File IO operations whose tests are available in a test08 folder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115551512943520344?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115551512943520344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115551512943520344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115551512943520344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115551512943520344'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/check-in.html' title='Check-In'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115548427590691786</id><published>2006-08-14T00:47:00.000+09:00</published><updated>2006-08-14T00:51:15.913+09:00</updated><title type='text'>RandomAccessFile</title><content type='html'>I have been implemeted File IO functions  corresponding to StdFile in standard library. I uses PrintStream (for output) and PushbackStream (for input) but these are not suitable for random access which is needed to implement share file operations and a seek operation.&lt;br /&gt;Instead I found java.io.RandomAccessFile class right now and it may be better for the purpose.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115548427590691786?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115548427590691786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115548427590691786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115548427590691786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115548427590691786'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/randomaccessfile.html' title='RandomAccessFile'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115546584088750360</id><published>2006-08-13T19:38:00.000+09:00</published><updated>2006-08-13T19:44:00.896+09:00</updated><title type='text'>Current Directory in Java</title><content type='html'>While Clean has a problematic function for changing current directory, Java has no method for it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115546584088750360?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115546584088750360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115546584088750360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115546584088750360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115546584088750360'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/current-directory-in-java.html' title='Current Directory in Java'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115546456662282675</id><published>2006-08-13T18:18:00.000+09:00</published><updated>2006-08-13T19:22:46.660+09:00</updated><title type='text'>Current Directory</title><content type='html'>Directory library in clean has a function to change current directory, but its behaviour is problematic.&lt;br /&gt;Here is a test program.&lt;br /&gt;&lt;pre&gt;Start :: *World -&gt; ([String], [String])&lt;br /&gt;Start w # (s0,w) = accFiles f w&lt;br /&gt;         (s1,w) = accFiles f w&lt;br /&gt;       = (s0,s1)&lt;br /&gt;where&lt;br /&gt;f fs # (cp0,fs) = getCurrentDirectory fs&lt;br /&gt;       (cps0,fs) = pathToPD_String cp0 fs&lt;br /&gt;   &lt;br /&gt;       (_,f,fs) = fopen "file/test.txt" FReadText fs&lt;br /&gt;       (s,f) = freadline f&lt;br /&gt;       (_,fs) = fclose f fs&lt;br /&gt;   &lt;br /&gt;       ((_,p),fs) = pd_StringToPath ".." fs&lt;br /&gt;       (_,fs) = setCurrentDirectory p fs&lt;br /&gt;   &lt;br /&gt;       (cp1,fs) = getCurrentDirectory fs&lt;br /&gt;       (cps1,fs) = pathToPD_String cp1 fs&lt;br /&gt;&lt;br /&gt;     = ([cps0,"\n",s,cps1,"\n"],fs)&lt;br /&gt;&lt;/pre&gt;The result of this program is below;&lt;br /&gt;&lt;pre&gt;(["C:\Clean\test\test01","&lt;br /&gt;","abcdefghijklmnopqrstuvwxyz&lt;br /&gt;","C:\Clean\test","&lt;br /&gt;"],["C:\Clean\test","&lt;br /&gt;","abcdefghijklmnopqrstuvwxyz&lt;br /&gt;","C:\Clean","&lt;br /&gt;"])&lt;br /&gt;&lt;/pre&gt;Apparently the function call 'setCurrentDirectory p fs' affects not only 'fs' but also *World itself. Though this program does not violate the principal of reference transparency but it betrays an intuition.&lt;br /&gt;Moreover, this 'setCurrentDirectory' function does not affect 'fopen' function's current directory.  Although 'file/test.txt' does exist only at 'C:\Clean\test\test01\file\test.txt' but not at 'C:\Clean\test\file\test.txt', after the current directory move to 'C:\Clean\test' 'fopen' function for 'file\test.txt' succeeded. This behaviour is also confusing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115546456662282675?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115546456662282675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115546456662282675' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115546456662282675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115546456662282675'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/current-directory.html' title='Current Directory'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115536041397219775</id><published>2006-08-12T14:20:00.000+09:00</published><updated>2006-08-12T14:26:53.980+09:00</updated><title type='text'>_SystemStrictLists.abc</title><content type='html'>"_SystemStrictLists.abc" in StdEnv has some instructions for File IO and cleanj cannot compile the original file in itself. So far I modified the file to remove functions which contains those instructions.&lt;br /&gt;Now that File IO instructions are available, cleanj can compile the original "_SystemStrictLists.abc" file and I recover it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115536041397219775?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115536041397219775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115536041397219775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115536041397219775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115536041397219775'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/systemstrictlistsabc.html' title='_SystemStrictLists.abc'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115531017402209443</id><published>2006-08-12T00:21:00.000+09:00</published><updated>2006-08-12T00:29:34.053+09:00</updated><title type='text'>OutputStream/Writer</title><content type='html'>Yesterday I stated a question about PrintStream and PrintWriter.&lt;br /&gt;&lt;a href="http://lethevert.blogspot.com/2006/08/printstreamprintwiter.html"&gt;http://lethevert.blogspot.com/2006/08/printstreamprintwiter.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For now, I understand the difference between them. OutputStream is for binary data sequence output but Writer is for character sequence output.&lt;br /&gt;PrintStream is a subclass of OutputStream and PrintWriter is a subclass of Writer. They have overlapped area of application but Java implementation doesn't provide unified interface of that area. That is a problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115531017402209443?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115531017402209443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115531017402209443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115531017402209443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115531017402209443'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/outputstreamwriter.html' title='OutputStream/Writer'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115522181641316798</id><published>2006-08-10T23:46:00.000+09:00</published><updated>2006-08-10T23:56:56.433+09:00</updated><title type='text'>fshare</title><content type='html'>'Fshare' function changes '*File' data to 'File' data.&lt;br /&gt;This function mark current positon of input file and set shared flag. When sfreadX function called, the function will calculate current position from marked position in file descriptor and offset number in B-stack.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115522181641316798?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115522181641316798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115522181641316798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115522181641316798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115522181641316798'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/fshare.html' title='fshare'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115516911347177853</id><published>2006-08-10T09:14:00.000+09:00</published><updated>2006-08-10T09:18:33.486+09:00</updated><title type='text'>Share file operations</title><content type='html'>Mark(), reset() and skip() of InputStream may be useful for share file operations. First, mark first point of file and each time share file operation called reset() and skip() to ajust the position of file stream.&lt;br /&gt;It is quite expensive and if better idea exists I will adopt it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115516911347177853?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115516911347177853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115516911347177853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115516911347177853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115516911347177853'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/share-file-operations.html' title='Share file operations'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115513558734936941</id><published>2006-08-09T23:57:00.000+09:00</published><updated>2006-08-09T23:59:47.536+09:00</updated><title type='text'>PrintStream/PrintWiter</title><content type='html'>I don't know why PrintStream and PrintWriter both exist in java standard library. What is the difference between them.&lt;br /&gt;Some webpage says that PrintWriter is better, but System.out (standard output stream) is PrintStream.&lt;br /&gt;Does anyone know the difference?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115513558734936941?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115513558734936941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115513558734936941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115513558734936941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115513558734936941'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/printstreamprintwiter.html' title='PrintStream/PrintWiter'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115513444881435966</id><published>2006-08-09T23:25:00.000+09:00</published><updated>2006-08-09T23:40:48.863+09:00</updated><title type='text'>DataOutputStream</title><content type='html'>File operations of Clean have 6 types&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Read from a Text file&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Write to a new Text file&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Append to a Text file&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Read from a Data file&lt;/li&gt;&lt;li&gt;Write to a new Data file&lt;/li&gt;&lt;li&gt;Append to a Data file&lt;/li&gt;&lt;/ol&gt;Text file operations let programs read and write text data. For instance, an integer value 101 is represented as 3 characters '1' and '0' and '1'.&lt;br /&gt;Data file operations let programs read and write binary data. For instance, an integer value 101 is represented as 4 byte sequence 00000000,00000000,00000000,01100101 as binary number.&lt;br /&gt;There are no standard class library for text file operations but DataOutputStream/DataInputStream are suitable for data file operations.&lt;br /&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/io/DataOutputStream.html"&gt;http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/io/DataOutputStream.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/io/DataInputStream.html"&gt;http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/io/DataInputStream.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115513444881435966?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115513444881435966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115513444881435966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115513444881435966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115513444881435966'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/dataoutputstream.html' title='DataOutputStream'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115508276314218394</id><published>2006-08-09T09:11:00.000+09:00</published><updated>2006-08-09T09:20:30.116+09:00</updated><title type='text'>File structure</title><content type='html'>'File' structure consists of 2 B-values but its detail is not clear yet.&lt;br /&gt;I make a test program below;&lt;br /&gt;&lt;pre&gt;Start :: *World -&gt; (*File, File, File)&lt;br /&gt;Start w # (f,w) = stdio w&lt;br /&gt;         (_,sf,w) = sfopen "FileShare.test1" FReadText w&lt;br /&gt;         (sf1,f) = print 2 sf f&lt;br /&gt;         (sf2,f) = print 5 sf f&lt;br /&gt;       = (f, sf1, sf2)&lt;br /&gt;where&lt;br /&gt;   print 0 sf f = (sf, f)&lt;br /&gt;   print a sf f # (_,c,sf) = sfreadc sf&lt;br /&gt;                  f = fwritec c f&lt;br /&gt;                = print (dec a) sf f&lt;br /&gt;&lt;/pre&gt;This is to identify behaviour of share file operation and related structure of 'File' type.&lt;br /&gt;The result is;&lt;br /&gt;&lt;pre&gt;(ababcde(File -1 4258564),(File 2 4258692),(File 5 4258692))&lt;br /&gt;&lt;/pre&gt;This imply that 'File' structure consists of 1 Int value and 1 File handler. The first int value indecates offset value of share file operation, and it is not used for unique file operation (shown as -1).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115508276314218394?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115508276314218394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115508276314218394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115508276314218394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115508276314218394'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/file-structure.html' title='File structure'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115505118047683939</id><published>2006-08-08T23:43:00.000+09:00</published><updated>2006-08-09T00:33:00.513+09:00</updated><title type='text'>Why am I trying to create CleanJ</title><content type='html'>I found Concurrent Clean on June 30 last year. It has been just one year.&lt;br /&gt;Soon after, I realized the language is very flexible and I don't know why at that time. I don't know the reason sure but I think it is partly because its ability to arrange codes independent of the order of execution and I know that is one of main advantages of pure functional languages.&lt;br /&gt;I also noticed its restriction of dealing with side effect in a program is sometimes a heavy pressure in software design and implementation. Libraries and frameworks may be a solution of this restriction. ObjectIO is one of them. But creating such frameworks from scratch are also heavy task for ordinary programers.&lt;br /&gt;While Java is a common object-oriented programming language and it characterized by compiled object portability and its large number of libraries and frameworks. If Clean program can run on Java VM, its program may use those libraries and frameworks and it may cover its shortcoming.&lt;br /&gt;I am planning to build web application framework after CleanJ project comes to a stable version, and examine how to design such framework with the aid of libraries written in other languages.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115505118047683939?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115505118047683939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115505118047683939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115505118047683939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115505118047683939'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/why-am-i-trying-to-create-cleanj.html' title='Why am I trying to create CleanJ'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115504622438869619</id><published>2006-08-08T23:01:00.000+09:00</published><updated>2006-08-08T23:10:24.400+09:00</updated><title type='text'>Strict array and list of File type</title><content type='html'>'File' structure consists of 2 B-values and 'buildF_b' instruction makes 1 A-value out of these 2 B-values.&lt;br /&gt;Strict File array '{#*File}' is compiled into such instructions below:&lt;br /&gt;&lt;pre&gt;create_array_ _ 1 0&lt;br /&gt;&lt;/pre&gt;It is the same as ordinary A-value array like '{String}'.&lt;br /&gt;Strict File List '[#*File]' is, however, is compiled into a B-value strict list such as:&lt;br /&gt;&lt;pre&gt;fill_r _Consf 1 2 4 0 0&lt;br /&gt;&lt;/pre&gt;It seems that the clean compiler has a bug in treating strict File array, but I don't know what is correct behaviour of the compiler.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115504622438869619?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115504622438869619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115504622438869619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115504622438869619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115504622438869619'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/strict-array-and-list-of-file-type.html' title='Strict array and list of File type'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115499601318831803</id><published>2006-08-08T09:08:00.000+09:00</published><updated>2006-08-08T09:20:35.666+09:00</updated><title type='text'>comment and 'jcall' instruction</title><content type='html'>In ABC instructions, a line beginning with '|' is a comment line where the CodeGenerator ignore it.&lt;br /&gt;When I introduce some instructions for cleanj, I will make these new instructions begin with '|' so that the original code generator will ignore these new instructions.&lt;br /&gt;&lt;pre&gt;Start = f 1&lt;br /&gt;&lt;br /&gt;f a = code inline {&lt;br /&gt;   |jcall&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;This program above makes 1 ignoring '|jcall' instruction. Correspondent ABC machine code is below:&lt;br /&gt;&lt;pre&gt;s2&lt;br /&gt;.inline f&lt;br /&gt;   |jcall&lt;br /&gt;.end&lt;br /&gt;&lt;br /&gt;.d 1 0&lt;br /&gt;   rtn&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115499601318831803?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115499601318831803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115499601318831803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115499601318831803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115499601318831803'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/comment-and-jcall-instruction.html' title='comment and &apos;jcall&apos; instruction'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115495967080415081</id><published>2006-08-07T23:03:00.000+09:00</published><updated>2006-08-07T23:07:50.823+09:00</updated><title type='text'>ABC machine instructions for File I/O</title><content type='html'>&lt;ul&gt;&lt;li&gt;buildF_b&lt;/li&gt;&lt;li&gt;fillF_b&lt;/li&gt;&lt;/ul&gt;These two instructions are for File I/O.&lt;br /&gt;'buildF_b' is to build an A-value for File structure from two B-values.&lt;br /&gt;'fillF_b' is to change a node to represent File structure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115495967080415081?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115495967080415081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115495967080415081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115495967080415081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115495967080415081'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/abc-machine-instructions-for-file-io.html' title='ABC machine instructions for File I/O'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115495805142181904</id><published>2006-08-07T22:23:00.000+09:00</published><updated>2006-08-07T22:43:16.550+09:00</updated><title type='text'>StdFile</title><content type='html'>StdFile is a file manipulation library of Clean language.&lt;br /&gt;In StdFile.icl, which is implementation module of StdFile, those system functions are called.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;openF :: !String !Int -&gt; (!Bool, !*File)&lt;/li&gt;&lt;li&gt;closeF :: !*File -&gt; Bool&lt;br /&gt;&lt;/li&gt;&lt;li&gt;stdioF :: *File&lt;/li&gt;&lt;li&gt;openSF :: !String !Int -&gt; (!Bool, !File)&lt;/li&gt;&lt;li&gt;reopenF :: !*File !Int -&gt; (!Bool, !*File)&lt;/li&gt;&lt;li&gt;readFC :: !*File -&gt; (!Bool, !Char, !*File)&lt;/li&gt;&lt;li&gt;readFI :: !*File -&gt; (!Bool,!Int,!*File)&lt;/li&gt;&lt;li&gt;readFR :: !*File -&gt; (!Bool,!Real,!*File)&lt;/li&gt;&lt;li&gt;readFS :: !*File !Int -&gt; (!*String,!*File)&lt;/li&gt;&lt;li&gt;readFString :: !Int !Int !*String !*File -&gt; (!Int,!*String,!*File)&lt;/li&gt;&lt;li&gt;readLineF :: !*File -&gt; (!*String,!*File)&lt;/li&gt;&lt;li&gt;writeFC :: !Char !*File -&gt; *File&lt;/li&gt;&lt;li&gt;writeFI :: !Int !*File -&gt; *File&lt;/li&gt;&lt;li&gt;writeFR :: !Real !*File -&gt; *File&lt;/li&gt;&lt;li&gt;writeFS :: !String !*File -&gt; *File&lt;/li&gt;&lt;li&gt;writeFString :: !Int !Int !String !*File -&gt; *File&lt;/li&gt;&lt;li&gt;endF :: !*File -&gt; (!Bool,!*File)&lt;/li&gt;&lt;li&gt;errorF :: !*File -&gt; (!Bool,!*File)&lt;/li&gt;&lt;li&gt;positionF :: !*File -&gt; (!Int,!*File)&lt;/li&gt;&lt;li&gt;seekF :: !*File !Int !Int -&gt; (!Bool,!*File)&lt;/li&gt;&lt;li&gt;stderrF :: *File&lt;/li&gt;&lt;li&gt;readSFC :: !File -&gt; (!Bool,!Char,!File)&lt;/li&gt;&lt;li&gt;readSFI :: !File -&gt; (!Bool,!Int,!File)&lt;/li&gt;&lt;li&gt;readSFR :: !File -&gt; (!Bool,!Real,!File)&lt;/li&gt;&lt;li&gt;readSFS :: !File !Int -&gt; (!*String,!File)&lt;/li&gt;&lt;li&gt;readLineSF :: !File -&gt; (!*String,!File)&lt;/li&gt;&lt;li&gt;seekSF :: !File !Int !Int -&gt; (!Bool,!File)&lt;/li&gt;&lt;li&gt;shareF :: !*File -&gt; File&lt;/li&gt;&lt;li&gt;endSF :: !File -&gt; Bool&lt;/li&gt;&lt;li&gt;positionSF :: !File -&gt; Int&lt;/li&gt;&lt;/ul&gt;'File' structure seems to be a basic value of two words.&lt;br /&gt;I don't know the merits of share File functions are defined.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115495805142181904?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115495805142181904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115495805142181904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115495805142181904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115495805142181904'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/stdfile.html' title='StdFile'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115495531880570900</id><published>2006-08-07T21:52:00.000+09:00</published><updated>2006-08-07T22:20:49.220+09:00</updated><title type='text'>World -&gt; World</title><content type='html'>If you create such program that&lt;br /&gt;&lt;pre&gt;Start :: *World -&gt; *World&lt;br /&gt;Start w = w&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;correspondent ABC machine code is&lt;br /&gt;&lt;pre&gt;__World_Start&lt;br /&gt;    buildI 65536&lt;br /&gt;    build _ 1 n1&lt;br /&gt;.d 1 0&lt;br /&gt;    jmp _driver&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;'__World_Start' is an entry point to this program, and Number '65536' is actual value of '*World'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115495531880570900?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115495531880570900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115495531880570900' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115495531880570900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115495531880570900'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/world-world.html' title='World -&gt; World'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-115490976235465686</id><published>2006-08-07T09:09:00.000+09:00</published><updated>2006-08-07T22:43:59.586+09:00</updated><title type='text'>CleanJ</title><content type='html'>Current status of CleanJ is ...&lt;br /&gt;&lt;ul&gt;&lt;li&gt;translate .abc file into .java file&lt;/li&gt;&lt;li&gt;support any basic features except file manipulate operations&lt;/li&gt;&lt;li&gt;ported StdEnv except StdFile and StdDebug&lt;/li&gt;&lt;li&gt;ported StdLib&lt;/li&gt;&lt;li&gt;ported MersenneTwister&lt;/li&gt;&lt;li&gt;ported Generics except GenParse and GenPrint&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-115490976235465686?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/115490976235465686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=115490976235465686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115490976235465686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/115490976235465686'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2006/08/cleanj.html' title='CleanJ'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12373518.post-112339469133249806</id><published>2005-08-07T15:04:00.000+09:00</published><updated>2005-08-07T15:04:51.340+09:00</updated><title type='text'>quine of Concurrent Clean</title><content type='html'>&lt;pre&gt;module m;import StdEnv;Start w#(s,w)=stdio w;#s=fwrites(x+++c+++x+++c)s;#(_,w)=fclose s w;=w;c=toString(toChar 34);x="module m;import StdEnv;Start w#(s,w)=stdio w;#s=fwrites(x+++c+++x+++c)s;#(_,w)=fclose s w;=w;c=toString(toChar 34);x="&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12373518-112339469133249806?l=lethevert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lethevert.blogspot.com/feeds/112339469133249806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12373518&amp;postID=112339469133249806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/112339469133249806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12373518/posts/default/112339469133249806'/><link rel='alternate' type='text/html' href='http://lethevert.blogspot.com/2005/08/quine-of-concurrent-clean.html' title='quine of Concurrent Clean'/><author><name>nuko</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
