[go: nahoru, domu]

Type safety: Difference between revisions

Content deleted Content added
Line 118:
 
=== Modula-2 ===
Modula-2 is a strongly -typed language with a design philosophy to require any unsafe facilities to be explicitly marked as unsafe. This is achieved by "moving" such facilities into a built-in pseudo-library called SYSTEM from where they must be imported before they can be used. The import thus makes it visible when such facilities are used. Unfortunately, this was not consequently implemented in the original language report and its implementation.<ref>{{cite book|author=Niklaus Wirth|title=Programming in Modula-2|publisher=Springer Verlag|date=1985}}</ref> There still remained unsafe facilities such as the type cast syntax and variant records (inherited from Pascal) that could be used without prior import.<ref name="knightsoftype.blogspot.com">{{cite web|title=The Separation of Safe and Unsafe Facilities|url=http://knightsoftype.blogspot.com/2013/12/the-separation-of-safe-and-unsafe.html|accessdate=24 March 2015}}</ref> The difficulty in moving these facilities into the SYSTEM pseudo-module was the lack of any identifier for the facility that could then be imported since only identifiers can be imported, but not syntax.
 
<source lang="modula2">