Changeset 240 for trunk/docs

Show
Ignore:
Timestamp:
11/18/07 11:06:00 (1 year ago)
Author:
JarrettBillingsley
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docs/candydoc/modules.ddoc

    r238 r240  
    11MODULES = 
     2    $(MODULE_FULL minid.minid) 
     3    $(MODULE_FULL minid.types) 
    24    $(MODULE_FULL minid.bind) 
     5    $(MODULE_FULL minid.compiler) 
     6    $(MODULE_FULL minid.utils) 
  • trunk/docs/minid.bind.html

    r238 r240  
    1414    <table class="content"> 
    1515        <tr><td id="docbody"><h1>minid.bind</h1><!-- Generated by Ddoc from minid\bind.d --> 
     16This module contains scary template stuff to make it possible to wrap D functions, 
     17classes, and structs and expose them as functions and types in MiniD. 
     18<br><br> 
     19<font color=red>BUGS:</font><br> 
     20When wrapping structs, or when using functions which take structs as arguments, if a 
     21struct type has any private fields, it will fail.  Unfortunately D doesn't seem to 
     22provide any way to step around the private members, and also trying to get the .init 
     23of most structs causes a forward declaration error, so it's a bug that forces another 
     24bug. 
     25<br><br> 
     26 
     27Arrays of wrapped structs/classes are not yet supported. 
     28 
     29<br><br> 
    1630<b>License:</b><br> 
    1731Copyright (c) 2007 Jarrett Billingsley 
     
    188202<script>explorer.outline.addDecl('type');</script> 
    189203 
    190 (T)(T <span class="funcparam">value</span>, dchar[] <span class="funcparam">name</span> = ""); 
     204(T)(T <span class="funcparam">value</span>); 
    191205</span></dt> 
    192206<script>explorer.outline.writeEnabled = false;</script> 
     
    228242     
    229243<br><br> 
     244 
     245</dd> 
     246</dl> 
     247<script>explorer.outline.decSymbolLevel();</script> 
     248 
     249 
     250</dd> 
     251 
     252<script>explorer.outline.writeEnabled = true;</script> 
     253<dt><span class="decl">struct  
     254<span class="currsymbol">WrapClass</span> 
     255<script>explorer.outline.addDecl('WrapClass');</script> 
     256 
     257(ClassType,Ctors...); 
     258</span></dt> 
     259<script>explorer.outline.writeEnabled = false;</script> 
     260 
     261 
     262<dd>Used to wrap a class or struct type that is exposed to MiniD.  Since classes and structs are very similar, both can be 
     263wrapped by this one template.  They can have any number of constructors, methods, and properties, and structs will have all their 
     264fields wrapped in opIndex and opIndexAssign metamethods so that they can be accessed from within MiniD. 
     265<br><br> 
     266<b>Params:</b><br> 
     267<table><tr> 
     268<td nowrap valign="top" style="padding-right: 8px">ClassType</td> 
     269 
     270                
     271<td>The type of the class or struct to wrap.</td></tr> 
     272<tr> 
     273<td nowrap valign="top" style="padding-right: 8px">Ctors</td> 
     274 
     275                
     276<td>An optional list of function types which represent the constructors (or in the case of structs, static opCalls) which 
     277        should be wrapped.  If this is left out, it will attempt to wrap the default (no-parameter) constructor.</td></tr> 
     278</table><br> 
     279<font color=red>BUGS:</font><br> 
     280As explained in the module header, wrapping structs with private fields fails.  You could try making a wrapper type for it, and 
     281    then wrapping that :X 
     282 
     283<br><br> 
     284<b>Examples:</b><br> 
     285<pre class="d_code"><u>WrapClass</u>!(MyClass, <font color=blue>void</font> <font color=blue>function</font>(<font color=blue>int</font>), <font color=blue>void</font> <font color=blue>function</font>(<font color=blue>int</font>, <font color=blue>float</font>)) <font color=green>// class type, followed by ctor types 
     286</font> .method!(MyClass.methodOne)() <font color=green>// wrap a method 
     287</font> .property!(MyClass.position)() <font color=green>// wrap a property 
     288</font>.addToNamespace(someNamespace); <font color=green>// register it into a namespace 
     289</font></pre> 
     290<br><br> 
     291 
     292 
     293<script>explorer.outline.incSymbolLevel();</script> 
     294<dl> 
     295<script>explorer.outline.writeEnabled = true;</script> 
     296<dt><span class="decl">typeof(*this)  
     297<span class="currsymbol">opCall</span> 
     298<script>explorer.outline.addDecl('opCall');</script> 
     299 
     300(); 
     301</span></dt> 
     302<script>explorer.outline.writeEnabled = false;</script> 
     303 
     304 
     305<dd>Creates an instance of this struct so you can start wrapping your class or struct. 
     306<br><br> 
     307<b>Returns:</b><br> 
     308An instance of this struct. 
     309     
     310<br><br> 
     311 
     312</dd> 
     313 
     314<script>explorer.outline.writeEnabled = true;</script> 
     315<dt><span class="decl">template  
     316<span class="currsymbol">method</span> 
     317<script>explorer.outline.addDecl('method');</script> 
     318 
     319(alias func,char[] name = NameOfFunc!(func),funcType = typeof(func))<br>template  
     320<span class="currsymbol">method</span> 
     321<script>explorer.outline.addDecl('method');</script> 
     322 
     323(alias func,funcType)</span></dt> 
     324<script>explorer.outline.writeEnabled = false;</script> 
     325 
     326 
     327<dd>Wrap a class or struct  
     328<span class="currsymbol">method</span> 
     329<script>explorer.outline.addDecl('method');</script> 
     330 
     331. 
     332<br><br> 
     333<b>Params:</b><br> 
     334<table><tr> 
     335<td nowrap valign="top" style="padding-right: 8px">func</td> 
     336 
     337                
     338<td>An alias to the  
     339<span class="currsymbol">method</span> 
     340<script>explorer.outline.addDecl('method');</script> 
     341 
     342 to wrap.  If your class type is "MyClass" and the  
     343<span class="currsymbol">method</span> 
     344<script>explorer.outline.addDecl('method');</script> 
     345 
     346 is "foo", use "MyClass.foo" (without the quotes) 
     347            as the parameter.</td></tr> 
     348<tr> 
     349<td nowrap valign="top" style="padding-right: 8px">name</td> 
     350 
     351                
     352<td>The name that should be used on the MiniD side to represent the  
     353<span class="currsymbol">method</span> 
     354<script>explorer.outline.addDecl('method');</script> 
     355 
     356.  Defaults to the D  
     357<span class="currsymbol">method</span> 
     358<script>explorer.outline.addDecl('method');</script> 
     359 
     360 name.</td></tr> 
     361<tr> 
     362<td nowrap valign="top" style="padding-right: 8px">funcType</td> 
     363 
     364                
     365<td>The type of the  
     366<span class="currsymbol">method</span> 
     367<script>explorer.outline.addDecl('method');</script> 
     368 
     369 to wrap.  This defaults to typeof(func), but you'll need to specify this 
     370            explicitly if you're wrapping an overloaded  
     371<span class="currsymbol">method</span> 
     372<script>explorer.outline.addDecl('method');</script> 
     373 
     374, in order to select the proper overload.</td></tr> 
     375</table><br> 
     376<b>Returns:</b><br> 
     377A chaining reference to this struct. 
     378     
     379<br><br> 
     380 
     381 
     382<script>explorer.outline.incSymbolLevel();</script> 
     383<dl></dl> 
     384<script>explorer.outline.decSymbolLevel();</script> 
     385 
     386 
     387</dd> 
     388 
     389<script>explorer.outline.writeEnabled = true;</script> 
     390<dt><span class="decl">template  
     391<span class="currsymbol">property</span> 
     392<script>explorer.outline.addDecl('property');</script> 
     393 
     394(alias func,char[] name = NameOfFunc!(func),funcType = typeof(func))<br>template  
     395<span class="currsymbol">property</span> 
     396<script>explorer.outline.addDecl('property');</script> 
     397 
     398(alias func,funcType)</span></dt> 
     399<script>explorer.outline.writeEnabled = false;</script> 
     400 
     401 
     402<dd>Wrap a  
     403<span class="currsymbol">property</span> 
     404<script>explorer.outline.addDecl('property');</script> 
     405 
     406.  MiniD doesn't have explicit support for properties, but the MiniD standard library follows a certain convention, which is 
     407    compatible with the D  
     408<span class="currsymbol">property</span> 
     409<script>explorer.outline.addDecl('property');</script> 
     410 
     411 convention.  In MiniD, a  
     412<span class="currsymbol">property</span> 
     413<script>explorer.outline.addDecl('property');</script> 
     414 
     415 is represented as a function which sets the value when called with one 
     416    parameter, and which gets the value when called with none, just like in D.  A wrapped  
     417<span class="currsymbol">property</span> 
     418<script>explorer.outline.addDecl('property');</script> 
     419 
     420 will call the getter and/or setter appropriately 
     421    when used from MiniD.  The getter and setter are automatically determined, so you don't have to wrap them separately.  It will also work if 
     422    your  
     423<span class="currsymbol">property</span> 
     424<script>explorer.outline.addDecl('property');</script> 
     425 
     426 is read-only or write-only. 
     427<br><br> 
     428<b>Params:</b><br> 
     429<table><tr> 
     430<td nowrap valign="top" style="padding-right: 8px">func</td> 
     431 
     432                
     433<td>An alias to the  
     434<span class="currsymbol">property</span> 
     435<script>explorer.outline.addDecl('property');</script> 
     436 
     437 to wrap, just like with method wrapping.</td></tr> 
     438<tr> 
     439<td nowrap valign="top" style="padding-right: 8px">name</td> 
     440 
     441                
     442<td>The name that should be used on the MiniD side to represent the  
     443<span class="currsymbol">property</span> 
     444<script>explorer.outline.addDecl('property');</script> 
     445 
     446.  Defaults to the D  
     447<span class="currsymbol">property</span> 
     448<script>explorer.outline.addDecl('property');</script> 
     449 
     450 name.</td></tr> 
     451<tr> 
     452<td nowrap valign="top" style="padding-right: 8px">funcType</td> 
     453 
     454                
     455<td>The type of the  
     456<span class="currsymbol">property</span> 
     457<script>explorer.outline.addDecl('property');</script> 
     458 
     459 to wrap.  This defaults to typeof(func), but you might have to use an explicit type if you have 
     460            another class method with the same name as the  
     461<span class="currsymbol">property</span> 
     462<script>explorer.outline.addDecl('property');</script> 
     463 
     464 but with a different number of parameters.  This can be either 
     465            the type of the setter or the getter.</td></tr> 
     466</table><br> 
     467<b>Returns:</b><br> 
     468A chaining reference to this struct. 
     469     
     470<br><br> 
     471 
     472 
     473<script>explorer.outline.incSymbolLevel();</script> 
     474<dl></dl> 
     475<script>explorer.outline.decSymbolLevel();</script> 
     476 
     477 
     478</dd> 
     479 
     480<script>explorer.outline.writeEnabled = true;</script> 
     481<dt><span class="decl">void  
     482<span class="currsymbol">makeGlobal</span> 
     483<script>explorer.outline.addDecl('makeGlobal');</script> 
     484 
     485(MDContext <span class="funcparam">ctx</span>, dchar[] <span class="funcparam">name</span> = ""); 
     486</span></dt> 
     487<script>explorer.outline.writeEnabled = false;</script> 
     488 
     489 
     490<dd>Registers this class as a global variable in the given context. 
     491<br><br> 
     492<b>Params:</b><br> 
     493<table><tr> 
     494<td nowrap valign="top" style="padding-right: 8px">MDContext <span class="funcparam">ctx</span></td> 
     495 
     496                
     497<td>The context to load this class into.</td></tr> 
     498<tr> 
     499<td nowrap valign="top" style="padding-right: 8px">dchar[] <span class="funcparam">name</span></td> 
     500 
     501                
     502<td>The <span class="funcparam">name</span> to give the class in MiniD.  Defaults to "", which means the class's D <span class="funcparam">name</span> will be used as the MiniD <span class="funcparam">name</span>.</td></tr> 
     503</table><br> 
     504 
     505</dd> 
     506 
     507<script>explorer.outline.writeEnabled = true;</script> 
     508<dt><span class="decl">void  
     509<span class="currsymbol">addToNamespace</span> 
     510<script>explorer.outline.addDecl('addToNamespace');</script> 
     511 
     512(MDNamespace <span class="funcparam">ns</span>, dchar[] <span class="funcparam">name</span> = ""); 
     513</span></dt> 
     514<script>explorer.outline.writeEnabled = false;</script> 
     515 
     516 
     517<dd>Adds this class to some namespace. 
     518<br><br> 
     519<b>Params:</b><br> 
     520<table><tr> 
     521<td nowrap valign="top" style="padding-right: 8px">MDNamespace <span class="funcparam">ns</span></td> 
     522 
     523                
     524<td>The namespace to put this class in.</td></tr> 
     525<tr> 
     526<td nowrap valign="top" style="padding-right: 8px">dchar[] <span class="funcparam">name</span></td> 
     527 
     528                
     529<td>The <span class="funcparam">name</span> to give the class in MiniD.  Defaults to "", which means the class's D <span class="funcparam">name</span> will be used as the MiniD <span class="funcparam">name</span>.</td></tr> 
     530</table><br> 
    230531 
    231532</dd> 
     
    250551 
    251552 
    252 <dd>Given a function alias, and an optional name and type for overloading, this will wrap the function and register 
    253 it in the global namespace.  This is not meant to be used as a parameter to WrapModule, as it's not in any module. 
    254 <br><br> 
     553<dd>Wraps a free function and places it into a given namespace. 
     554<br><br> 
     555<b>Params:</b><br> 
     556<table><tr> 
     557<td nowrap valign="top" style="padding-right: 8px">func</td> 
     558 
     559                
     560<td>An alias to the function you want to wrap.</td></tr> 
     561<tr> 
     562<td nowrap valign="top" style="padding-right: 8px">name</td> 
     563 
     564                
     565<td>The name to call it in MiniD.  Defaults to the D function name.</td></tr> 
     566<tr> 
     567<td nowrap valign="top" style="padding-right: 8px">funcType</td> 
     568 
     569                
     570<td>The type of the function to wrap.  This defaults to typeof(func), but you'll need to specify this 
     571        explicitly if you're wrapping an overloaded function, in order to select the proper overload.</td></tr> 
     572<tr> 
     573<td nowrap valign="top" style="padding-right: 8px">ns</td> 
     574 
     575                
     576<td>The namespace to put the function in.</td></tr> 
     577</table><br> 
    255578 
    256579</dd> 
     
    270593 
    271594 
    272 <dd>Given a function alias, and an optional name and type for overloading, this will wrap the function and register 
    273 it in the global namespace.  This is not meant to be used as a parameter to WrapModule, as it's not in any module. 
    274 <br><br> 
     595<dd>Wraps a free function and places it into the global namespace of a given context. 
     596<br><br> 
     597<b>Params:</b><br> 
     598<table><tr> 
     599<td nowrap valign="top" style="padding-right: 8px">func</td> 
     600 
     601                
     602<td>An alias to the function you want to wrap.</td></tr> 
     603<tr> 
     604<td nowrap valign="top" style="padding-right: 8px">name</td> 
     605 
     606                
     607<td>The name to call it in MiniD.  Defaults to the D function name.</td></tr> 
     608<tr> 
     609<td nowrap valign="top" style="padding-right: 8px">funcType</td> 
     610 
     611                
     612<td>The type of the function to wrap.  This defaults to typeof(func), but you'll need to specify this 
     613        explicitly if you're wrapping an overloaded function, in order to select the proper overload.</td></tr> 
     614<tr> 
     615<td nowrap valign="top" style="padding-right: 8px">context</td> 
     616 
     617                
     618<td>The context into whose global namespace this function will be placed.</td></tr> 
     619</table><br> 
    275620 
    276621</dd> 
     
    281626<script>explorer.outline.addDecl('MinArgs');</script> 
    282627 
    283 (alias func)</span></dt> 
     628(alias func,funcType = void)</span></dt> 
    284629<script>explorer.outline.writeEnabled = false;</script> 
    285630 
     
    344689            Page was generated with 
    345690            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    346             on Sat Nov 17 12:30:58 2007 
     691            on Sun Nov 18 11:04:09 2007 
    347692 
    348693        </td></tr> 
     
    350695</div> 
    351696<script> 
    352     explorer.packageExplorer.addModuleFull("minid.bind");</script> 
     697    explorer.packageExplorer.addModuleFull("minid.minid"); 
     698    explorer.packageExplorer.addModuleFull("minid.types"); 
     699    explorer.packageExplorer.addModuleFull("minid.bind"); 
     700    explorer.packageExplorer.addModuleFull("minid.compiler"); 
     701    explorer.packageExplorer.addModuleFull("minid.utils");</script> 
    353702</body></html> 
    354703 
  • trunk/docs/minid.compiler.html

    r232 r240  
    1414    <table class="content"> 
    1515        <tr><td id="docbody"><h1>minid.compiler</h1><!-- Generated by Ddoc from minid\compiler.d --> 
     16The MiniD  
     17<span class="currsymbol">compiler</span> 
     18<script>explorer.outline.addDecl('compiler');</script> 
     19 
     20.  This is, unsurprisingly, the largest part of the implementation, 
     21although it has a very small public interface. 
     22<br><br> 
    1623<b>License:</b><br> 
    1724Copyright (c) 2007 Jarrett Billingsley 
     
    188195            Page was generated with 
    189196            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    190             on Thu Nov  8 11:40:17 2007 
     197            on Sun Nov 18 11:04:10 2007 
    191198 
    192199        </td></tr> 
     
    195202<script> 
    196203    explorer.packageExplorer.addModuleFull("minid.minid"); 
     204    explorer.packageExplorer.addModuleFull("minid.types"); 
    197205    explorer.packageExplorer.addModuleFull("minid.bind"); 
    198     explorer.packageExplorer.addModuleFull("minid.types"); 
    199206    explorer.packageExplorer.addModuleFull("minid.compiler"); 
    200207    explorer.packageExplorer.addModuleFull("minid.utils");</script> 
  • trunk/docs/minid.minid.html

    r232 r240  
    1414    <table class="content"> 
    1515        <tr><td id="docbody"><h1>minid.minid</h1><!-- Generated by Ddoc from minid\minid.d --> 
     16This module holds some useful API functions that don't fit anywhere else.  This 
     17also holds the important NewContext function, which is how you create a MiniD 
     18interpreter to use in your app. 
     19<br><br> 
    1620<b>License:</b><br> 
    1721Copyright (c) 2007 Jarrett Billingsley 
     
    331335<script>explorer.outline.addDecl('loadStatementString');</script> 
    332336 
    333 (MDState <span class="funcparam">s</span>, dchar[] <span class="funcparam">source</span>, MDValue [] <span class="funcparam">params</span> = null, char[] <span class="funcparam">name</span> = "&lt;statement string&gt;"); 
     337(MDState <span class="funcparam">s</span>, dchar[] <span class="funcparam">source</span>, MDNamespace <span class="funcparam">ns</span> = cast(MDNamespace)null, MDValue [] <span class="funcparam">params</span> = null, char[] <span class="funcparam">name</span> = "&lt;statement string&gt;"); 
    334338</span></dt> 
    335339<script>explorer.outline.writeEnabled = false;</script> 
     
    351355                
    352356<td>The <span class="funcparam">source</span> code to be compiled.</td></tr> 
     357<tr> 
     358<td nowrap valign="top" style="padding-right: 8px">MDNamespace <span class="funcparam">ns</span></td> 
     359 
     360                
     361<td>The namespace which will be used as the context in which the statements will be evaluated. 
     362        Defaults to the global namespace of the state'<span class="funcparam">s</span> owning context.</td></tr> 
    353363<tr> 
    354364<td nowrap valign="top" style="padding-right: 8px">MDValue [] <span class="funcparam">params</span></td> 
     
    409419 
    410420</dd> 
     421 
     422<script>explorer.outline.writeEnabled = true;</script> 
     423<dt><span class="decl">template  
     424<span class="currsymbol">toJSON</span> 
     425<script>explorer.outline.addDecl('toJSON');</script> 
     426 
     427(U)<br>alias  
     428<span class="currsymbol">toJSONc</span> 
     429<script>explorer.outline.addDecl('toJSONc');</script> 
     430 
     431; 
     432<br>alias  
     433<span class="currsymbol">toJSONw</span> 
     434<script>explorer.outline.addDecl('toJSONw');</script> 
     435 
     436; 
     437<br>alias  
     438<span class="currsymbol">toJSONd</span> 
     439<script>explorer.outline.addDecl('toJSONd');</script> 
     440 
     441; 
     442</span></dt> 
     443<script>explorer.outline.writeEnabled = false;</script> 
     444 
     445 
     446<dd>Convert a table or an array object into JSON format.  This will work with MDTable, MDArray, or any 
     447convertible D array or AA type.  Returns a string containing the JSON data.  If you have the need 
     448for converting lots of things to JSON, or for writing JSON to some kind of output, use the writeJSON 
     449function instead, as it lets you specify a place to put the resulting data, rather than allocating 
     450its own destination. 
     451<br><br> 
     452This function is inside a template which is parameterized on the return type, or rather, the character 
     453type of the return string type.  You can call it either as  
     454<span class="currsymbol">toJSON</span> 
     455<script>explorer.outline.addDecl('toJSON');</script> 
     456 
     457!(T)(...) where T is one of char, 
     458wchar, or dchar, or you can call it using the aliases toJSONc, toJSONw, and toJSONd. 
     459 
     460<br><br> 
     461<b>Params:</b><br> 
     462<table><tr> 
     463<td nowrap valign="top" style="padding-right: 8px">r</td> 
     464 
     465                
     466<td>The root of the data.  Must be an MDTable, MDArray, or any convertible D array or AA type.</td></tr> 
     467<tr> 
     468<td nowrap valign="top" style="padding-right: 8px">pretty</td> 
     469 
     470                
     471<td>If <b>true</b>, inserts newlines and indentation in the output to make it more human-readable. 
     472        If <b>false</b>, elides all nonsignificant whitespace to make it as short as possible for transmission. 
     473        Defaults to <b>false</b>.</td></tr> 
     474</table><br> 
     475<b>Returns:</b><br> 
     476The converted data as a string. 
     477<br><br> 
     478 
     479 
     480<script>explorer.outline.incSymbolLevel();</script> 
     481<dl></dl> 
     482<script>explorer.outline.decSymbolLevel();</script> 
     483 
     484 
     485</dd> 
     486 
     487<script>explorer.outline.writeEnabled = true;</script> 
     488<dt><span class="decl">template  
     489<span class="currsymbol">writeJSON</span> 
     490<script>explorer.outline.addDecl('writeJSON');</script> 
     491 
     492(U)<br>alias  
     493<span class="currsymbol">writeJSONc</span> 
     494<script>explorer.outline.addDecl('writeJSONc');</script> 
     495 
     496; 
     497<br>alias  
     498<span class="currsymbol">writeJSONw</span> 
     499<script>explorer.outline.addDecl('writeJSONw');</script> 
     500 
     501; 
     502<br>alias  
     503<span class="currsymbol">writeJSONd</span> 
     504<script>explorer.outline.addDecl('writeJSONd');</script> 
     505 
     506; 
     507</span></dt> 
     508<script>explorer.outline.writeEnabled = false;</script> 
     509 
     510 
     511<dd>Similar to toJSON, but instead of creating a string for the output and returning that, this allows you 
     512to specify a Print instance that will be used to output the JSON as it's generated.  Note that if there's 
     513an error during conversion, some of the data will have been printed already, so it's up to you to make sure 
     514that any unwanted data is cleaned up. 
     515<br><br> 
     516Just like toJSON, this is parameterized on the character type of the output, and can be called either as 
     517 
     518<span class="currsymbol">writeJSON</span> 
     519<script>explorer.outline.addDecl('writeJSON');</script> 
     520 
     521!(T)(...) or as one of the aliases. 
     522 
     523<br><br> 
     524<b>Params:</b><br> 
     525<table><tr> 
     526<td nowrap valign="top" style="padding-right: 8px">printer</td> 
     527 
     528                
     529<td>An instance of a Print parameterized on the type of the output.  This is where the JSON will 
     530        be sent as it's being generated.</td></tr> 
     531<tr> 
     532<td nowrap valign="top" style="padding-right: 8px">r</td> 
     533 
     534                
     535<td>The root of the data.  Must be an MDTable, MDArray, or any convertible D array or AA type.</td></tr> 
     536<tr> 
     537<td nowrap valign="top" style="padding-right: 8px">pretty</td> 
     538 
     539                
     540<td>If <b>true</b>, inserts newlines and indentation in the output to make it more human-readable. 
     541        If <b>false</b>, elides all nonsignificant whitespace to make it as short as possible for transmission. 
     542        Defaults to <b>false</b>.</td></tr> 
     543</table><br> 
     544<b>Examples:</b><br> 
     545<pre class="d_code"><font color=blue>import</font> tango.io.Stdout; 
     546 
     547... 
     548 
     549<font color=green>// Stdout is a Print!(char) instance, so we use the char version of writeJSON. 
     550</font><font color=green>// We could also write "writeJSON!(char)(...)" here. 
     551</font>writeJSONc(Stdout, [<font color=red>"hi"</font>[]: 3, <font color=red>"bye"</font>: 6]); 
     552</pre> 
     553<br><br> 
     554 
     555 
     556<script>explorer.outline.incSymbolLevel();</script> 
     557<dl></dl> 
     558<script>explorer.outline.decSymbolLevel();</script> 
     559 
     560 
     561</dd> 
    411562</dl> 
    412563<script>explorer.outline.decSymbolLevel();</script> 
     
    417568            Page was generated with 
    418569            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    419             on Thu Nov  8 11:40:16 2007 
     570            on Sun Nov 18 11:04:08 2007 
    420571 
    421572        </td></tr> 
     
    424575<script> 
    425576    explorer.packageExplorer.addModuleFull("minid.minid"); 
     577    explorer.packageExplorer.addModuleFull("minid.types"); 
    426578    explorer.packageExplorer.addModuleFull("minid.bind"); 
    427     explorer.packageExplorer.addModuleFull("minid.types"); 
    428579    explorer.packageExplorer.addModuleFull("minid.compiler"); 
    429580    explorer.packageExplorer.addModuleFull("minid.utils");</script> 
  • trunk/docs/minid.types.html

    r232 r240  
    2222'thread' type for coroutines). 
    2323<br><br> 
     24It makes me sad to have to have so much stuff in one file, but D just can't handle 
     25circular imports (which would be necessary for splitting this up) without throwing 
     26up all over itself in a flurry of forward declaration/reference errors.  Sigh, if 
     27only it followed the spec where it says "things to drop: forward declarations." 
     28 
     29<br><br> 
    2430<b>License:</b><br> 
    2531Copyright (c) 2007 Jarrett Billingsley 
     
    24062412 
    24072413</dd> 
     2414 
     2415<script>explorer.outline.writeEnabled = true;</script> 
     2416<dt><span class="decl">MDClass  
     2417<span class="currsymbol">getClass</span> 
     2418<script>explorer.outline.addDecl('getClass');</script> 
     2419 
     2420(); 
     2421</span></dt> 
     2422<script>explorer.outline.writeEnabled = false;</script> 
     2423 
     2424 
     2425<dd>Gets a reference to the owning class. 
     2426     
     2427<br><br> 
     2428 
     2429</dd> 
    24082430</dl> 
    24092431<script>explorer.outline.decSymbolLevel();</script> 
     
    34523474<script>explorer.outline.writeEnabled = true;</script> 
    34533475<dt><span class="decl">this(MDContext <span class="funcparam">context</span>); 
     3476<br>this(MDContext <span class="funcparam">context</span>, MDClosure <span class="funcparam">coroFunc</span>); 
    34543477</span></dt> 
    34553478<script>explorer.outline.writeEnabled = false;</script> 
     
    45844607            Page was generated with 
    45854608            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    4586             on Thu Nov  8 11:40:16 2007 
     4609            on Sun Nov 18 11:04:09 2007 
    45874610 
    45884611        </td></tr> 
     
    45914614<script> 
    45924615    explorer.packageExplorer.addModuleFull("minid.minid"); 
     4616    explorer.packageExplorer.addModuleFull("minid.types"); 
    45934617    explorer.packageExplorer.addModuleFull("minid.bind"); 
    4594     explorer.packageExplorer.addModuleFull("minid.types"); 
    45954618    explorer.packageExplorer.addModuleFull("minid.compiler"); 
    45964619    explorer.packageExplorer.addModuleFull("minid.utils");</script> 
  • trunk/docs/minid.utils.html

    r232 r240  
    1414    <table class="content"> 
    1515        <tr><td id="docbody"><h1>minid.utils</h1><!-- Generated by Ddoc from minid\utils.d --> 
     16A module holding a variety of utility functions used throughout MiniD.  This 
     17module doesn't (and shouldn't) depend on the rest of the library in any way, 
     18and as such can't hold implementation-specific functionality.  For that, look 
     19in the minid.misc module. 
     20<br><br> 
    1621<b>License:</b><br> 
    1722Copyright (c) 2007 Jarrett Billingsley 
     
    4550<dl> 
    4651<script>explorer.outline.writeEnabled = true;</script> 
     52<dt><span class="decl">alias  
     53<span class="currsymbol">mdfloat</span> 
     54<script>explorer.outline.addDecl('mdfloat');</script> 
     55 
     56; 
     57</span></dt> 
     58<script>explorer.outline.writeEnabled = false;</script> 
     59 
     60 
     61<dd>This alias defines what the MiniD 'float' type uses.  By default and according to the MiniD spec, it's double, but if you don't need 
     62the extra precision and want to save some space/speed in the MiniD struct, you can alias it to float instead. 
     63<br><br> 
     64 
     65</dd> 
     66 
     67<script>explorer.outline.writeEnabled = true;</script> 
    4768<dt><span class="decl">template  
    4869<span class="currsymbol">isStringType</span> 
     
    241262 
    242263<script>explorer.outline.writeEnabled = true;</script> 
    243 <dt><span class="decl">ReturnType!(func) delegate(ParameterTypeTuple!(func))  
    244 <span class="currsymbol">ToDelegate</span> 
    245 <script>explorer.outline.addDecl('ToDelegate');</script> 
    246  
    247 (alias func)(); 
    248 </span></dt> 
    249 <script>explorer.outline.writeEnabled = false;</script> 
    250  
    251  
    252 <dd>Convert any function pointer into a delegate that calls the function when it's called. 
    253 <br><br> 
    254  
    255 </dd> 
    256  
    257 <script>explorer.outline.writeEnabled = true;</script> 
    258264<dt><span class="decl">int  
    259265<span class="currsymbol">dcmp</span> 
     
    271277 
    272278<script>explorer.outline.writeEnabled = true;</script> 
    273 <dt><span class="decl">dchar[]  
    274 <span class="currsymbol">toLowerD</span> 
    275 <script>explorer.outline.addDecl('toLowerD');</script> 
    276  
    277 (dchar[] <span class="funcparam">s</span>); 
    278 </span></dt> 
    279 <script>explorer.outline.writeEnabled = false;</script> 
    280  
    281  
    282 <dd>Lowercase a dchar[] using proper Unicode character functions. 
    283 <br><br> 
    284  
    285 </dd> 
    286  
    287 <script>explorer.outline.writeEnabled = true;</script> 
    288 <dt><span class="decl">dchar[]  
    289 <span class="currsymbol">toUpperD</span> 
    290 <script>explorer.outline.addDecl('toUpperD');</script> 
    291  
    292 (dchar[] <span class="funcparam">s</span>); 
    293 </span></dt> 
    294 <script>explorer.outline.writeEnabled = false;</script> 
    295  
    296  
    297 <dd>Uppercase a dchar[] using proper Unicode character functions. 
     279<dt><span class="decl">int  
     280<span class="currsymbol">idcmp</span> 
     281<script>explorer.outline.addDecl('idcmp');</script> 
     282 
     283(dchar[] <span class="funcparam">s1</span>, dchar[] <span class="funcparam">s2</span>); 
     284</span></dt> 
     285<script>explorer.outline.writeEnabled = false;</script> 
     286 
     287 
     288<dd>Compares dchar[] strings stupidly, but case-insensitively. 
    298289<br><br> 
    299290 
     
    591582 
    592583</dd> 
     584 
     585<script>explorer.outline.writeEnabled = true;</script> 
     586<dt><span class="decl">template  
     587<span class="currsymbol">ToUTF8</span> 
     588<script>explorer.outline.addDecl('ToUTF8');</script> 
     589 
     590(char[] s)<br>template  
     591<span class="currsymbol">ToUTF8</span> 
     592<script>explorer.outline.addDecl('ToUTF8');</script> 
     593 
     594(wchar[] s)<br>template  
     595<span class="currsymbol">ToUTF8</span> 
     596<script>explorer.outline.addDecl('ToUTF8');</script> 
     597 
     598(dchar[] s)<br>template  
     599<span class="currsymbol">ToUTF16</span> 
     600<script>explorer.outline.addDecl('ToUTF16');</script> 
     601 
     602(char[] s)<br>template  
     603<span class="currsymbol">ToUTF16</span> 
     604<script>explorer.outline.addDecl('ToUTF16');</script> 
     605 
     606(wchar[] s)<br>template  
     607<span class="currsymbol">ToUTF16</span> 
     608<script>explorer.outline.addDecl('ToUTF16');</script> 
     609 
     610(dchar[] s)<br>template  
     611<span class="currsymbol">ToUTF32</span> 
     612<script>explorer.outline.addDecl('ToUTF32');</script> 
     613 
     614(char[] s)<br>template  
     615<span class="currsymbol">ToUTF32</span> 
     616<script>explorer.outline.addDecl('ToUTF32');</script> 
     617 
     618(wchar[] s)<br>template  
     619<span class="currsymbol">ToUTF32</span> 
     620<script>explorer.outline.addDecl('ToUTF32');</script> 
     621 
     622(dchar[] s)</span></dt> 
     623<script>explorer.outline.writeEnabled = false;</script> 
     624 
     625 
     626<dd>Convert string literals between unicode encodings at compile time.  I swear, this should be 
     627built into the compiler or something. 
     628<br><br> 
     629 
     630 
     631<script>explorer.outline.incSymbolLevel();</script> 
     632<dl></dl> 
     633<script>explorer.outline.decSymbolLevel();</script> 
     634 
     635 
     636</dd> 
     637 
     638<script>explorer.outline.writeEnabled = true;</script> 
     639<dt><span class="decl">template  
     640<span class="currsymbol">Itoa</span> 
     641<script>explorer.outline.addDecl('Itoa');</script> 
     642 
     643(int i)</span></dt> 
     644<script>explorer.outline.writeEnabled = false;</script> 
     645 
     646 
     647<dd>Convert an integer to a string at compile time. 
     648<br><br> 
     649 
     650 
     651<script>explorer.outline.incSymbolLevel();</script> 
     652<dl></dl> 
     653<script>explorer.outline.decSymbolLevel();</script> 
     654 
     655 
     656</dd> 
    593657</dl> 
    594658<script>explorer.outline.decSymbolLevel();</script> 
     
    599663            Page was generated with 
    600664            <img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px"> 
    601             on Thu Nov  8 11:40:17 2007 
     665            on Sun Nov 18 11:04:10 2007 
    602666 
    603667        </td></tr> 
     
    606670<script> 
    607671    explorer.packageExplorer.addModuleFull("minid.minid"); 
     672    explorer.packageExplorer.addModuleFull("minid.types"); 
    608673    explorer.packageExplorer.addModuleFull("minid.bind"); 
    609     explorer.packageExplorer.addModuleFull("minid.types"); 
    610674    explorer.packageExplorer.addModuleFull("minid.compiler"); 
    611675    explorer.packageExplorer.addModuleFull("minid.utils");</script>