[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Comment on SRFI-110 and Comparison to Genyris xyzzy
This page is part of the web mail archives of SRFI 110 from before July 7th, 2015. The new archives for SRFI 110 contain all messages, not just those from before July 7th, 2015.
- To: dwheeler@xxxxxxxxxxxx, srfi-110@xxxxxxxxxxxxxxxxx
- Subject: Comment on SRFI-110 and Comparison to Genyris xyzzy
- From: Bill Birch <birchb1024@xxxxxxxxx>
- Date: Thu, 23 May 2013 00:33:44 +1000
- Delivered-to: srfi-110@xxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=biSm4SfJ4pc44Etx7RO+Pi5Ifh0P091xpc4Va1BbNDY=; b=FSD+zxiv5DPSIARLWvtIgEpoCsyb559Ez0ieZyXDx8DCCJbQRcuExLeSBnQfhVbiy2 yfEo1PT6YV+97CeeLdxq4RZoH/6lP3Cqg5v0B3HliL8/bv/hhnYR4B/9n3nlXChlTX6a vvapfDcKIjfjAxxoF3jzBD3JUQBGhms5HFuRAnR5omLSLaQqp0SrUqK0epIEVzgRIJz3 ARWM7JMWY0bj4lTmcOCY2yHybZW16ajFQcqn7aJauPn0AH+k9tM5e6nDf0CA7SD7koV/ SYDGzSF9WqmY+eeTogobU1Ggowqg80cZs8z/i6fN4/2khKJ5mrUm4PFvYjqdt9ZzFWHK hYGA==
I have made some syntactic decisions which I regard as restricting programmers to write in a better style. For example not allowing lists to wrap encourages more smaller functions. That's OK for source code, however when loading data files one should not restrict the structure. One difficulty with a syntax that defaults to lists is that something special needs to be done for atoms.
Example (a b c (d e f) xx) is problematic since xx is subordinate but is not a list. So in Genyris I was forced to add a leading 'continuation' character ~. Which gives me:
: a b c
: d e f
(a b c (d e f) xx) # PairSource
There is another (obvious) way to wrap lists in Genyris just place
a = at the end of the line. example:
> list 1 2 3 4 5 =
: 6 7 8
(1 2 3 4 5 6 7 8) # Pair
In practice I don't often use line continuation in code.
One thing to remember is that indentation may force you to re-arrange functions to suit the constraints of indentation. For example I had a function 'tag' which took two arguments, an _expression_ and a class. e.g.
tag (+ 2 3) Inches
But when the _expression_ begins to get complex it made more sense to re-order the function to give tag <class> <_expression_> simply so the _expression_ could grow on the subordinate indents. example:
class Person ()
define age 25
def .getAge() age
def .setAge(val) (set ^age val)
So if you use indented syntax expect the language itself to change!