🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #147361

Re: [slrn] macro help please

#147361
From: J.B. Nicholson-Owens
Date: Fri, 30 Apr 2004 16:45
31 lines
2668 bytes
Lars Stokholm wrote:
> [W]ould you mind explaining to me why you make the function 'static'? Also
> I would like to know if it's a good idea to use 'implements', and why.

For explanations of what implements and namespace scope declarations
("global", "static", and "private") do, please consult the S-Lang
documentation.  In the S-Lang package from http://jedsoft.org/ you can find
text documentation and a tutorial in "doc/text/slang.txt".

We're talking about two lines of code:

  implements ("my");
  static define function_name_goes_here ()

I recommend naming a namespace for personal use because it avoids clobbering
anything in any other namespace.  "my" is a traditional name for something
private to you (widely used in Smalltalk, for instance) so that is the name
I chose.

Strictly speaking, one doesn't need to explicitly say "static" after the
"implements" line.  Static declaration is implied here.  But I say it so
it's clear when one looks at the code months later or if S-Lang goes back to
requiring such declaration.

I also make the function static because one needs the function to exist in a
particular namespace and yet also be accessible from any other namespace.
Static declaration accomplishes this.  For functions and variables one only
needs to (or should) access from within the same file, declaring these as
"private" will be better.  "global" declaration places the variable or
function in the Global namespace, also available to all functions and
variables.
Technical Details
Message-ID: <slrnc950lu.5gt.jbn@forestfield.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.ash.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!nntp.giganews.com!news2.telebyte.nl!fu-berlin.de!uni-berlin.de!12-221-67-248.client.insightbb.COM!not-for-mail
References: <rc32m1-4mc.ln1@news.invalid.99computer> <slrnc8t01h.6s8.jbn@forestfield.org> <mq06m1-s4q.ln1@news.invalid.99computer> <slrnc93fsp.5do.jbn@forestfield.org> <slrnc94pgp.1ms.lars@stokholm.dyndns.dk>

Show Full Headers
Complete Article Headers
Message-ID: <slrnc950lu.5gt.jbn@forestfield.org>
Subject: Re: [slrn] macro help please
Date: Fri, 30 Apr 2004 16:45:52 +0000
From: "J.B. Nicholson-Owens" <jbn@forestfield.org>
References: <rc32m1-4mc.ln1@news.invalid.99computer> <slrnc8t01h.6s8.jbn@forestfield.org> <mq06m1-s4q.ln1@news.invalid.99computer> <slrnc93fsp.5do.jbn@forestfield.org> <slrnc94pgp.1ms.lars@stokholm.dyndns.dk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.ash.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!nntp.giganews.com!news2.telebyte.nl!fu-berlin.de!uni-berlin.de!12-221-67-248.client.insightbb.COM!not-for-mail
Newsgroups: news.software.readers
Organization: Forest Field OmniMedia
Lines: 31
NNTP-Posting-Host: 12-221-67-248.client.insightbb.com (12.221.67.248)
X-Trace: news.uni-berlin.de 1083343552 17184298 I 12.221.67.248 ([35848])
Mail-Copies-To: nobody
User-Agent: slrn/0.9.7.4 (Linux)