<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sikios &#187; プログラミング</title>
	<atom:link href="http://sikios.com/wordpress/category/computer/programing/feed/" rel="self" type="application/rss+xml" />
	<link>http://sikios.com/wordpress</link>
	<description>C++とかC#とか</description>
	<lastBuildDate>Mon, 19 Jul 2010 10:46:15 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>ウィンドウメッセージ</title>
		<link>http://sikios.com/wordpress/20100709/%e3%82%a6%e3%82%a3%e3%83%b3%e3%83%89%e3%82%a6%e3%83%a1%e3%83%83%e3%82%bb%e3%83%bc%e3%82%b8/</link>
		<comments>http://sikios.com/wordpress/20100709/%e3%82%a6%e3%82%a3%e3%83%b3%e3%83%89%e3%82%a6%e3%83%a1%e3%83%83%e3%82%bb%e3%83%bc%e3%82%b8/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 19:27:19 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=1197</guid>
		<description><![CDATA[フォームアプリケーションでは使う機会は少ないけれども、用意しておくと便利かもしれない。 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232namespace Siki.Libra &#91;&#60;AutoOpen&#62;&#93; module WinUser = &#160; &#160; type WM = &#160; &#160; &#124; WM_NULL &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; = 0x0000 &#160; &#160; &#124; CREATE &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;= 0x0001 &#160; &#160; &#124; DESTROY &#160; ]]></description>
			<content:encoded><![CDATA[<p>フォームアプリケーションでは使う機会は少ないけれども、用意しておくと便利かもしれない。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;height:690px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br />195<br />196<br />197<br />198<br />199<br />200<br />201<br />202<br />203<br />204<br />205<br />206<br />207<br />208<br />209<br />210<br />211<br />212<br />213<br />214<br />215<br />216<br />217<br />218<br />219<br />220<br />221<br />222<br />223<br />224<br />225<br />226<br />227<br />228<br />229<br />230<br />231<br />232<br /></div></td><td><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">namespace Siki<span style="color: #a52a2a;">.</span><span style="color: #060;">Libra</span><br />
<br />
<span style="color: #6c6;">&#91;</span><span style="color: #a52a2a;">&lt;</span>AutoOpen<span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#93;</span><br />
<span style="color: #06c; font-weight: bold;">module</span> WinUser <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">type</span> WM <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> WM_NULL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0000<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CREATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0001<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DESTROY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0002<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0003<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0005<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SETFOCUS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0007<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> KILLFOCUS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0008<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ENABLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x000A<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SETREDRAW &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x000B<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SETTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x000C<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GETTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x000D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GETTEXTLENGTH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x000E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PAINT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x000F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CLOSE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0010<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> QUERYENDSESSION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0011<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> QUIT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0012<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> QUERYOPEN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0013<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ERASEBKGND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0014<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SYSCOLORCHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0015<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ENDSESSION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0016<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SHOWWINDOW &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0018<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> WININICHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x001A<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DEVMODECHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x001B<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ACTIVATEAPP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x001C<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> FONTCHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x001D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> TIMECHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x001E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CANCELMODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x001F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SETCURSOR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0020<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOUSEACTIVATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0021<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CHILDACTIVATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0022<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> QUEUESYNC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0023<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PAINTICON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0026<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ICONERASEBKGND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0027<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NEXTDLGCTL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0028<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SPOOLERSTATUS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x002A<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DRAWITEM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x002B<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MEASUREITEM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x002C<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DELETEITEM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x002D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> VKEYTOITEM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x002E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CHARTOITEM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x002F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SETFONT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0030<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GETFONT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0031<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SETHOTKEY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0032<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GETHOTKEY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0033<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> QUERYDRAGICON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0037<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> COMPAREITEM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0039<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GETOBJECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x003D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> COMPACTING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0041<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> COMMNOTIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0044<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> WINDOWPOSCHANGING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0046<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> WINDOWPOSCHANGED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0047<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> POWER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0048<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> COPYDATA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x004A<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CANCELJOURNAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x004B<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NOTIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x004E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> INPUTLANGCHANGEREQUEST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0050<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> INPUTLANGCHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0051<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> TCARD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0052<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> HELP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0053<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> USERCHANGED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0054<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NOTIFYFORMAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0055<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CONTEXTMENU &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x007B<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> STYLECHANGING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x007C<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> STYLECHANGED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x007D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DISPLAYCHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x007E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GETICON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x007F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SETICON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0080<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCCREATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0081<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCDESTROY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0082<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCCALCSIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0083<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCHITTEST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0084<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCPAINT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0085<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCACTIVATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0086<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GETDLGCODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0087<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SYNCPAINT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0088<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCMOUSEMOVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A0<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCLBUTTONDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A1<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCLBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A2<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCLBUTTONDBLCLK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A3<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCRBUTTONDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A4<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCRBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A5<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCRBUTTONDBLCLK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A6<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCMBUTTONDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A7<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCMBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A8<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCMBUTTONDBLCLK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00A9<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCXBUTTONDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00AB<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCXBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00AC<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NCXBUTTONDBLCLK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00AD<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> INPUT_DEVICE_CHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00FE<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> INPUT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x00FF<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> KEYFIRST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0100<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> UNICHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0109<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> KEYLAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0109<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_STARTCOMPOSITION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x010D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_ENDCOMPOSITION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x010E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_COMPOSITION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x010F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_KEYLAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x010F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> KEYDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0100<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> KEYUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0101<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0102<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DEADCHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0103<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SYSKEYDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0104<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SYSKEYUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0105<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SYSCHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0106<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SYSDEADCHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0107<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> INITDIALOG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0110<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> COMMAND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0111<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SYSCOMMAND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0112<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> TIMER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0113<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> HSCROLL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0114<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> VSCROLL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0115<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> INITMENU &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0116<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> INITMENUPOPUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0117<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GESTURE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0119<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GESTURENOTIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x011A<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MENUSELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x011F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MENUCHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0120<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ENTERIDLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0121<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MENURBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0122<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MENUDRAG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0123<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MENUGETOBJECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0124<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> UNINITMENUPOPUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0125<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MENUCOMMAND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0126<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CHANGEUISTATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0127<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> UPDATEUISTATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0128<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> QUERYUISTATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0129<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CTLCOLORMSGBOX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0132<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CTLCOLOREDIT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0133<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CTLCOLORLISTBOX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0134<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CTLCOLORBTN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0135<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CTLCOLORDLG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0136<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CTLCOLORSCROLLBAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0137<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CTLCOLORSTATIC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0138<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOUSEFIRST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0200<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOUSEMOVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0200<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> LBUTTONDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0201<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> LBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0202<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> LBUTTONDBLCLK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0203<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> RBUTTONDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0204<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> RBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0205<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> RBUTTONDBLCLK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0206<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MBUTTONDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0207<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0208<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MBUTTONDBLCLK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0209<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOUSEWHEEL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x020A<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> XBUTTONDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x020B<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> XBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x020C<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> XBUTTONDBLCLK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x020D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOUSEHWHEEL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x020E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOUSELAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x020E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PARENTNOTIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0210<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ENTERMENULOOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0211<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> EXITMENULOOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0212<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> NEXTMENU &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0213<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SIZING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0214<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CAPTURECHANGED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0215<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOVING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0216<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> POWERBROADCAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0218<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDICREATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0220<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDIDESTROY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0221<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDIACTIVATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0222<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDIRESTORE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0223<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDINEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0224<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDIMAXIMIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0225<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDITILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0226<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDICASCADE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0227<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDIICONARRANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0228<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDIGETACTIVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0229<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDISETMENU &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0230<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ENTERSIZEMOVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0231<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> EXITSIZEMOVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0232<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DROPFILES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0233<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MDIREFRESHMENU &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0234<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> TOUCH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0240<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_SETCONTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0281<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_NOTIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0282<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_CONTROL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0283<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_COMPOSITIONFULL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0284<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_SELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0285<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_CHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0286<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_REQUEST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0288<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_KEYDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0290<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> IME_KEYUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0291<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOUSEHOVER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x02A1<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> MOUSELEAVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x02A3<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> WTSSESSION_CHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x02B1<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> TABLET_FIRST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x02c0<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> TABLET_LAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x02df<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CUT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0300<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> COPY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0301<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PASTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0302<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CLEAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0303<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> UNDO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0304<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> RENDERFORMAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0305<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> RENDERALLFORMATS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0306<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DESTROYCLIPBOARD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0307<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DRAWCLIPBOARD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0308<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PAINTCLIPBOARD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0309<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> VSCROLLCLIPBOARD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x030A<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> SIZECLIPBOARD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x030B<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> ASKCBFORMATNAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x030C<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CHANGECBCHAIN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x030D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> HSCROLLCLIPBOARD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x030E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> QUERYNEWPALETTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x030F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PALETTEISCHANGING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0310<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PALETTECHANGED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0311<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> HOTKEY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0312<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PRINT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0317<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PRINTCLIENT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0318<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> APPCOMMAND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0319<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> THEMECHANGED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x031A<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> CLIPBOARDUPDATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x031D<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DWMCOMPOSITIONCHANGED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x031E<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DWMNCRENDERINGCHANGED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x031F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DWMCOLORIZATIONCOLORCHANGED &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0320<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DWMWINDOWMAXIMIZEDCHANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0321<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DWMSENDICONICTHUMBNAIL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0323<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> DWMSENDICONICLIVEPREVIEWBITMAP &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0326<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> GETTITLEBARINFOEX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x033F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> HANDHELDFIRST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0358<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> HANDHELDLAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x035F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> AFXFIRST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0360<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> AFXLAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x037F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PENWINFIRST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x0380<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> PENWINLAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x038F<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> USER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> 0x0400<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">|</span> APP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">=</span> 0x8000</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100709/%e3%82%a6%e3%82%a3%e3%83%b3%e3%83%89%e3%82%a6%e3%83%a1%e3%83%83%e3%82%bb%e3%83%bc%e3%82%b8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F# メモ XNA Framework</title>
		<link>http://sikios.com/wordpress/20100313/f-%e3%83%a1%e3%83%a2-xna-framework/</link>
		<comments>http://sikios.com/wordpress/20100313/f-%e3%83%a1%e3%83%a2-xna-framework/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 13:08:00 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=1172</guid>
		<description><![CDATA[F#でも XNA が使用できます。 ただし .NET Framework 4.0 ではビルドできませんでした。3.5 なら問題なくビルドできます。 おそらく、 XNA Game Studio 4.0 がリリースされれば .NET Framework 4.0 でもビルドできるようになると思われます。 BasicComponents.fs 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778namespace Siki open System open System.Collections.Generic open Microsoft.Xna.Framework module BasicComponents = &#160; &#160; &#160; &#160; /// 秒を表す単位 &#160; &#160; &#91;&#60;Measure&#62;&#93; &#160; &#160; type sec = &#160; &#160; &#160; &#160; static member Unit v = v ]]></description>
			<content:encoded><![CDATA[<p>F#でも XNA が使用できます。<br />
ただし .NET Framework 4.0 ではビルドできませんでした。3.5 なら問題なくビルドできます。<br />
おそらく、 XNA Game Studio 4.0 がリリースされれば .NET Framework 4.0 でもビルドできるようになると思われます。</p>
<p>BasicComponents.fs</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;height:690px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br /></div></td><td><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">namespace Siki<br />
<br />
<span style="color: #06c; font-weight: bold;">open</span> System<br />
<span style="color: #06c; font-weight: bold;">open</span> System<span style="color: #a52a2a;">.</span><span style="color: #060;">Collections</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Generic</span><br />
<span style="color: #06c; font-weight: bold;">open</span> Microsoft<span style="color: #a52a2a;">.</span><span style="color: #060;">Xna</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Framework</span><br />
<br />
<span style="color: #06c; font-weight: bold;">module</span> BasicComponents <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 秒を表す単位<br />
&nbsp; &nbsp; <span style="color: #6c6;">&#91;</span><span style="color: #a52a2a;">&lt;</span>Measure<span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">type</span> sec <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; static member Unit v <span style="color: #a52a2a;">=</span> v <span style="color: #a52a2a;">*</span> <span style="color: #c6c;">1.0</span><span style="color: #a52a2a;">&lt;</span>sec<span style="color: #a52a2a;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; static member Unit v <span style="color: #a52a2a;">=</span> v <span style="color: #a52a2a;">*</span> <span style="color: #c6c;">1</span><span style="color: #a52a2a;">&lt;</span>sec<span style="color: #a52a2a;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #a52a2a;">///</span> フレームを表す単位<br />
&nbsp; &nbsp; <span style="color: #6c6;">&#91;</span><span style="color: #a52a2a;">&lt;</span>Measure<span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">type</span> frame <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> <span style="color: #c6c;">1</span>フレームを表す<br />
&nbsp; &nbsp; &nbsp; &nbsp; static member Unit v <span style="color: #a52a2a;">=</span> v <span style="color: #a52a2a;">*</span> <span style="color: #c6c;">1.0</span><span style="color: #a52a2a;">&lt;</span>frame<span style="color: #a52a2a;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; static member Unit v <span style="color: #a52a2a;">=</span> v <span style="color: #a52a2a;">*</span> <span style="color: #c6c;">1</span><span style="color: #a52a2a;">&lt;</span>frame<span style="color: #a52a2a;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #a52a2a;">///</span> <span style="color: #c6c;">1</span>秒あたりの描画フレーム数を計算するコンポーネント<br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">type</span> FpsComponent<span style="color: #6c6;">&#40;</span>game, syncv, fixedStep, targetFps<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">inherit</span> DrawableGameComponent<span style="color: #6c6;">&#40;</span>game<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">//</span> フィールド<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> &nbsp; &nbsp; &nbsp; &nbsp; m_interval &nbsp; <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">1.0</span><span style="color: #a52a2a;">&lt;</span>sec<span style="color: #a52a2a;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_fps &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> <span style="color: #c6c;">0.0</span><span style="color: #a52a2a;">&lt;</span>frame<span style="color: #a52a2a;">/</span>sec<span style="color: #a52a2a;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_sec &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a52a2a;">=</span> <span style="color: #c6c;">0.0</span><span style="color: #a52a2a;">&lt;</span>sec<span style="color: #a52a2a;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_framecount <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">0.0</span><span style="color: #a52a2a;">&lt;</span>frame<span style="color: #a52a2a;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_lastupdate <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">0.0</span><span style="color: #a52a2a;">&lt;</span>sec<span style="color: #a52a2a;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">//</span> メインコンストラクタ<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> graphics <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; game<span style="color: #a52a2a;">.</span><span style="color: #060;">Services</span><span style="color: #a52a2a;">.</span><span style="color: #060;">GetService</span><span style="color: #6c6;">&#40;</span>typeof<span style="color: #a52a2a;">&lt;</span>IGraphicsDeviceManager<span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">:</span>?<span style="color: #a52a2a;">&gt;</span> GraphicsDeviceManager<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; graphics<span style="color: #a52a2a;">.</span><span style="color: #060;">SynchronizeWithVerticalRetrace</span> <span style="color: #a52a2a;">&lt;-</span> syncv<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; game<span style="color: #a52a2a;">.</span><span style="color: #060;">IsFixedTimeStep</span> <span style="color: #a52a2a;">&lt;-</span> fixedStep<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; game<span style="color: #a52a2a;">.</span><span style="color: #060;">TargetElapsedTime</span> <span style="color: #a52a2a;">&lt;-</span> TimeSpan<span style="color: #a52a2a;">.</span><span style="color: #060;">FromSeconds</span><span style="color: #6c6;">&#40;</span><span style="color: #c6c;">1.0</span> <span style="color: #a52a2a;">/</span> targetFps<span style="color: #6c6;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> カスタムコンストラクタ<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">new</span><span style="color: #6c6;">&#40;</span>game<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">new</span> FpsComponent<span style="color: #6c6;">&#40;</span>game, <span style="color: #06c; font-weight: bold;">false</span>, <span style="color: #06c; font-weight: bold;">false</span>, <span style="color: #c6c;">1.0</span> <span style="color: #a52a2a;">/</span> game<span style="color: #a52a2a;">.</span><span style="color: #060;">TargetElapsedTime</span><span style="color: #a52a2a;">.</span><span style="color: #060;">TotalSeconds</span><span style="color: #6c6;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">new</span><span style="color: #6c6;">&#40;</span>game, syncv<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">new</span> FpsComponent<span style="color: #6c6;">&#40;</span>game, syncv, <span style="color: #06c; font-weight: bold;">false</span>, &nbsp;<span style="color: #c6c;">1.0</span> <span style="color: #a52a2a;">/</span> game<span style="color: #a52a2a;">.</span><span style="color: #060;">TargetElapsedTime</span><span style="color: #a52a2a;">.</span><span style="color: #060;">TotalSeconds</span><span style="color: #6c6;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">new</span><span style="color: #6c6;">&#40;</span>game, targetFps<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">new</span> FpsComponent<span style="color: #6c6;">&#40;</span>game, <span style="color: #06c; font-weight: bold;">true</span>, <span style="color: #06c; font-weight: bold;">true</span>, targetFps<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 現在のFPS値を取得する<br />
&nbsp; &nbsp; &nbsp; &nbsp; member x<span style="color: #a52a2a;">.</span><span style="color: #060;">Fps</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">with</span> get<span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span> m_fps<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 現在のFPSを整数に丸めた値を取得する<br />
&nbsp; &nbsp; &nbsp; &nbsp; member x<span style="color: #a52a2a;">.</span><span style="color: #060;">RoundFps</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">with</span> get<span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span> x<span style="color: #a52a2a;">.</span><span style="color: #060;">Fps</span> <span style="color: #a52a2a;">|&gt;</span> <span style="color: #06c; font-weight: bold;">float</span> <span style="color: #a52a2a;">|&gt;</span> Math<span style="color: #a52a2a;">.</span><span style="color: #060;">Round</span> <span style="color: #a52a2a;">|&gt;</span> int<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 初期化メソッド<br />
&nbsp; &nbsp; &nbsp; &nbsp; override x<span style="color: #a52a2a;">.</span><span style="color: #060;">Initialize</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base<span style="color: #a52a2a;">.</span><span style="color: #060;">Initialize</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 更新メソッド<br />
&nbsp; &nbsp; &nbsp; &nbsp; override x<span style="color: #a52a2a;">.</span><span style="color: #060;">Update</span><span style="color: #6c6;">&#40;</span>gametime<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base<span style="color: #a52a2a;">.</span><span style="color: #060;">Update</span><span style="color: #6c6;">&#40;</span>gametime<span style="color: #6c6;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 描画メソッド<br />
&nbsp; &nbsp; &nbsp; &nbsp; override x<span style="color: #a52a2a;">.</span><span style="color: #060;">Draw</span><span style="color: #6c6;">&#40;</span>gametime<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> elapsed <span style="color: #a52a2a;">=</span> gametime<span style="color: #a52a2a;">.</span><span style="color: #060;">ElapsedGameTime</span><span style="color: #a52a2a;">.</span><span style="color: #060;">TotalSeconds</span> <span style="color: #a52a2a;">|&gt;</span> sec<span style="color: #a52a2a;">.</span><span style="color: #060;">Unit</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_framecount <span style="color: #a52a2a;">&lt;-</span> m_framecount <span style="color: #a52a2a;">+</span> <span style="color: #c6c;">1.0</span><span style="color: #a52a2a;">&lt;</span>frame<span style="color: #a52a2a;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_sec <span style="color: #a52a2a;">&lt;-</span> m_sec <span style="color: #a52a2a;">+</span> elapsed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">if</span> m_sec <span style="color: #a52a2a;">&gt;</span> m_interval <span style="color: #06c; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_fps <span style="color: #a52a2a;">&lt;-</span> m_framecount <span style="color: #a52a2a;">/</span> m_sec<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x<span style="color: #a52a2a;">.</span><span style="color: #060;">Game</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Window</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Title</span> <span style="color: #a52a2a;">&lt;-</span> sprintf <span style="color: #3cb371;">&quot;%d fps&quot;</span> x<span style="color: #a52a2a;">.</span><span style="color: #060;">RoundFps</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_framecount <span style="color: #a52a2a;">&lt;-</span> <span style="color: #c6c;">0.0</span><span style="color: #a52a2a;">&lt;</span>frame<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">//</span> カウンタリセット<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_sec <span style="color: #a52a2a;">&lt;-</span> m_sec <span style="color: #a52a2a;">-</span> m_interval<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base<span style="color: #a52a2a;">.</span><span style="color: #060;">Draw</span><span style="color: #6c6;">&#40;</span>gametime<span style="color: #6c6;">&#41;</span></div></td></tr></tbody></table></div>
<p>Program.fs</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;height:690px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br /></div></td><td><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">namespace Siki<br />
<br />
<span style="color: #06c; font-weight: bold;">open</span> System<br />
<span style="color: #06c; font-weight: bold;">open</span> System<span style="color: #a52a2a;">.</span><span style="color: #060;">Collections</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Generic</span><br />
<span style="color: #06c; font-weight: bold;">open</span> Microsoft<span style="color: #a52a2a;">.</span><span style="color: #060;">Xna</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Framework</span><br />
<span style="color: #06c; font-weight: bold;">open</span> Microsoft<span style="color: #a52a2a;">.</span><span style="color: #060;">Xna</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Framework</span><span style="color: #a52a2a;">.</span><span style="color: #06c; font-weight: bold;">Graphics</span><br />
<br />
<span style="color: #06c; font-weight: bold;">open</span> Siki<span style="color: #a52a2a;">.</span><span style="color: #060;">BasicComponents</span><br />
<br />
<span style="color: #06c; font-weight: bold;">module</span> Main <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; <span style="color: #a52a2a;">///</span> ゲームクラス<br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">type</span> Game1<span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">as</span> x <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">inherit</span> Game<span style="color: #6c6;">&#40;</span>IsMouseVisible<span style="color: #a52a2a;">=</span><span style="color: #06c; font-weight: bold;">true</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IsFixedTimeStep<span style="color: #a52a2a;">=</span><span style="color: #06c; font-weight: bold;">false</span><span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">//</span> フィールド<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> m_rand <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">new</span> <span style="color: #06c; font-weight: bold;">Random</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> m_graphics <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">new</span> GraphicsDeviceManager<span style="color: #6c6;">&#40;</span>x<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> m_fpscomponent <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">new</span> FpsComponent<span style="color: #6c6;">&#40;</span>x<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_num <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_bgc <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">new</span> Color<span style="color: #6c6;">&#40;</span>80uy, 80uy, 80uy<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_rd <span style="color: #a52a2a;">=</span> <span style="color: #a52a2a;">-</span><span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_gd <span style="color: #a52a2a;">=</span> <span style="color: #a52a2a;">-</span><span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> <span style="color: #06c; font-weight: bold;">mutable</span> m_bd <span style="color: #a52a2a;">=</span> <span style="color: #a52a2a;">-</span><span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">//</span> メインコンストラクタ<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x<span style="color: #a52a2a;">.</span><span style="color: #060;">Window</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Title</span> <span style="color: #a52a2a;">&lt;-</span> <span style="color: #3cb371;">&quot;FPSを表示します&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 初期化メソッド<br />
&nbsp; &nbsp; &nbsp; &nbsp; override x<span style="color: #a52a2a;">.</span><span style="color: #060;">Initialize</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x<span style="color: #a52a2a;">.</span><span style="color: #060;">Components</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Add</span><span style="color: #6c6;">&#40;</span>m_fpscomponent<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base<span style="color: #a52a2a;">.</span><span style="color: #060;">Initialize</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 更新メソッド<br />
&nbsp; &nbsp; &nbsp; &nbsp; override x<span style="color: #a52a2a;">.</span><span style="color: #060;">Update</span> gametime <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_num <span style="color: #a52a2a;">&lt;-</span> m_num <span style="color: #a52a2a;">+</span> <span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base<span style="color: #a52a2a;">.</span><span style="color: #060;">Update</span> gametime<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">///</span> 描画メソッド<br />
&nbsp; &nbsp; &nbsp; &nbsp; override x<span style="color: #a52a2a;">.</span><span style="color: #060;">Draw</span> gametime <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">match</span> m_rand<span style="color: #a52a2a;">.</span><span style="color: #060;">Next</span><span style="color: #6c6;">&#40;</span><span style="color: #c6c;">0</span>, <span style="color: #c6c;">5</span><span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">with</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">|</span> <span style="color: #c6c;">0</span> <span style="color: #a52a2a;">-&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">R</span> <span style="color: #a52a2a;">&lt;-</span> m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">R</span> <span style="color: #a52a2a;">+</span> <span style="color: #6c6;">&#40;</span>m_rd <span style="color: #a52a2a;">|&gt;</span> byte<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">if</span> <span style="color: #6c6;">&#40;</span>m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">R</span> <span style="color: #a52a2a;">=</span> 0x00uy <span style="color: #a52a2a;">||</span> m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">R</span> <span style="color: #a52a2a;">=</span> 0xffuy<span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">then</span> m_rd <span style="color: #a52a2a;">&lt;-</span> m_rd <span style="color: #a52a2a;">*</span> <span style="color: #a52a2a;">-</span><span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">|</span> <span style="color: #c6c;">1</span><span style="color: #a52a2a;">|</span><span style="color: #c6c;">2</span> <span style="color: #a52a2a;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">G</span> <span style="color: #a52a2a;">&lt;-</span> m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">G</span> <span style="color: #a52a2a;">+</span> <span style="color: #6c6;">&#40;</span>m_gd <span style="color: #a52a2a;">|&gt;</span> byte<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">if</span> <span style="color: #6c6;">&#40;</span>m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">G</span> <span style="color: #a52a2a;">=</span> 0x00uy <span style="color: #a52a2a;">||</span> m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">G</span> <span style="color: #a52a2a;">=</span> 0xffuy<span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">then</span> m_gd <span style="color: #a52a2a;">&lt;-</span> m_gd <span style="color: #a52a2a;">*</span> <span style="color: #a52a2a;">-</span><span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">|</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">|</span><span style="color: #c6c;">4</span><span style="color: #a52a2a;">|</span><span style="color: #c6c;">5</span> <span style="color: #a52a2a;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">B</span> <span style="color: #a52a2a;">&lt;-</span> m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">B</span> <span style="color: #a52a2a;">+</span> <span style="color: #6c6;">&#40;</span>m_bd <span style="color: #a52a2a;">|&gt;</span> byte<span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">if</span> <span style="color: #6c6;">&#40;</span>m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">B</span> <span style="color: #a52a2a;">=</span> 0x00uy <span style="color: #a52a2a;">||</span> m_bgc<span style="color: #a52a2a;">.</span><span style="color: #060;">B</span> <span style="color: #a52a2a;">=</span> 0xffuy<span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">then</span> m_bd <span style="color: #a52a2a;">&lt;-</span> m_bd <span style="color: #a52a2a;">*</span> <span style="color: #a52a2a;">-</span><span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a52a2a;">|</span> _ <span style="color: #a52a2a;">-&gt;</span> <span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_graphics<span style="color: #a52a2a;">.</span><span style="color: #060;">GraphicsDevice</span><span style="color: #a52a2a;">.</span><span style="color: #060;">Clear</span><span style="color: #6c6;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_bgc<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base<span style="color: #a52a2a;">.</span><span style="color: #060;">Draw</span> gametime<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #a52a2a;">///</span> プログラムのエントリポイント<br />
&nbsp; &nbsp; <span style="color: #6c6;">&#91;</span><span style="color: #a52a2a;">&lt;</span>EntryPoint<span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> main<span style="color: #6c6;">&#40;</span>args<span style="color: #a52a2a;">:</span>string<span style="color: #6c6;">&#91;</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; use game <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">new</span> Game1<span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; game<span style="color: #a52a2a;">.</span><span style="color: #060;">Run</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c6c;">0</span></div></td></tr></tbody></table></div>
<p>FPSを計算するだけの簡単なサンプルです。<br />
Update()、Draw()が呼ばれていることを確認するために、少しずつ背景色を変えています。</p>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100313/f-%e3%83%a1%e3%83%a2-xna-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F# メモ Option</title>
		<link>http://sikios.com/wordpress/20100305/f-%e3%83%a1%e3%83%a2-option/</link>
		<comments>http://sikios.com/wordpress/20100305/f-%e3%83%a1%e3%83%a2-option/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 18:23:20 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=1129</guid>
		<description><![CDATA[Option型
C#でいうNullable型のようなもので、値を持たないことも表せるようになる。
引数 x が自然数なら x を、負の数なら None (値を持たない) を返す。
&#62; let natural x = ]]></description>
			<content:encoded><![CDATA[<h3>Option型</h3>
<p>C#でいうNullable型のようなもので、値を持たないことも表せるようになる。</p>
<p>引数 x が自然数なら x を、負の数なら <em>None</em> (値を持たない) を返す。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> natural x <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">if</span> x <span style="color: #a52a2a;">&gt;=</span> <span style="color: #c6c;">0</span> <span style="color: #06c; font-weight: bold;">then</span> Some x<br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">else</span> None<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> natural <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">-&gt;</span> int <span style="color: #06c; font-weight: bold;">option</span></div></div>
<hr />
<table style="width: 50%;">
<tr>
<td  class="nowrap"><strong>Option.get</strong><br /><em>&#8216;a option -> &#8216;a</em></td>
</tr>
</table>
<p>Option型 は Some (値を持っている) か None (値を持たない) のいずれかを表し、<br />
Some の場合は値を取得できる。<br />
None に対し <em>Option.get</em> を行うと例外が発生する。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> a <span style="color: #a52a2a;">=</span> natural <span style="color: #c6c;">100</span><br />
<span style="color: #06c; font-weight: bold;">let</span> b <span style="color: #a52a2a;">=</span> natural <span style="color: #a52a2a;">-</span><span style="color: #c6c;">100</span><br />
<span style="color: #06c; font-weight: bold;">let</span> c <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">Option</span><span style="color: #a52a2a;">.</span><span style="color: #060;">get</span> a<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> a <span style="color: #a52a2a;">:</span> int <span style="color: #06c; font-weight: bold;">option</span> <span style="color: #a52a2a;">=</span> Some <span style="color: #c6c;">100</span><br />
<span style="color: #06c; font-weight: bold;">val</span> b <span style="color: #a52a2a;">:</span> int <span style="color: #06c; font-weight: bold;">option</span> <span style="color: #a52a2a;">=</span> None<br />
<span style="color: #06c; font-weight: bold;">val</span> c <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">100</span></div></div>
<hr />
<table style="width: 50%;">
<tr>
<td  class="nowrap"><strong>Option.isSome</strong><br /><em>&#8216;a option -> bool</em></td>
</tr>
</table>
<p>引数が Some なら true を、None なら false を返す。</p>
<hr />
<table style="width: 50%;">
<tr>
<td  class="nowrap"><strong>Option.isNone</strong><br /><em>&#8216;a option -> bool</em></td>
</tr>
</table>
<p>引数が Some なら true を、None なら false を返す。</p>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100305/f-%e3%83%a1%e3%83%a2-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F# メモ List (2)</title>
		<link>http://sikios.com/wordpress/20100226/f-%e3%83%a1%e3%83%a2-list-2/</link>
		<comments>http://sikios.com/wordpress/20100226/f-%e3%83%a1%e3%83%a2-list-2/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 13:16:49 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=960</guid>
		<description><![CDATA[リスト関数


関数関数の型
簡単な説明


List.length&#8216;a list -> int
要素の数を取得する


List.head&#8216;a list -> &#8216;a
先頭の要素を取得 ]]></description>
			<content:encoded><![CDATA[<h3>リスト関数</h3>
<table>
<thead>
<td><strong>関数</strong><br /><em>関数の型</em></td>
<td>簡単な説明</td>
</thead>
<tr>
<td class="nowrap"><strong>List.length</strong><br /><em>&#8216;a list -> in</em>t</td>
<td>要素の数を取得する</td>
</tr>
<tr>
<td class="nowrap"><strong>List.head</strong><br /><em>&#8216;a list -> &#8216;a</em></td>
<td>先頭の要素を取得する</td>
</tr>
<tr>
<td class="nowrap"><strong>List.tail</strong><br /><em>&#8216;a list -> &#8216;a list</em></td>
<td>先頭の要素を除いたリストを取得する</td>
</tr>
<tr>
<td class="nowrap"><strong>List.exists</strong><br /><em>(&#8216;a -> bool) -> &#8216;a list -> bool</em></td>
<td>条件に合う要素が存在するか調べる</td>
</tr>
<tr>
<td class="nowrap"><strong>List.rev</strong><br /><em>&#8216;a list -> &#8216;a list</em></td>
<td>順番を逆にしたリストを取得する</td>
</tr>
<tr>
<td class="nowrap"><strong>List.tryFind</strong><br /><em>(&#8216;a -> bool) -> &#8216;a list -> &#8216;a option</em></td>
<td>条件に合う要素を取得する<br />存在しない場合はNoneを返す</td>
</tr>
<tr>
<td class="nowrap"><strong>List.zip</strong><br /"><em>&#8216;a list -> &#8216;b list -> (&#8216;a * &#8216;b) list</em></td>
<td>2つのリストの要素を組み合わせ、<br />タプルのリストを作成する</td>
</tr>
<tr>
<td class="nowrap"><strong>List.filter</strong><br /><em>(&#8216;a -> bool) &#8216;a list -> &#8216;a list</em></td>
<td>条件に合う要素のみを含むリストを作成する</td>
</tr>
<tr>
<td class="nowrap"><strong>List.partition</strong><br /><em>(&#8216;a -> bool) -> &#8216;a list -> (&#8216;a list * &#8216;a list)</em></td>
<td>条件に合う要素のみを含むリストと<br />それ以外のリストのタプルを作成する</td>
</tr>
</table>
<p>他にも多数あります。<a href="http://msdn.microsoft.com/en-us/library/ee353738(VS.100).aspx" target="_blank">msdn</a></p>
<hr />
<h3>集約関数 (Aggregate Operators)</h3>
<p>リストなどのコレクションには個々の要素に対して何らかの操作を行う関数が多数用意されている。</p>
<table style="width: 50%;">
<tr>
<td  class="nowrap"><strong>List.map</strong><br /><em>(&#8216;a -> &#8216;b) -> &#8216;a list -> &#8216;b list</em></td>
</tr>
</table>
<p> &#8216;a -> &#8216;b 変換関数をすべての要素に適用し、&#8217;b list を作成する。</p>
<p>例：整数のリストを基に、文字列のリストを作成する。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> tostr x <span style="color: #a52a2a;">=</span> sprintf <span style="color: #3cb371;">&quot;%d&quot;</span> x<br />
<span style="color: #06c; font-weight: bold;">let</span> a <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">..</span>10<span style="color: #6c6;">&#93;</span><br />
<span style="color: #06c; font-weight: bold;">let</span> b <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">map</span> tostr a<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> tostr <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">-&gt;</span> string<br />
<span style="color: #06c; font-weight: bold;">val</span> a <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">4</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">5</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">6</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">7</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">8</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">9</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">10</span><span style="color: #6c6;">&#93;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> b <span style="color: #a52a2a;">:</span> string list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #3cb371;">&quot;1&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;2&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;3&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;4&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;5&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;6&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;7&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;8&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;9&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;10&quot;</span><span style="color: #6c6;">&#93;</span></div></div>
<hr />
<table style="width: 50%;">
<tr>
<td  class="nowrap"><strong>List.reduce</strong><br /><em>(&#8216;a -> &#8216;a -> &#8216;a) ->&#8217;a list -> &#8216;a</em></td>
</tr>
</table>
<p>リストの要素を辿りながら &#8216;a 型のアキュムレータを構築していく関数。<br />
(&#8216;a -> &#8216;a -> &#8216;a) の部分は現在のアキュムレータとリストの要素を引数とし、新たなアキュムレータを作成する関数。</p>
<p>例：1から5までの整数の積を求める。(ついでに、アキュムレータの確認を行う)</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> multiple a b <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; printfn <span style="color: #3cb371;">&quot;// %3d = %2d * %d&quot;</span> <span style="color: #6c6;">&#40;</span>a<span style="color: #a52a2a;">*</span>b<span style="color: #6c6;">&#41;</span> a b<br />
&nbsp; &nbsp; a <span style="color: #a52a2a;">*</span> b<br />
<span style="color: #06c; font-weight: bold;">let</span> b <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">reduce</span> multiple <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">..</span>5<span style="color: #6c6;">&#93;</span><span style="color: #a52a2a;">;;</span><br />
<span style="color: #a52a2a;">//</span> &nbsp; <span style="color: #c6c;">2</span> <span style="color: #a52a2a;">=</span> &nbsp;<span style="color: #c6c;">1</span> <span style="color: #a52a2a;">*</span> <span style="color: #c6c;">2</span><br />
<span style="color: #a52a2a;">//</span> &nbsp; <span style="color: #c6c;">6</span> <span style="color: #a52a2a;">=</span> &nbsp;<span style="color: #c6c;">2</span> <span style="color: #a52a2a;">*</span> <span style="color: #c6c;">3</span><br />
<span style="color: #a52a2a;">//</span> &nbsp;<span style="color: #c6c;">24</span> <span style="color: #a52a2a;">=</span> &nbsp;<span style="color: #c6c;">6</span> <span style="color: #a52a2a;">*</span> <span style="color: #c6c;">4</span><br />
<span style="color: #a52a2a;">//</span> <span style="color: #c6c;">120</span> <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">24</span> <span style="color: #a52a2a;">*</span> <span style="color: #c6c;">5</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> multiple <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">-&gt;</span> int <span style="color: #a52a2a;">-&gt;</span> int<br />
<span style="color: #06c; font-weight: bold;">val</span> b <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">120</span></div></div>
<p>上の例のように、リストの先頭要素がアキュムレータの初期値となる。</p>
<hr />
<table style="width: 50%;">
<tr>
<td  class="nowrap"><strong>List.fold</strong><br /><em>(&#8216;acc -> &#8216;b -> &#8216;acc) -> &#8216;acc -> &#8216;b list -> &#8216;acc</em></td>
</tr>
</table>
<p>リストの要素を辿りながら任意の型のアキュムレータを構築していく関数。<br />
List.reduceを汎用的にしたもの。<br />
アキュムレータの初期値を与える必要がある。</p>
<p>例：リスト中の文字数の合計を取得する</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> Count acc <span style="color: #6c6;">&#40;</span>str<span style="color: #a52a2a;">:</span>string<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span> acc <span style="color: #a52a2a;">+</span> str<span style="color: #a52a2a;">.</span><span style="color: #060;">Length</span><br />
<span style="color: #06c; font-weight: bold;">let</span> dow <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><br />
&nbsp; &nbsp; <span style="color: #3cb371;">&quot;Sunday&quot;</span><span style="color: #a52a2a;">;</span><br />
&nbsp; &nbsp; <span style="color: #3cb371;">&quot;Monday&quot;</span><span style="color: #a52a2a;">;</span><br />
&nbsp; &nbsp; <span style="color: #3cb371;">&quot;Tuesday&quot;</span><span style="color: #a52a2a;">;</span><br />
&nbsp; &nbsp; <span style="color: #3cb371;">&quot;Wednesday&quot;</span><br />
<span style="color: #6c6;">&#93;</span><br />
<span style="color: #06c; font-weight: bold;">let</span> total <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">fold</span> Count <span style="color: #c6c;">0</span> dow<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> Count <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">-&gt;</span> string <span style="color: #a52a2a;">-&gt;</span> int<br />
<span style="color: #06c; font-weight: bold;">val</span> dow <span style="color: #a52a2a;">:</span> string list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #3cb371;">&quot;Sunday&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;Monday&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;Tuesday&quot;</span><span style="color: #a52a2a;">;</span> <span style="color: #3cb371;">&quot;Wednesday&quot;</span><span style="color: #6c6;">&#93;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> total <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">28</span></div></div>
<hr />
<table style="width: 50%;">
<tr>
<td  class="nowrap""><strong>List.iter</strong><br /><em>(&#8216;a -> unit) -> &#8216;a list -> unit</em></td>
</tr>
</table>
<p>指定された関数を、リストの各要素に対して順次実行する関数。</p>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100226/f-%e3%83%a1%e3%83%a2-list-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F# メモ List (1)</title>
		<link>http://sikios.com/wordpress/20100226/f-%e3%83%a1%e3%83%a2-list-1/</link>
		<comments>http://sikios.com/wordpress/20100226/f-%e3%83%a1%e3%83%a2-list-1/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 16:57:46 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=921</guid>
		<description><![CDATA[基本

リストの作成。
[] で囲み、要素は ; で区切る。
&#62; let odds = &#91;1;3;5;7;9&#93;
let evens = &#91;2;4;6;8;10&#93;;;

val odd ]]></description>
			<content:encoded><![CDATA[<h3>基本</h3>
<hr />
リストの作成。<br />
[] で囲み、要素は ; で区切る。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> odds <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">5</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">7</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">9</span><span style="color: #6c6;">&#93;</span><br />
<span style="color: #06c; font-weight: bold;">let</span> evens <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">4</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">6</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">8</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">10</span><span style="color: #6c6;">&#93;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> odds <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">5</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">7</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">9</span><span style="color: #6c6;">&#93;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> evens <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">4</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">6</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">8</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">10</span><span style="color: #6c6;">&#93;</span></div></div>
<hr />
<p>リストの追加。<br />
@ はリストの結合を行う。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> appended <span style="color: #a52a2a;">=</span> odds @ evens<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> appended <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">5</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">7</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">9</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">4</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">6</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">8</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">10</span><span style="color: #6c6;">&#93;</span></div></div>
<hr />
<p>要素の追加。<br />
:: はリストの先頭に要素を追加する。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #c6c;">0</span> <span style="color: #a52a2a;">::</span> appended<span style="color: #a52a2a;">;;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">0</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">1</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">5</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">7</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">9</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">4</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">6</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">8</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">10</span><span style="color: #6c6;">&#93;</span></div></div>
<hr />
<p>範囲を指定する。<br />
1から10までの整数のリストを作成する。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> x <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">..</span>10<span style="color: #6c6;">&#93;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> x <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">4</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">5</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">6</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">7</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">8</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">9</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">10</span><span style="color: #6c6;">&#93;</span></div></div>
<hr />
<p>範囲と間隔を指定する。<br />
1から10までの奇数のリストを作成する。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> x <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">..</span>2<span style="color: #a52a2a;">..</span>10<span style="color: #6c6;">&#93;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> x <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">5</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">7</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">9</span><span style="color: #6c6;">&#93;</span></div></div>
<hr />
<p>要素を持たないリスト。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> emptylist <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #6c6;">&#93;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> emptylist <span style="color: #a52a2a;">:</span> <span style="color: #a52a2a;">'</span>a list</div></div>
<hr />
<h3>yield</h3>
<p>リストの要素を何らかの手続きで決定させることができる。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> near x <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; <span style="color: #6c6;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; yield x <span style="color: #a52a2a;">-</span> <span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; yield x<br />
&nbsp; &nbsp; &nbsp; &nbsp; yield x <span style="color: #a52a2a;">+</span> <span style="color: #c6c;">1</span><br />
&nbsp; &nbsp; <span style="color: #6c6;">&#93;</span><br />
<span style="color: #06c; font-weight: bold;">let</span> nearTen <span style="color: #a52a2a;">=</span> near <span style="color: #c6c;">10</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> near <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">-&gt;</span> int list<br />
<span style="color: #06c; font-weight: bold;">val</span> nearTen <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">9</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">10</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">11</span><span style="color: #6c6;">&#93;</span></div></div>
<p>引数の値とその前後の値を要素とするリストを返す関数 near を作成し、10を与えている。<br />
上から順に評価されるので、10-1=9、10、10+1=11が要素となる。</p>
<p>[] の中には条件式やループ等も使用できる。<br />
30以下の素数のリストを作成する例。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> primes <span style="color: #a52a2a;">=</span> <br />
&nbsp; &nbsp; <span style="color: #6c6;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> factors n <span style="color: #a52a2a;">=</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6c6;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">for</span> i <span style="color: #06c; font-weight: bold;">in</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">..</span><span style="color: #060;">n</span><span style="color: #a52a2a;">-</span><span style="color: #c6c;">1</span> <span style="color: #06c; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">if</span> n <span style="color: #a52a2a;">%</span> i <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">0</span> <span style="color: #06c; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yield i<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6c6;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">for</span> i <span style="color: #06c; font-weight: bold;">in</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">..</span>30 <span style="color: #06c; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">if</span> <span style="color: #06c; font-weight: bold;">List</span><span style="color: #a52a2a;">.</span><span style="color: #060;">length</span> <span style="color: #6c6;">&#40;</span>factors i<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">0</span> <span style="color: #06c; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yield i<br />
&nbsp; &nbsp; <span style="color: #6c6;">&#93;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> primes <span style="color: #a52a2a;">:</span> int list <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">2</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">5</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">7</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">11</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">13</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">17</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">19</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">23</span><span style="color: #a52a2a;">;</span> <span style="color: #c6c;">29</span><span style="color: #6c6;">&#93;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100226/f-%e3%83%a1%e3%83%a2-list-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F# メモ コメント</title>
		<link>http://sikios.com/wordpress/20100225/f-%e3%83%a1%e3%83%a2-%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88/</link>
		<comments>http://sikios.com/wordpress/20100225/f-%e3%83%a1%e3%83%a2-%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 10:37:58 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=938</guid>
		<description><![CDATA[行コメント
C++と同じで // から行末までがコメントとして扱われる。

ブロックコメント
(* と *) で囲まれた部分がコメントとなる。
このブロックコメントはネストすることができるので、
123456(*
&#038;nb ]]></description>
			<content:encoded><![CDATA[<h3><a id="line">行コメント</a></h3>
<p>C++と同じで // から行末までがコメントとして扱われる。</p>
<hr />
<h3><a id="block">ブロックコメント</a></h3>
<p>(* と *) で囲まれた部分がコメントとなる。</p>
<p>このブロックコメントはネストすることができるので、</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #5d478b; font-style: italic;">(*<br />
&nbsp; &nbsp; outer comment<br />
&nbsp; &nbsp; (*<br />
&nbsp; &nbsp; &nbsp; &nbsp; inner comment<br />
&nbsp; &nbsp; *)</span><br />
<span style="color: #a52a2a;">*</span><span style="color: #6c6;">&#41;</span></div></td></tr></tbody></table></div>
<p>は正しい。しかし、</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #5d478b; font-style: italic;">(*<br />
&nbsp; &nbsp; outer comment<br />
&nbsp; &nbsp; (*<br />
&nbsp; &nbsp; &nbsp; &nbsp; inner comment<br />
&nbsp; &nbsp; <br />
*)</span></div></td></tr></tbody></table></div>
<p>はコンパイルエラーとなる。</p>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100225/f-%e3%83%a1%e3%83%a2-%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F# メモ タプル</title>
		<link>http://sikios.com/wordpress/20100225/f-%e3%83%a1%e3%83%a2-%e3%82%bf%e3%83%97%e3%83%ab/</link>
		<comments>http://sikios.com/wordpress/20100225/f-%e3%83%a1%e3%83%a2-%e3%82%bf%e3%83%97%e3%83%ab/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 21:39:25 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=899</guid>
		<description><![CDATA[タプルは複数の値を一つの組として扱う機能。
int と string のタプルの型は int * string と表される。
コンマで区切ることでタプルの作成や要素の取得ができる。
&#62; let t = &#40;1 ]]></description>
			<content:encoded><![CDATA[<p>タプルは複数の値を一つの組として扱う機能。<br />
int と string のタプルの型は int * string と表される。<br />
コンマで区切ることでタプルの作成や要素の取得ができる。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> t <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">1234</span>, <span style="color: #3cb371;">&quot;1234&quot;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> t <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">*</span> string <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">1234</span>, <span style="color: #3cb371;">&quot;1234&quot;</span><span style="color: #6c6;">&#41;</span><br />
<br />
<span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> d, s <span style="color: #a52a2a;">=</span> t<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> s <span style="color: #a52a2a;">:</span> string <span style="color: #a52a2a;">=</span> <span style="color: #3cb371;">&quot;1234&quot;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> d <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">1234</span></div></div>
<p>タプルを関数の引数にするには以下のように括弧で括る必要がある。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> sum <span style="color: #6c6;">&#40;</span>a, b, c<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span> a <span style="color: #a52a2a;">+</span> b <span style="color: #a52a2a;">+</span> c<br />
<br />
<span style="color: #06c; font-weight: bold;">let</span> x <span style="color: #a52a2a;">=</span> sum <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">12</span>, <span style="color: #c6c;">23</span>, <span style="color: #c6c;">34</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> sum <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">*</span> int <span style="color: #a52a2a;">*</span> int <span style="color: #a52a2a;">-&gt;</span> int<br />
<span style="color: #06c; font-weight: bold;">val</span> x <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">69</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100225/f-%e3%83%a1%e3%83%a2-%e3%82%bf%e3%83%97%e3%83%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F# メモ unit</title>
		<link>http://sikios.com/wordpress/20100224/f-%e3%83%a1%e3%83%a2-unit/</link>
		<comments>http://sikios.com/wordpress/20100224/f-%e3%83%a1%e3%83%a2-unit/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 12:26:33 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=875</guid>
		<description><![CDATA[unit は値を持たないことを表す型で、CやC#でいう void のようなもの。
() は unit である。
&#62; let x = &#40;&#41;;;

val x : unit = &#40;&#41;
i ]]></description>
			<content:encoded><![CDATA[<p><em>unit</em> は値を持たないことを表す型で、CやC#でいう <em>void</em> のようなもの。<br />
() は <em>unit</em> である。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> x <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> x <span style="color: #a52a2a;">:</span> unit <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span></div></div>
<p><em>ignore</em> は非 unit な式を unit に変換する関数。<br />
つまり値を使わないことを明示する関数。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">ignore</span><span style="color: #6c6;">&#40;</span><span style="color: #c6c;">2</span><span style="color: #a52a2a;">*</span><span style="color: #c6c;">2</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> unit <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span></div></div>
<p>や</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">*</span><span style="color: #c6c;">2</span> <span style="color: #a52a2a;">|&gt;</span> <span style="color: #06c; font-weight: bold;">ignore</span><span style="color: #a52a2a;">;;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> unit <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span></div></div>
<p>のように使用できる。</p>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100224/f-%e3%83%a1%e3%83%a2-unit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F# メモ 関数</title>
		<link>http://sikios.com/wordpress/20100222/f-%e3%83%a1%e3%83%a2-%e9%96%a2%e6%95%b0/</link>
		<comments>http://sikios.com/wordpress/20100222/f-%e3%83%a1%e3%83%a2-%e9%96%a2%e6%95%b0/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 04:28:47 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=857</guid>
		<description><![CDATA[定義
2つの int を引数に取り、その和を返す関数 add は以下のように表す。
&#62; let add a b = a + b;;

val add : int -&#62; int -&#62; int
実行してみる ]]></description>
			<content:encoded><![CDATA[<h3>定義</h3>
<p>2つの int を引数に取り、その和を返す関数 add は以下のように表す。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> add a b <span style="color: #a52a2a;">=</span> a <span style="color: #a52a2a;">+</span> b<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> add <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">-&gt;</span> int <span style="color: #a52a2a;">-&gt;</span> int</div></div>
<p>実行してみる。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> add <span style="color: #c6c;">1</span> <span style="color: #c6c;">2</span><span style="color: #a52a2a;">;;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">3</span></div></div>
<hr />
<h3>関数の型</h3>
<p>float -> int は 「float を引数に取り、int を返す関数」と読む。<br />
上の add の場合 int -> int -> int が関数の型で、<strong>「intを引数に取り、「intを引数に取り、intを返す関数」を返す関数」</strong>と読む。</p>
<hr />
<h3>型推論</h3>
<p>上の add 関数のように引数の型が複数考えられるとき、最初に使用されたときの引数を基に関数の型が決まる。(ただし、対話モードでは一旦 ;; で終了した時点で確定する)</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> add <span style="color: #c6c;">1.0</span> <span style="color: #c6c;">2.0</span><span style="color: #a52a2a;">;;</span><br />
<br />
&nbsp; add <span style="color: #c6c;">1.0</span> <span style="color: #c6c;">2.0</span><span style="color: #a52a2a;">;;</span><br />
&nbsp; <span style="color: #a52a2a;">----^^^</span><br />
<br />
<span style="color: #06c; font-weight: bold;">stdin</span><span style="color: #6c6;">&#40;</span><span style="color: #c6c;">3</span>,<span style="color: #c6c;">5</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">:</span> error FS0001<span style="color: #a52a2a;">:</span> This expression was expected <span style="color: #06c; font-weight: bold;">to</span> have <span style="color: #06c; font-weight: bold;">type</span><br />
&nbsp; &nbsp; int &nbsp; &nbsp;<br />
but here has <span style="color: #06c; font-weight: bold;">type</span><br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">float</span></div></div>
<p>のように float を引数とすることはできない。<br />
これは関数 add が int -> int -> int と推論されているため。<br />
float のみを渡せるようにするには、以下のように明示的に型を指定する。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> addf <span style="color: #6c6;">&#40;</span>a<span style="color: #a52a2a;">:</span><span style="color: #06c; font-weight: bold;">float</span><span style="color: #6c6;">&#41;</span> b <span style="color: #a52a2a;">=</span> a <span style="color: #a52a2a;">+</span> b<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> addf <span style="color: #a52a2a;">:</span> <span style="color: #06c; font-weight: bold;">float</span> <span style="color: #a52a2a;">-&gt;</span> <span style="color: #06c; font-weight: bold;">float</span> <span style="color: #a52a2a;">-&gt;</span> <span style="color: #06c; font-weight: bold;">float</span><br />
<br />
<span style="color: #a52a2a;">&gt;</span> addf <span style="color: #c6c;">1.0</span> <span style="color: #c6c;">2.0</span><span style="color: #a52a2a;">;;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> <span style="color: #06c; font-weight: bold;">float</span> <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">3.0</span></div></div>
<hr />
<h3>ジェネリック関数</h3>
<p><em>&#8216;a</em> のように &#8216; を付けた型を指定すると、どんな型でも引数に取ることができる関数を作ることができる。<br />
&#8216;a でも &#8216;b でも &#8216;asdfghjk でもいいらしい。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> str <span style="color: #6c6;">&#40;</span>x<span style="color: #a52a2a;">:'</span>a<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span> x<span style="color: #a52a2a;">.</span><span style="color: #060;">ToString</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> str <span style="color: #a52a2a;">:</span> <span style="color: #a52a2a;">'</span>a <span style="color: #a52a2a;">-&gt;</span> string<br />
<br />
<span style="color: #a52a2a;">&gt;</span> str<span style="color: #6c6;">&#40;</span><span style="color: #c6c;">10</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> string <span style="color: #a52a2a;">=</span> <span style="color: #3cb371;">&quot;10&quot;</span></div></div>
<hr />
<h3>スコープ</h3>
<p>F#のスコープはインデントで表される。<br />
全くインデントされていないスコープがモジュールスコープ。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> Pow2 x <span style="color: #a52a2a;">=</span> <br />
&nbsp; &nbsp; <span style="color: #06c; font-weight: bold;">let</span> value <span style="color: #a52a2a;">=</span> x <span style="color: #a52a2a;">*</span> x<br />
&nbsp; &nbsp; value<span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> Pow2 <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">-&gt;</span> int<br />
<br />
<span style="color: #a52a2a;">&gt;</span> Pow2 <span style="color: #c6c;">10</span><span style="color: #a52a2a;">;;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> int <span style="color: #a52a2a;">=</span> <span style="color: #c6c;">100</span></div></div>
<p>関数スコープの最後に評価された値がその関数の戻り値となる。</p>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100222/f-%e3%83%a1%e3%83%a2-%e9%96%a2%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>F# メモ 基本演算子</title>
		<link>http://sikios.com/wordpress/20100221/f-%e3%83%a1%e3%83%a2-%e5%9f%ba%e6%9c%ac%e6%bc%94%e7%ae%97%e5%ad%90/</link>
		<comments>http://sikios.com/wordpress/20100221/f-%e3%83%a1%e3%83%a2-%e5%9f%ba%e6%9c%ac%e6%bc%94%e7%ae%97%e5%ad%90/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 11:36:35 +0000</pubDate>
		<dc:creator>rei</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://sikios.com/wordpress/?p=791</guid>
		<description><![CDATA[算術演算子
説明不要ですね。


演算子
意味


+
加算


-
減算


*
乗算


/
除算


**
冪算


%
剰余



数学関数
演算子ではありませんが、基本的なものなので。


関数
意味


ab ]]></description>
			<content:encoded><![CDATA[<h3>算術演算子</h3>
<p>説明不要ですね。</p>
<table style="width:300px;">
<thead>
<td>演算子</td>
<td>意味</td>
</thead>
<tr>
<td>+</td>
<td>加算</td>
</tr>
<tr>
<td>-</td>
<td>減算</td>
</tr>
<tr>
<td>*</td>
<td>乗算</td>
</tr>
<tr>
<td>/</td>
<td>除算</td>
</tr>
<tr>
<td>**</td>
<td>冪算</td>
</tr>
<tr>
<td>%</td>
<td>剰余</td>
</tr>
</table>
<hr />
<h3>数学関数</h3>
<p>演算子ではありませんが、基本的なものなので。</p>
<table style="width:300px;">
<thead>
<td>関数</td>
<td>意味</td>
</thead>
<tr>
<td>abs</td>
<td>絶対値を求める</td>
</tr>
<tr>
<td>ceil</td>
<td>整数に丸める(大きい方に)</td>
</tr>
<tr>
<td>exp</td>
<td>eの引数乗を求める</td>
</tr>
<tr>
<td>floor</td>
<td>整数に丸める(小さい方に)</td>
</tr>
<tr>
<td>sign</td>
<td>符号を求める(-1, 0 or 1)</td>
</tr>
<tr>
<td>log</td>
<td>自然対数を求める</td>
</tr>
<tr>
<td>log10</td>
<td>常用対数を求める</td>
</tr>
<tr>
<td>sqrt</td>
<td>平方根を求める</td>
</tr>
<tr>
<td>cos</td>
<td>コサインを求める</td>
</tr>
<tr>
<td>sin</td>
<td>サインを求める</td>
</tr>
<tr>
<td>tan</td>
<td>タンジェントを求める</td>
</tr>
<tr>
<td>pown</td>
<td>整数の累乗を求める</td>
</tr>
</table>
<hr />
<h3>型変換</h3>
<p>型名がそのまま変換関数のように機能する。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> int64 <span style="color: #c6c;">1234.5678</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> int64 <span style="color: #a52a2a;">=</span> 1234L</div></div>
<h3>ビット演算子</h3>
<p>ちょっと特殊。</p>
<table style="width:300px;">
<thead>
<td>演算子</td>
<td>意味</td>
</thead>
<tr>
<td>&#038;&#038;&</td>
<td>AND</td>
</tr>
<tr>
<td>|||</td>
<td>OR</td>
</tr>
<tr>
<td>^^^</td>
<td>XOR</td>
</tr>
<tr>
<td>&lt;&lt;&lt;</td>
<td>左シフト</td>
</tr>
<tr>
<td>&gt;&gt;&gt;</td>
<td>右シフト</td>
</tr>
</table>
<hr />
<h3>要素へのアクセス</h3>
<p>配列や文字列の要素にアクセスする場合は .[] を使用する。<br />
慣れていないうちは . を忘れやすい。</p>
<div class="codecolorer-container ocaml twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="ocaml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a52a2a;">&gt;</span> <span style="color: #06c; font-weight: bold;">let</span> str <span style="color: #a52a2a;">=</span> <span style="color: #3cb371;">&quot;abc&quot;</span><span style="color: #a52a2a;">;;</span><br />
<br />
<span style="color: #06c; font-weight: bold;">val</span> str <span style="color: #a52a2a;">:</span> string <span style="color: #a52a2a;">=</span> <span style="color: #3cb371;">&quot;abc&quot;</span><br />
<br />
<span style="color: #a52a2a;">&gt;</span> str<span style="color: #a52a2a;">.</span><span style="color: #6c6;">&#91;</span><span style="color: #c6c;">1</span><span style="color: #6c6;">&#93;</span><span style="color: #a52a2a;">;;</span><br />
<span style="color: #06c; font-weight: bold;">val</span> it <span style="color: #a52a2a;">:</span> char <span style="color: #a52a2a;">=</span> <span style="color: #a52a2a;">'</span>b<span style="color: #a52a2a;">'</span></div></div>
<hr />
<h3>論理演算</h3>
<table style="width:330px;">
<thead>
<td>演算子</td>
<td>意味</td>
<td>例</td>
</thead>
<tr>
<td>&#038;&#038;</td>
<td>AND</td>
<td>true &#038;&#038; false = false</td>
</tr>
<tr>
<td>||</td>
<td>OR</td>
<td>true || false = true</td>
</tr>
<tr>
<td>not</td>
<td>NOT</td>
<td>not false = true</td>
</tr>
</table>
<hr />
<h3>比較演算</h3>
<p>値同士の比較を行い、<i>bool</i> 値を返す。</p>
<table style="width:330px;">
<thead>
<td>演算子</td>
<td>意味</td>
</thead>
<tr>
<td>&lt;</td>
<td>より小さいか</td>
</tr>
<tr>
<td>&lt;=</td>
<td>以下か</td>
</tr>
<tr>
<td>&gt;</td>
<td>より大きいか</td>
</tr>
<tr>
<td>&gt;=</td>
<td>以上か</td>
</tr>
<tr>
<td>=</td>
<td>同じか</td>
</tr>
<tr>
<td>&lt;&gt;</td>
<td>異なるか</td>
</tr>
</table>
<p><em>compare</em> (関数？) は第一引数の方が小さいときは -1、大きいときは 1、同じなら 0 を返す。</p>
]]></content:encoded>
			<wfw:commentRss>http://sikios.com/wordpress/20100221/f-%e3%83%a1%e3%83%a2-%e5%9f%ba%e6%9c%ac%e6%bc%94%e7%ae%97%e5%ad%90/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
