Icon+Unicon/Intro: Difference between revisions

Diffs
(Diffs)
Line 238:
====error throwing====
Errors can be thrown using the function
 
= Appendix A - Icon and Unicon Differences (Details) =
 
The purpose of this section is to capture some of the langauge differences at a detailed level.
 
== Major Differences ==
 
* Classes and Objects
 
<lang Unicon>package packagename
 
class classname: Class (fcn)
method meth1(args[])
...
end
 
method meth2(f, args)
...
end
 
initially (f, args[] )
...
end</lang>
 
...
 
object.name(parameters)
object$superclassname.name(parameters)
 
== Minor Differences ==
 
* Co-expression calling. With co-expression ce, the following pairs of activations are equivalent in Unicon:
<lang Unicon> []@ce # sends a list to co-expression ce both Icon and Unicon
[x,y,z]@ce
ce() # equivalent calls Unicon only
ce(x,y,z)</lang>
 
* Procedure call type casting allows for specification of type coercion functions and default values
<lang Unicon>
procedure f1(i:integer:1,r:real,s:string,L:list,x:mycoercionproc)</lang>
Anonymous user