objections, I plan to modify sugar, etc., to recognize these
extensions. That will make "load" more compatible with existing files, which
should make it easier to
convince people to use them.
--- David A. Wheeler
uot; is not trivially done with
readtables (you can do it, but you end up doing lots of other things to get
there).
--- David A. Wheeler
-
This SF.net email is sponsored by: Microsoft
Defy all challenges.
h syntax compared to most. Python _does_ have a
"step" function, and you could permit:
a[x y step] - access to x...y with step 'step'.
You could also permit >1 dimension, putting each in a list:
a[(x) (y)] - access to 2D array, element (x y)
a[(x1 y1) (x2 y2)] - access to
=> (1 group)
Three-element, multi-line or one-line:
group group
1
2
=> (group 1 2)
group group 1 2
=> (group 1 2)
+ group 1
=> (+ group 1)
+
group
1
=> (+ group 1)
+ 1 group
=> (+ 1 group)
> The spec is wrong, but your patch is wrong too - you should not remove
>multiple group from an expression, only the first one.
Okay, I understand your goal for "group" better now. That makes sense... but
in that case,
what _should_ the spec say?
--- David A. Wheeler
---
sion language: We should be able to represent EVERY
possible s-expression, with no exceptions. If we can, then it's easier to
argue that they are acceptable substitute.
--- David A. Wheeler
-
This SF.net emai
, without installing
any software other than a web browser, you can look at it here:
http://svn.sourceforge.net/viewcvs.cgi/readable/
More info about the idea behind this approach is at:
http://www.dwheeler.com/readable
(old home)
--- David A. Wheeler
On Oct 1, 2006, Pablo Barenbaum (foones, at gmail dot, com) sent me
an email describing the following approach for a readable s-expression format,
and I thought others should be able to see it too.
Hi,
I've been reading your thoughts on s-expressions.
, there's
no reason EVERYONE has to roll their own incompatible language
to hide s-expressions. A common format that could be used
by many, as-is, would be a big help.
--- David A. Wheeler
ons are, so their role is different.
In that different role, precedence causes problems that don't
show up in most other uses.
It think not supporting precedence turns
out to be much better for this different role.
--- David A. Wheeler
and ideally doesn't store internal
state of whitespace alrady read.
That means that recording the indentation of the initial block should be
avoided, if it's reasonable to do so... otherwise we have to record
that information.
In short, striving for backwards-compatibility, ease-of-use at the
command line, ease-of-use for programming, readability, and
full list processing without special-casing a lot of syntax involves
tradeoffs... my goal is to find the "best" trade.
--- David A. Wheeler
inter is harder.
Having a "show the s-expression" button would be TRIVIAL to do in most editors,
I like that idea very much.
Oh, there _IS_ a potential problem with Barenbaum's idea about colons: Colons
(esp. colon prefixes) have special meaning in lots of Lisps. I'd rather not
require extra characters for common cases when they aren't needed; I think JUST
indenting is enough to give meaning. But I don't want to cut off any ideas; I
think discussing/trying out "crazy" ideas is necessary to get to a good
solution of this problem.
--- David A. Wheeler
n * factorial(n - 1)
substring("Hello" {1 + 1} string-length("Hello"))
define move-n-turn(angle)
tortoise-move(100)
tortoise-turn(angle)
if {0 <= 5 <= 10}
display("True\n")
display("Uh oh\n")
define int-products(x y)
if {x = y}
ven to those who don't use Lisp
day-in/day-out... because OTHER people have to read my code, not just me :-).
f(x) as a function-call is so standardized that I can't find examples of
anything other than f(g(x)) or f g x. Well, except Lisp :-).
--- David A. Wheeler
Dave Herman (dherman who is at ccs dot neu dot edu) sent me a very insightful
email. With his permission, I'm reposting it to the list, as I received it.
It notes an error I made in discussing "and" and "or" in Scheme.
- Start Forwarded Message -
I am a fan of your work on "sweet-expre
s that LISP's most important power,
> >>> macros, is possible only because of the sheer number of parens in the
> >>> s-expr syntax (I would contend this, though).
I agree with you (i.e., I'd contend it). This claim by others is best refuted
by example, and look, there's one above!
--- David A. Wheeler
n sortof solve this by having new parameters, ones that
no one will use correctly, so it won't REALLY solve the problem.
I think the "New Jersey" school has a point; if it's hard to implement, that
may be a very good indicator that you're solving the wrong problem. Which is
why I'm a big believer in BOTH group discussions AND implementation; you learn
from both.
I don't think there's a fundamental problem with having a file-level setting;
many languages have such notions. But given how all Lisp systems expect solely
a list as its return (this dates from the 1950s), something so basic is hard to
change in this context.
--- David A. Wheeler
ehow keep s-expr syntax while supporting m-expr syntax, he hopes to
> > > attract both oldtimers who are madly in love with s-exprs, and
> > > newcomers who can't figure out all those parens.
> > > As far as I can tell, swt-expr is an attempt to get m-expr syntax
> > > wh
a problem.
Yeah, I know about exclusive-or, but it's rare and there's less consensus on
its name. So adding it also doesn't seem worthwhile.
I don't know of any other infix operators that are ALSO special forms (other
than "and" and "or"). Anyone?
--- David A. Wheeler
be instead of
bracketaccess. (You could then define a macro for "bracketaccess"). One
positive: I get NO hits for "bracketaccess" that are Lisp-related, so this is
possibly a relatively safe word to use.
--- David A. Wheeler
d" expressions won't be detected by the
sweet-expression reader - instead, they'll be passed through to an infix macro
processor (which might not be used!). However, "bad" expressions are ALREADY
undetected by Lisp processors (Lisp doesn't do that kind of checking normally),
so this is nothing new :-).
--- David A. Wheeler
. Sweet-expressions already convert
a(b) to (a b), so I don't see the point of doing the same thing with a[b]. Of
course, f[1 2 3] isn't TOO bad as a notation for function calls, so if the idea
was to reserve (...) SOLELY for their traditional s-expression purpose, and use
f[1 2 3] for calls, THEN they make sense. Arc has more freedom to manipulate
syntax than I do, since my goal is to create something that can work with
EXISTING systems.
--- David A. Wheeler
x, I think. So it'd
become:
{n * factorial({n - 1})}
But it's hard to argue that this is better than:
n * factorial(n - 1)
Constantly having to specially mark what should be the default seems (to me) to
be a sign of a bad user interface. "Normal case" should be the default. And I
think that infix IS the default for the world at large. Having to mark infix
operators if they're alphabetic doesn't bother me, because the typical infix
operators ARE punctuation anyway.
--- David A. Wheeler
fix, and then require special syntax to DISABLE infix.
This requires some technique for detecting them (which is what I used the
patterns for).
Though I think "n * f(n -1)" is prettier, but that may be an extreme case. I'm
certainly willing to forgo that if other advantages are more compelling.
Comments welcome.
--- David A. Wheeler
The last one is odd; as a short example it never shows f(...), which I would
expect to be the COMMON case in most code.
Again, I think that a lot of basics should be done by the READER, since that
way all macros just "automatically work".
--- David A. Wheeler
When comparing various syntax options, I find it helpful to try out various
code fragments to see if they "make sense". So here are two other examples
I've worked out. I did this by hand, so there may be an error or two, but the
point is to look at it, to see if the results are comprehensible.
(This is from Alan Manuel Gloria, presumably it was meant to go to the list
instead of just me.)
On Dec 4, 2007 3:50 AM, David A. Wheeler <[EMAIL PROTECTED]> wrote:
> Although I didn't like distinguishing f(...) and f{...}, re-looking at the
> factorial example is starting conv
ikely to be a problem.
And exceptions make reasoning hard... so I don't think I should create that
special exception. NOT creating the exception will make it easier to code, and
to understand. This would mean that:
(a)(b) => ((a) b)
IE, call a to find out what function to call, then call it with parameter b.
--- David A. Wheeler
Based on the comments in this group, I've posted a draft for
the rules in sweet-expressions 0.2:
http://www.dwheeler.com/readable/version02.html
The big question: infix default, infix NOT default, or both?
I thought it'd be easier to answer that by looking at the alternatives.
-
imple "infix non-default" ("must mark infix with {}") rules
instead, and even accepting f{...} as a synonym for f({...}). I didn't like
this approach much at first, but the experiments so far suggest that it's
actually a very reasonable way to go.
--- David A. Wheeler
e that you have to disable indentation to use infix operators as infix
operators. This doesn't seem to be a problem in practice.
Shockingly, I've switched to infix as NOT the default, because in
experimentation I found that it didn't have the positive effects I expected.
Simply adding a way to mark infix lists using {...}, and a prefix f{...},
manages to do quite a lot. See my examples for more.
--- David A. Wheeler
will have to go away. But
I think that's better left for a separate thread of emails - the problem is
subtle. I'd really like the guy who developed I-expressions to be involved, if
I can get him.
--- David A. Wheeler
ined experience with them. I can't
imagine anyone better-qualified than Egil to help us understand some things,
and if there's an issue, how to fix them.
--- David A. Wheeler
t; produces (a b q), instead of the
expected (a b) followed later by q.
* Sample implementation has various other bugs.
I've fixed the following bugs in the sample implementation:
; * 2007-10-15 David A. Wheeler
; - Changed "t" to "#t" (t is Common Lisp, #t is Schem
And by peeking, you can leave behind
the whitespace to continue this interpretation the next time read is called
(which is nifty).
--- David A. Wheeler
uld become (nfx x = 5 * 3) and eventually
the ASSIGNMENT (setf x (* 5 3)).
Alan Manuel K. Gloria: What do you think about using "<-" instead of "="
everywhere for assignment? It's confusing that "=" doesn't map to "=".
You can get it, and
ow is the current README, so you can see what's in there right now.
--- David A. Wheeler
===
This directory contains code to implement improvements in
the readability of Lisp-like (s-expression-based) programming languages,
including Common Lisp, Sch
-expression" reader implemented, the latter could then be installed... and
BOTH would work.
But for that to work, the I-expression reader needs to skip initial blank
lines, and handle comments correctly. In particular, I think the I-expression
implementation HAS to implement comment-skipping itself... by calling on the
underlying reader it's losing the information it needs.
--- David A. Wheeler
ns - and then
handling off to a macro for more complex cases - is the better approach. I
wrote the Common Lisp implementation of curly braces in little time, and I
believe it's rock-solid. After all, it's quite simple! Being _certain_ that
you know what the code will do has its own advantages. :-)
--- David A. Wheeler
put of a lexer, or on the
> output of the regular reader macros?
Sure, it depends.
Again, many just call "read", so if you override "read", you're going to use a
completely different reader.
--- David A. Wheeler
as:
fact
5
and not as (fact 5).
This is risky; on printouts, it might not at ALL be obvious when
expressions are indented like this - resulting in hard-to-debug code
and hidden defects.
In general, I think it's much wiser to reject text that might
be very easily misinterpreted by the reader. So I suggest #2.
--- David A. Wheeler
_syntax_ for this would be easy, e.g., rules like:
; head -> s-expr hspace+ "." hspace+ s-expr
; However, it'd be hard to IMPLEMENT, because "." is a leading character
; for many different circumstances (.9, ..., etc.), yet calling the
; underlying reader might not be effective. E.G., clisp's "read" will
; fail if given a solo ".". Since you can use s-expressions or cons
; to construct these, there doesn't seem to be a compelling need for such
; a special syntax in I-expressions, anyway... especially given
; their implementation headaches.
--- David A. Wheeler
EOUS for interactive use. It'd mean
that you would have to enter your NEXT command before reading (and execution)
of the previous command, making it CERTAIN that your output will be
out-of-sync. And I think it'd be a VERY bad idea for the syntax to vary
between interactive and non-interactive use... it's confusing, and makes
debugging rough.
--- David A. Wheeler
ect that there are several other macros that, if
defined, would make I-expressions even nicer to work with.
A better name than "let1" would be great.
--- David A. Wheeler
AN use ";" to do that... and now you don't HAVE to follow
the indentation rules for them.
I think you'd STILL want to follow the indentation with your comments - I think
it's cleaner, and it means that editors are more likely to indent correctly.
But let's discuss alternatives, it's the only way I know to find good solutions.
--- David A. Wheeler
s consistent with much practice (Scheme
R6RS even enshrines this).
* Prefixing of (), [], and {} should ONLY be acceptable if the prefix is a
symbol or list; otherwise, ignore it. It's exceedingly unlikely that someone
who wrote 9(i) meant (9 i).
Thoughts? Comments?
--- David A. Wheeler
n of group.
If your implementation supports other escape mechanisms, like |group| or
\group, that would also work. The appeal of (. group) is that it doesn't "use
up" any other characters; an interpreter can choose to use | as an ordinary
character, or yet something else, as it desires.
--- David A. Wheeler
instead. Can anyone confirm/deny
this? Egil, you're the expert, I'd love to hear from you especially.
BTW, I'm really _not_ beating up on Egil Möller. This stuff is surprisingly
hard to get right.
--- David A. Wheeler
g whitespace, and having multiple archival copies seems like a
good idea idea anyway. I'll send an announcement when that's set up.
--- David A. Wheeler
for trying the ideas out -- experiment before
committing to it.
--- David A. Wheeler
capabilities - because they're useful. It may be useful to modify the spec to
follow the code a little more closely, too; it's tricky to show if the code
matches the spec or not, because they're so far apart.
Thoughts, comments?
--- David A. Wheeler
tespace, and after
"group"
always press return and indent. This at least lets me test out the rest. But
before
"real use", these issues need to be fully spec'ed, and 100% correctly
implemented.
NOBODY is going to use a notation for programming unless they're VERY confident
that their code will be correctly interpreted.
--- David A. Wheeler
are THAT
much, but I prefer to reserve punctuation-only names to names that I intend to
use as infix operations, and since I don't intend to use it that way, I prefer
"let1".
> - Using {} and [] might require changes in programming environments like
> slime.
Sure. Adding indentation-as-syntax will almost certainly require such changes
in any case.
A lot of systems seem to be happy with {...} and [...] though. [...] is
actually part of Scheme R6RS, and since it's easy in Common Lisp to commandeer
{...}, they're often used that way.
--- David A. Wheeler
ns, articles will be easier to read on gmane.
Besides, having an archive in multiples places is a good idea anyway.
gmane does NOT have any of the articles before today. I intend to eventually
send them the old messages, but that'll be a while.
--- David A. Wheeler
Welcome, folks! I hope that there will be lots of discussion and eventually
some great tools to make Lisp-based languages easier to work with.
Lots of related information is at:
http://www.dwheeler.com/readable
--- David A. Wheeler
e. Heck, you could stipulate that a list is always
> passed, even if it's singular, and obtain a nice analogy between list
> construction using [] and indexing using [].
Can you clarify what you mean here? I know Python, but I'm not sure what you
mean
by this comment.
--- David A.
ere:
https://lists.sourceforge.net/lists/listinfo/readable-discuss
Unfortunately, SourceForge's display system munges the messages
(e.g., indentation is lost), so at this time it's not a recommended way to
view past messages.
--- David A. Wheeler
-
surprises.
Anyone interested in trying to implement at "bracketaccess" macro to actually
try out some options? In the end, only experimentation can determine if that
makes sense, or if it doesn't.
--- David A. Wheeler
---
use "a[x][y]" in sweet-expressions maps to:
(bracketaccess (bracketaccess a x) y)
and so on.
That said, the "reach in" is only when you see "bracketaccess", and only when
there's a nested "bracketaccess"; this is a highly limited case, and may be
okay.
ion this actually works
surprisingly well; the loss of precedence is not really a big deal in a vast
number
of circumstances.
I'm actually really happy with the latest version of sweet-expressions; I think
it is extraordinarily general, and experiments seem to suggest it
ty good case to be made for + and - being left-to-right
associative,
and for * and / being left-to-right associative with higher precedence than
binary + and -. I know of NO significantly-used notation that violates that.
After that, it seems to be "whatev
same thing in sweet-expressions, which makes me think that
sweet-expressions and Arc _should_ work well together:
def mylen (xs)
if no(xs)
0
{1 + mylen(cdr(xs))}
mac n-of (n expr)
w/uniq ga
` let ,ga nil
repeat ,n p
tion at read-time, I
do the transformation BEFORE any macros run.
--- David A. Wheeler
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.a
ahoo store,
and has suggested it in the past. So he should be willing to consider it,
at least.
--- David A. Wheeler
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http:
combined with others in certain ways... so you need to
detect that too. All of which doesn't work if you can no longer guarantee that
the first parameter is the operator.
--- David A. Wheeler
-
This SF.net email is spon
iexpr.
That's great!! I'll sit down and look at what
you've done soon. Have you given this much testing yet?
--- David A. Wheeler
-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies ha
illing to
grant permission under the "MIT license", below?
(http://www.opensource.org/licenses/mit-license.php)
--- David A. Wheeler
Copyright (c) 2008 Niklas Ulvinge
Permission is hereby granted, free of charge, to any person obtaining a
you end up having to re-implement Lisp
parsing "from scratch" to make it work correctly. I seem to recall that
handling backquote in CL was trickier than in Scheme, too.
--- David A. Wheeler
-
This SF.Net email is
ant it to be easily translatable to Common Lisp and ACL2, so I intentionally
avoided some Scheme capabilities.
--- David A. Wheeler
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build
tax actually matters. My goal with Ioke is to get
the same kind of power I get with Lisp and Ruby, but combine it with nice,
small, regular syntax."
--- David A. Wheeler
-
This SF.Net email is sponsored by the Moblin Yo
me. If the below is hard to read, look at the web page:
http://www.dwheeler.com/readable/version02.html
--- David A. Wheeler
=
SUO-KIF
Standard Upper Ontology Knowledge Interchange Format (SUO-KIF) is a language
designed for use
B example is more compelling; many languages
(including Common Lisp!) allow repeated pairs of
"atom_used_as_selector value" that aren't in their own lists, e.g.:
(myfunc :parameter1 value1 :parameter2 value2)
and with this syntax that could become:
which is REALLY unfortunate.
That doesn't even seem to help much:
if
a \
b
xxx yyy zzz
xxx yyy zzz
c \
d
e
xxx yyy zzz
xxx yyy zzz
f
xxx yyy zzz
xxx yyy zzz
g \
h
i
lem. You can't really do that here:
benchmark bignum
:logic \ QF_RDL
:formula
\ and { {x1 - x2} <= {1 / 10} }
{ {x2 - x3} <= {1 / 200011} }
{ {x3 - x4} <= ~({1 / 100000000
is the current version of the text.
--- David A. Wheeler
===
NewLisp
NewLisp is "Lisp-like, general purpose scripting language", with an
implementation released under the GPL.
Original Lisp
Here is a sample from their Code patterns document:
(dolist
's convenient. It's a lot like ";" as a statement
terminator or separator in ALGOL-descended languages
(like C and Pascal). Useful when you have highly related
sets of short statements.
--- David A. Wheeler
-
Thi
leset and redo the experiments.
One challenge is making the rules simple. A computer can handle complex rules,
but humans don't handle complex rules well.
--- David A. Wheeler
-
This SF.Net email is sponsored by the Moblin
ts you show (through formatting) when pairs
of forms are interrelated, yet aren't actually inside a larger list.
As happens in any Lisp that uses ":param-name value", as well as
in formats like Arc's Lisp.
--- David A. Wheeler
--
...) meaning simply
because it's impractical to "add" anything later, but it's not significantly
used.
In any case, indentation processing is disabled inside [...].
--- David A. Wheeler
-
This SF.Net email
Thoughts? Comments?
--- David A. Wheeler
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a t
l, yes, but what I meant was this form:
(f x y).
Sweet-expressions *do*, of course, accept f(x y).
> Having said that, I also think that the spite that the Common Lisp
> community seems to have towards things like sweet-expressions is a bit
> unfounded, for three
is a really compelling argument;
if that's necessary for ASDF, then that's enough of a reason all by itself.
Does anyone want to package it up for ASDF?
--- David A. Wheeler
--
Fulfilling the Lean Software Prom
Here's an interesting idea from Arne Babenhauserheide.
It's a fair point. The only reason that I used "group" was because this made
it compatible with a previous proposal.
Comments?
--- David A. Wheeler
- Start Original Message -
Sent: Mon, 21 May 2012 17:11
for one-space indenting?
Perhaps another symbol would make sense, but that list is small. The obvious
one is "\" on a line by itself.
--- David A. Wheeler
--
Live Security Virtual Conference
Exclusive live event
made a 0.3 sweet-expressions spec including it.
I can be talked either way about the \ splice thing. The goal is to make "easy
things easy", without too many rules. Is the extra "\" rule helpful?
Neutral? More harm than good? I'd lo
t it should mean.
I agree with you. Having this expression yield "(quote (x y))" would make it
very inconsistent with the non-quote case, and I think we should strive for
consistency.
--- David A. Wheeler
--
Live
y 3)) (* x y))".
What should repeated "\" mean at the beginning? I.E., what should this mean?:
\ \ a \ b
I think that after handling the first "\", we should recurse the rule, so
the first two "\" would both be leading "\"s. Thus, this would be the sa
ames.
As long as they're not FORCED they might be useful. What do you think?
(In general, I'm trying to think outside of the box. 99% of the ideas
might be stupid, but if in the journey we find good stuff, then great!)
--- David A. Wheeler
-
nd with this change, so it doesn't count).
I can be convinced either way as well. However, the arguments that:
1. It makes the rule more consistent
2. It makes the parsing easier to implement
is a pretty darn compelling case. Especially since I expect expressions like
"9(x)" to be
dern-expressions, and you can use its
implementation of I-expressions (as I've corrected it) to implement
sweet-expressions.
In general, all the files, etc., are here:
http://sourceforge.net/projects/readable/
Can you compare your implementation to m
> > My proposal is that (outside of modern-expressions) it simply means "the
> > quote symbol".
>
> I think I really meant is that "the ' character, with any kind of
> whitespace after it, simply means 'the symbol named "quote"', and is
> considered as a flat member of the current head". This als
g it pleasant to use interactively
(if not ENTER ENTER, then there needs to be some easy & obvious way to
execute something... and the alternatives I've seen seem awful to me).
>> ... I wonder if we should allow leading periods as an alternative
> to w
portable among Schemes.
--- David A. Wheeler
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Disc
first column, then what?
AMG's new proposal is to DISABLE indentation processing in this case (currently
that does NOT happen). That's a change, but I could easily be convinced of
this. My concern is that it might make silent errors easier.
--- David A. Wheeler
to accept the idea. Then my darn PhD got in the way (!)... but now that is
done. And I am really excited that AMG is looking at using this in a project.
I think it's time to make a push to create a single spec/test cases/strong
implementation that peo
current
SourceForge hosting software, seems like the least disruptive approach. In
particular, we can keep the mailing list. But I think we need to start
tracking tickets, and I'd rather upgrade/merge BEFORE doing that.
--- David A. Wheeler
--
he first time someone enters indented data, while processing
indented data, that should prevent the risk of silently misunderstood code.
By the way, I think we should start focusing on specific points, and change the
subject line so it identifies which point we&
the spec from
> our recent discussions).
An improved spec is certainly useful. And if you can't get them to release the
implementation, perhaps they can agree on releasing test cases. A big set 'o
test cases would hel
which will change the URLs.
--- David A. Wheeler
P.S. I first tried doing the svn-to-git transition using the instructions here:
http://chris.iluo.net/blog/2009/08/28/moving-from-svn-to-git/
except that they don't work; a "git log" returns:
fatal: bad default revision 'HEAD
and share in a wiki. Do you care if the docs be in a wiki? With the
code? Somewhere else?
--- David A. Wheeler
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
1 - 100 of 773 matches
Mail list logo