On Mon, Apr 15, 2013 at 11:00 PM, Arne Babenhauserheide <arne_...@web.de>wrote:

> Hi,
>
> Could you change the comparision in the SRFI¹ from my first email to the
> real implementation in Wisp?
>
> ¹: http://srfi.schemers.org/srfi-110/srfi-110.html#arne
>
> Changes:
>
> - the sublist with inline : always ends at the end of the line (thanks to
> Alan)
> - inconsistent dedents produce broken code (they *should* throw an error).
> - the name is wisp :)
>
> This means that some examples change:
>
> first: should not use double colons:
>
>     let : : x : compute 'x
>           : y : compute 'y
>         use x y
>
> new:
>
>     let
>         :
>             x : compute 'x
>             y : compute 'y
>         use x y
>
>
> SUBLIST comparison:
>
> old: would not be written like that (though you can)…
>
>     begin
>       . (display "Welcome, ") (display player) (display ", to Chicago!")
> (newline)
>
> but rather like this:
>
>     begin
>       display "Welcome, "
>       display player
>       display ", to Chicago!"
>       newline
>
>
Actually, some Lisp programmers may prefer the former; (display something)
(newline) is idiomatic in Scheme since (format ) was not standardized until
an SRFI, and may not be available (and so displaying something on a line by
itself is better put in a single physical line in code, hence the (display
foo) (newline) all-on-a-line idiom.  Also note that because (format ...)
was late in standardization, many would prefer to put a sequence of
(display ...) forms on a single physical line).


> or like this, if you want more complex expressions:
>
>     begin
>         display
>             concat "Welcome, " player
>                  . ", to Chicago!"
>         newline
>
>
> This uses more vertical space - and I don’t mind (so it is a design
> choice not to try very hard to minimize vertical space).
>
>
> For the single gigantic top-level datum, you just indent the rest (as in
> class definitions in Python):
>
> library : example
>     import : scheme base
>     export .
>         example-init example-open example-close
>     begin
>         define : example-init
>             whatever ...
>             ...
>
>         define : example-open x
>             whatever ...
>             ...
>
>         define : example-close y
>             whatever ...
>             ...
>
>
In Scheme, usually you just put a bunch of definitions (unindented) in a
file, then load them in your favorite Scheme system.  After you've hacked
on the definitions on the file a bit, *then* you put the module
annotations.  This is largely the rationale for (include ...) in R7RS
(define-library ...) forms: the expected Scheme workflow is to start with a
bunch of top-level, non-module definitions, hack on them until they work,
then put them in a module.  Hence, support for a bunch of unindented
definitions inside a module would be nice.

This is largely due to history: Scheme did not have cross-system standard
modules.  Most coders will have two or so Scheme systems they work in, and
they might want to hack on their code first on one, then on the other(s).
A flat file of definitions would usually work portably across Scheme
systems.  So Schemers generally have the habit of putting module
annotations as the last step just prior to publishing their code.  Those
interested in cross-Scheme compatibility for their published code might
very well keep the definitions unindented - some Schemes require modules to
be a single large datum (MzScheme, R6RS, R7RS) others require module
annotations as a separate datum(s) before definitions (Guile), and a
Schemer maintaining a cross-platform library might get bug reports from
different segments of their users - including patches.  By keeping their
published code unindented, such a maintainer could apply the same patch,
from say a primarily-Guile user, to both the official Guile and MzScheme
code.


> I’m used to pythen, and to me this looks completely natural. Compare:
>
> class example:
>     def __init__():
>         import base
>         print base.stuff
>         def localfunc():
>             whatever …
>             …
>
> Best wishes,
> Arne
>
> At Mon, 01 Apr 2013 23:53:57 +0200,
> Arne Babenhauserheide wrote:
> >
> > [1  <multipart/signed (quoted-printable)>]
> > [1.1  <text/plain; utf-8 (quoted-printable)>]
> > Am Donnerstag, 28. März 2013, 18:31:04 schrieb David A. Wheeler:
> > > Arne Babenhauserheide:
> > > > I finally managed to get the simple indentation to lisp preprocessor
> into a working state and thought you might be interested.
> > >
> > > Absolutely!!
> >
> > Glad to hear that! :)
> >
> > > ...
> > > > But at least I managed to write a real release text with an
> explanation of the syntax and code-examples:
> > > > http://draketo.de/light/english/wisp-lisp-indentation-preprocessor
> > >
> > > Thanks! I just added that URL link to the SRFI Alan and I are
> developing.  That way, anyone who might be interested can jump straight to
> your stuff.
> >
> > Cool - thanks!
> >
> > > > PS: @David: I just realized that I had missed quite a few of your
> answers because they were sent only to the list while Alans answers were
> also addressed to me… sorry for that.
> > >
> > > Sigh, I specifically do that so people won't get doubled emails all
> the time; some people complain when I send them both ways.  I just can't
> win :-).
> >
> > :)
> >
> > At least I found your messages after some time :)
> > (I know that my workflow can cause me to miss some messages so I *try*
> to check the ignored messages from time to time to see if any new ones are
> still relevant)
> >
> > Best wishes,
> > Arne
> > --
> > Unpolitisch sein
> > heißt politisch sein,
> > ohne es zu merken.
> > - Arne (http://draketo.de)
> >
> >
> > [1.2 This is a digitally signed message part. <application/pgp-signature
> (7bit)>]
> >
> > [2  <text/plain; us-ascii (7bit)>]
> >
> ------------------------------------------------------------------------------
> > Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> > Rise to greatness in Intel's independent game demo contest.
> > Compete for recognition, cash, and the chance to get your game
> > on Steam. $5K grand prize plus 10 genre and skill prizes.
> > Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> > [3  <text/plain; us-ascii (7bit)>]
> > _______________________________________________
> > Readable-discuss mailing list
> > Readable-discuss@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/readable-discuss
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Readable-discuss mailing list
> Readable-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/readable-discuss
>
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to