Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bd5c3d824c3db63ffd9226c15941e6ad > files > 811

mozart-1.4.0-1mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>3 Language and design issues</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node2.html#chapter.programming">&lt;&lt; Prev</A></TD><TD><A href="index.html">- Up -</A></TD></TR></TABLE><DIV id="chapter.language"><H1><A name="chapter.language">3 Language and design issues</A></H1><H2><A name="label16">3.1 Why is the syntax so weird?</A></H2><P>The most unusual thing about the syntax is the choice of curly braces for procedure application. Once you get used to that you can be rather comfortably puzzled by other things.</P><H2><A name="label17">3.2 Does Oz have garbage collection?</A></H2><P>Yes, Oz has automatic garbage collection (2 space copying GC). For open distributed computing applications, it also implements automatic distributed GC, but, at present, not all distributed cyclic datastructures can be collected successfully.</P><H2><A name="label18">3.3 What is constraint programming?</A></H2><P></P><H2><A name="label19">3.4 Can I also have state?</A></H2><P></P><H2><A name="label20">3.5 What is multi-paradigm programming?</A></H2><P>Multi-paradigm programming is the freedom to choose and mix programming paradigms according to your tastes and needs. Unlike most other programming languages which lock you into a single programming paradigm, Oz unifies into one simple and coherent framework the functional, object-oriented, and logic flavors of programming. This is possible due to the very general and powerful underlying paradigm of concurrent constraint programming.</P><H2><A name="label21">3.6 Does Oz support object-oriented programming?</A></H2><P>Yes, Oz supports the class/instance model for object-oriented programming. A class is created e.&nbsp;g. as follows: </P><BLOCKQUOTE class="code"><CODE><SPAN class="keyword">declare</SPAN>&nbsp;<BR><SPAN class="keyword">class</SPAN>&nbsp;<SPAN class="type">Foo</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">attr</SPAN>&nbsp;val<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">init</SPAN>(V)&nbsp;val<SPAN class="keyword">:=</SPAN>V&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">show</SPAN>&nbsp;{Show&nbsp;foo(val:&nbsp;<SPAN class="keyword">@</SPAN>val)}&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR><SPAN class="keyword">end</SPAN></CODE></BLOCKQUOTE><P> An instance is created using procedure <CODE>New</CODE> applied to class <CODE>Foo</CODE> and initial message <CODE>init(12)</CODE> for example: </P><BLOCKQUOTE class="code"><CODE><SPAN class="keyword">declare</SPAN>&nbsp;O&nbsp;=&nbsp;{New&nbsp;Foo&nbsp;init(12)}</CODE></BLOCKQUOTE><P> Object <CODE>O</CODE> can be applied to message <CODE>show</CODE> as follows: </P><BLOCKQUOTE class="code"><CODE>{O&nbsp;show}</CODE></BLOCKQUOTE><P> which, in this case causes <CODE>foo(val:&nbsp;12)</CODE> to be printed.</P><P>A point of terminology: we speak of object application rather than of message sending.</P><H2><A name="label22">3.7 Does Oz support functional programming?</A></H2><P></P><H2><A name="label23">3.8 Does Oz support logic programming?</A></H2><P></P><H2><A name="label24">3.9 Does Oz support modular programming?</A></H2><P></P><H2><A name="label25">3.10 Does Oz support concurrent programming?</A></H2><P></P><H2><A name="label26">3.11 Does Oz support distributed programming?</A></H2><P></P><H2><A name="label27">3.12 Can I do backtracking?</A></H2><P></P><H2><A name="label28">3.13 What is a computation space?</A></H2><P></P><H2><A name="label29">3.14 How do I program a search problem?</A></H2><P></P><H2><A name="label30">3.15 Why is <CODE><SPAN class="keyword">[]</SPAN></CODE> not the empty list</A></H2><P></P><H2><A name="label31">3.16 What is the meaning of the <CODE>$</CODE> marker</A></H2><P></P><H2><A name="label32">3.17 What is the meaning of the <CODE><SPAN class="keyword">,</SPAN></CODE> marker</A></H2><P></P><H2><A name="label33">3.18 What datatypes does Oz provide?</A></H2><P></P><H2><A name="label34">3.19 What is a basic constraint?</A></H2><P></P><H2><A name="label35">3.20 What is a non-basic constraint?</A></H2><P></P><H2><A name="label36">3.21 What is a propagator?</A></H2><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node2.html#chapter.programming">&lt;&lt; Prev</A></TD><TD><A href="index.html">- Up -</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys&nbsp;Duchier</A><BR><SPAN class="version">Version 1.4.0 (20090610)</SPAN></ADDRESS></BODY></HTML>