sys-self man page on Inferno

Man page or keyword search:  
man Server   579 pages
apropos Keyword Search (all sections)
Output format
Inferno logo
[printable version]

SYS-SELF(2)							   SYS-SELF(2)

NAME
       SELF - reference self as a compatible module type

SYNOPSIS
       include "sys.m";
       me := load Module SELF;

DESCRIPTION
       An  instance  of a module of one type can acquire a reference to itself
       as any compatible module type, using the Limbo load operator  with  the
       special	built-in module name $self.  Normally, applications use a syn‐
       onym, the constant SELF, which is defined by sys.m outside the declara‐
       tion  of	 the  Sys module (so that it need not be imported).  Note that
       the result of the load refers to the same instance  that	 is  currently
       executing (ie, the same module data).

       This  mechanism is most often used to obtain a reference to the current
       module instance with a restriction of its module type to	 a  compatible
       subtype (eg, containing a subset of the current module's declarations).
       For example, given modules of the following types:

	      T: module
	      {
		  init:	   fn(nil: ref Draw->Context, nil: list of string);
		  special: fn(a, b: int);
	      };
	      S: module
	      {
		  special: fn(x, y: int);
	      };
	      G: module
	      {
		  init:	   fn(v: S);
	      };

       an instance of module T can execute both the following:

	      t := load T SELF;
	      s := load S SELF;

       but a module of type S could not load itself as type T.

       The result might typically be assigned to a  module  variable  of  that
       type (including passing as a parameter or storing in an adt), as in:

	      g := load G "g.dis";
	      g->init(s);

       See  the	 definition  and  use of BufioFill in bufio(2) and bufio-chan‐
       fill(2) for a practical example.

SEE ALSO
       ``The Limbo Programming Language'', Volume 2.

								   SYS-SELF(2)
[top]

List of man pages available for Inferno

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net