unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* 1+ is not R5RS
@ 2008-12-18 15:17 Bertalan Fodor (LilyPondTool)
  2008-12-18 21:09 ` Ludovic Courtès
  2008-12-19  6:09 ` Linas Vepstas
  0 siblings, 2 replies; 9+ messages in thread
From: Bertalan Fodor (LilyPondTool) @ 2008-12-18 15:17 UTC (permalink / raw)
  To: guile-user

Hi,

I'm trying to implement a more or less Guile compatible Scheme 
implementation in Java.
However I found that Guile allows 1+ 1- etc. as identifiers. However, 
the R5RS spec does not allow.

Could you provide me some background why 1+ exists, as it is the same as 
(+ 1, and why is it named like this?

Thanks,

Bert





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 1+ is not R5RS
  2008-12-18 15:17 1+ is not R5RS Bertalan Fodor (LilyPondTool)
@ 2008-12-18 21:09 ` Ludovic Courtès
  2008-12-18 22:31   ` Clinton Ebadi
  2008-12-19  9:43   ` Ralf Mattes
  2008-12-19  6:09 ` Linas Vepstas
  1 sibling, 2 replies; 9+ messages in thread
From: Ludovic Courtès @ 2008-12-18 21:09 UTC (permalink / raw)
  To: guile-user

Hello,

"Bertalan Fodor (LilyPondTool)" <lilypondtool@organum.hu> writes:

> I'm trying to implement a more or less Guile compatible Scheme
> implementation in Java.

Can you share some insight as to why you took this route rather than
use/extend either Kawa or Guile?  :-)

> However I found that Guile allows 1+ 1- etc. as identifiers. However,
> the R5RS spec does not allow.

Right.

> Could you provide me some background why 1+ exists, as it is the same
> as (+ 1, and why is it named like this?

It'll be hard to get a definite answer: these procedures have "always"
been there, at least since Jim Blandy became Guile's maintainer:

  commit 0f2d19dd46f83f41177f61d585732b32a866d613
  Author: Jim Blandy <jimb@red-bean.com>
  Date:   Thu Jul 25 22:56:11 1996 +0000

That's a long time ago...

Thanks,
Ludo'.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 1+ is not R5RS
  2008-12-18 21:09 ` Ludovic Courtès
@ 2008-12-18 22:31   ` Clinton Ebadi
  2008-12-19  4:24     ` Keith Wright
  2008-12-19  9:43   ` Ralf Mattes
  1 sibling, 1 reply; 9+ messages in thread
From: Clinton Ebadi @ 2008-12-18 22:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-user

ludo@gnu.org (Ludovic Courtès) writes:
> "Bertalan Fodor (LilyPondTool)" <lilypondtool@organum.hu> writes:
>> Could you provide me some background why 1+ exists, as it is the same
>> as (+ 1, and why is it named like this?
>
> It'll be hard to get a definite answer: these procedures have "always"
> been there, at least since Jim Blandy became Guile's maintainer:
>
>   commit 0f2d19dd46f83f41177f61d585732b32a866d613
>   Author: Jim Blandy <jimb@red-bean.com>
>   Date:   Thu Jul 25 22:56:11 1996 +0000
>
> That's a long time ago...

Probably because Common Lisp has 1+ and 1-.

-- 
Lindsay (Carlton): nighttime baker! sounds a little iffy




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 1+ is not R5RS
  2008-12-18 22:31   ` Clinton Ebadi
@ 2008-12-19  4:24     ` Keith Wright
  0 siblings, 0 replies; 9+ messages in thread
From: Keith Wright @ 2008-12-19  4:24 UTC (permalink / raw)
  To: guile-user; +Cc: clinton, ludo

> From: Clinton Ebadi <clinton@unknownlamer.org>
> Cc: guile-user@gnu.org
> 
> ludo@gnu.org (Ludovic Courtès) writes:
> > "Bertalan Fodor (LilyPondTool)" <lilypondtool@organum.hu> writes:
> >> Could you provide me some background why 1+ exists, as it is the same
> >> as (+ 1, and why is it named like this?
> >
> > It'll be hard to get a definite answer: these procedures have "always"
> > been there, at least since [1996]
> > That's a long time ago...
> 
> Probably because Common Lisp has 1+ and 1-.

I think it was longer ago than that.  Maybe closer to
1969 than 1996.  Some LISP 1.5 programmer got tired of
typing (add1 x) and (sub1 x) to get the successor and
predecessor of x, and noticed that (1+ x), except for
spacing, looks just like infix notation.  Cool.

Remember, at that time the straightforward way to write
it out in full was not (+ 1 x), but (plus x 1).  Use of
function names that are not alphanumeric is a "modern"
innovation.

Unfortunately, predecessor doesn't work out so well.
You can change "+" to "-", and get (1- x) for
predecessor, but read as infix notation that is exactly
backward.  It would work to write (-1+ x), but now it
is as troublesome to type as (sub1 x).  We never liked
infix all that much, so we go with "consistency".

If I had it to do over, I would pick
  (define (++ x) (+ x 1))
  (define (-- x) (- x 1))
but all this happened before C was a gleam in K&R's
eyes, and so that was not obvious back then.

   -- Keith




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 1+ is not R5RS
  2008-12-18 15:17 1+ is not R5RS Bertalan Fodor (LilyPondTool)
  2008-12-18 21:09 ` Ludovic Courtès
@ 2008-12-19  6:09 ` Linas Vepstas
  2008-12-19  7:41   ` Bertalan Fodor
  1 sibling, 1 reply; 9+ messages in thread
From: Linas Vepstas @ 2008-12-19  6:09 UTC (permalink / raw)
  To: Bertalan Fodor (LilyPondTool); +Cc: guile-user

2008/12/18 Bertalan Fodor (LilyPondTool) <lilypondtool@organum.hu>:
> Hi,
>
> I'm trying to implement a more or less Guile compatible Scheme
> implementation in Java.

Well, someone mentioned kawa.
http://www.gnu.org/software/kawa/

There's also jscheme, right?
http://www.norvig.com/jscheme.html

SISC, which I think claims r5rs compliance:
http://sisc-scheme.org/

SIXX -- half-baked, but hey ...
http://dgym.homeunix.net/mediawiki/index.php?title=Sixx

I remember feeling wowed by  the description of 'clojure'
http://clojure.org/

It would make a lot more sense to contribute to an
existing project of this nature, than to invent something
completely new ...

--linas




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 1+ is not R5RS
  2008-12-19  6:09 ` Linas Vepstas
@ 2008-12-19  7:41   ` Bertalan Fodor
  2008-12-19 16:34     ` Linas Vepstas
  0 siblings, 1 reply; 9+ messages in thread
From: Bertalan Fodor @ 2008-12-19  7:41 UTC (permalink / raw)
  To: linasvepstas; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]

Thank you for your suggestion. I was thinking for a long time about 
these, and still I'm not convinced (by myself :-)) to use these 
projects. The little pecularities of these I think would make the effort 
as hard as creating a new one. Sisc's implementation was extremely 
complicated for my simple mind, so I'm using JScheme for some ideas.
Also I wanted to learn by doing - I think this argument in itself is 
enough :-)

Cheers,

Bert

Linas Vepstas írta:
> 2008/12/18 Bertalan Fodor (LilyPondTool) <lilypondtool@organum.hu>:
>   
>> Hi,
>>
>> I'm trying to implement a more or less Guile compatible Scheme
>> implementation in Java.
>>     
>
> Well, someone mentioned kawa.
> http://www.gnu.org/software/kawa/
>
> There's also jscheme, right?
> http://www.norvig.com/jscheme.html
>
> SISC, which I think claims r5rs compliance:
> http://sisc-scheme.org/
>
> SIXX -- half-baked, but hey ...
> http://dgym.homeunix.net/mediawiki/index.php?title=Sixx
>
> I remember feeling wowed by  the description of 'clojure'
> http://clojure.org/
>
> It would make a lot more sense to contribute to an
> existing project of this nature, than to invent something
> completely new ...
>
> --linas
>
>   


[-- Attachment #2: Type: text/html, Size: 2094 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 1+ is not R5RS
  2008-12-18 21:09 ` Ludovic Courtès
  2008-12-18 22:31   ` Clinton Ebadi
@ 2008-12-19  9:43   ` Ralf Mattes
  1 sibling, 0 replies; 9+ messages in thread
From: Ralf Mattes @ 2008-12-19  9:43 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-user

On Thu, 2008-12-18 at 22:09 +0100, Ludovic Courtès wrote:

> It'll be hard to get a definite answer: these procedures have "always"
> been there, at least since Jim Blandy became Guile's maintainer:
> 
>   commit 0f2d19dd46f83f41177f61d585732b32a866d613
>   Author: Jim Blandy <jimb@red-bean.com>
>   Date:   Thu Jul 25 22:56:11 1996 +0000
> 
> That's a long time ago...

This might probably be an attempt to be elisp compatible.

| *** Welcome to IELM ***  Type (describe-mode) for help.
| ELISP> (1+ 12)
| 13
| ELISP> 


HTH Ralf Mattes 

> Thanks,
> Ludo'.
> 
> 





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 1+ is not R5RS
  2008-12-19  7:41   ` Bertalan Fodor
@ 2008-12-19 16:34     ` Linas Vepstas
  0 siblings, 0 replies; 9+ messages in thread
From: Linas Vepstas @ 2008-12-19 16:34 UTC (permalink / raw)
  To: Bertalan Fodor; +Cc: guile-user

2008/12/19 Bertalan Fodor <lilypondtool@organum.hu>:
> Thank you for your suggestion. I was thinking for a long time about these,
> and still I'm not convinced (by myself :-)) to use these projects. The
> little pecularities of these I think would make the effort as hard as
> creating a new one. Sisc's implementation was extremely complicated for my
> simple mind, so I'm using JScheme for some ideas.
> Also I wanted to learn by doing - I think this argument in itself is enough
> :-)

Well, be careful. Your email -- to paraphrase -- sounds like:
"I want to learn how to build a skyscraper, and I am going to
start from scratch, using a hammer, nails and wood."  If you
really want to learn how to build a skyscraper, you go work
on a real one for a while -- where you find out why they use
steel and other such difficult-to-manipulate, "extremely
complicated" techniques which your simple-mind
(hammer-n-nails) has difficulty with.

Its a different kind of learning, less rewarding at first -- it can
take years before you are confident enough to make large
changes to the core design -- but its a better kind of learning
in the long run.

--linas




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 1+ is not R5RS
@ 2008-12-19 19:29 Bertalan Fodor
  0 siblings, 0 replies; 9+ messages in thread
From: Bertalan Fodor @ 2008-12-19 19:29 UTC (permalink / raw)
  To: linasvepstas; +Cc: guile-user

Well that is true. I think now i know how to handle the hammer it's time to look into sisc again. Thanks,
Bert
 ---- Original message ---- 
From: Linas Vepstas <linasvepstas@gmail.com>
Sent: 19 Dec 2008 08:34 -08:00
To: Bertalan Fodor <lilypondtool@organum.hu>
Cc:  <guile-user@gnu.org>
Subject: Re: 1+ is not R5RS






^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-12-19 19:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 15:17 1+ is not R5RS Bertalan Fodor (LilyPondTool)
2008-12-18 21:09 ` Ludovic Courtès
2008-12-18 22:31   ` Clinton Ebadi
2008-12-19  4:24     ` Keith Wright
2008-12-19  9:43   ` Ralf Mattes
2008-12-19  6:09 ` Linas Vepstas
2008-12-19  7:41   ` Bertalan Fodor
2008-12-19 16:34     ` Linas Vepstas
  -- strict thread matches above, loose matches on Subject: below --
2008-12-19 19:29 Bertalan Fodor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).