Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-07 Thread Felix
From: Peter Danenberg p...@roxygen.org
Subject: Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 
4.5.0 and 4.6.0
Date: Wed, 6 Oct 2010 19:52:24 -0500

 Quoth Felix on Prickle-Prickle, the 60th of Bureaucracy:
 This change is intentional. `\' is now a (single) escape character.
 The reading of keywords is indeed incomplete, yet.
 
 Ok; is the consensus, then, that I should escape all my backslashes in
 symbols with another backslash from 4.6.0 onwards?
 
 I agree with Peter Bex, though, that R5RS seems to be mum on the
 matter of backslashes in identifiers; according to 7.1.1 [1], in fact,
 these are the only explicitly allowed symbols in addition to letters
 and numbers:
 
 ! $ %  * / :  =  ? ^ _ ~ + - . @
 
 It might have been presumptuous of me to depend on the 4.5.0
 behaviour; but it would be nice, on the other hand, to document the
 change somewhere.
 

See the manual chaprter Non-standard read syntax - Escapes in symbols.


cheers,
felix

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-07 Thread Peter Danenberg
Quoth Felix on Setting Orange, the 61st of Bureaucracy:
 See the manual chaprter Non-standard read syntax - Escapes in
 symbols.

Thanks for adding that, Felix.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-06 Thread Peter Bex
On Tue, Oct 05, 2010 at 06:45:05PM -0500, Peter Danenberg wrote:
 Quoth Peter Danenberg on Pungenday, the 59th of Bureaucracy:
  [C]an we revert to the old behaviour, or can I revert locally by
  using `set-read-syntax!'?
 
 I didn't see any mention of this change to the reader in NEWS; was it
 intentional?

There's been some work done on reading escaped/quoted literals to
improve our SRFI-88 support (see ticket #322).  It looks like the
preliminary changes (the ticket hasn't been closed yet) have
(accidentally?) been integrated:

Chicken 4.5.0:

#;1 '|foo|:
foo
#;2 
Error: unbound variable: :

Chicken 4.6.0:
#;1 '|foo|:
foo:

I think the backslash shouldn't have any special meaning except in
quoted symbols.  AFAIK there's nothing in R5RS to support this, but then
there's nothing in R5RS to support a backslash in symbols at all..
I can't find anything about this in R6RS either.  I hope the WG1 will
straighten this out ;)

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music.
-- Donald Knuth

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-06 Thread Peter Bex
On Wed, Oct 06, 2010 at 09:35:33AM +0200, Peter Bex wrote:
 I think the backslash shouldn't have any special meaning except in
 quoted symbols.  AFAIK there's nothing in R5RS to support this, but then
 there's nothing in R5RS to support a backslash in symbols at all..

On that note, perhaps you shouldn't be using '\ at all since it's not
allowed by the RnRS (maybe Chicken should throw a syntax error)

For something that works in all versions of Chicken, try quoting it:
'|\\|

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music.
-- Donald Knuth

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-06 Thread Felix
From: Peter Bex peter@xs4all.nl
Subject: Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 
4.5.0 and 4.6.0
Date: Wed, 6 Oct 2010 09:35:33 +0200

 On Tue, Oct 05, 2010 at 06:45:05PM -0500, Peter Danenberg wrote:
 Quoth Peter Danenberg on Pungenday, the 59th of Bureaucracy:
  [C]an we revert to the old behaviour, or can I revert locally by
  using `set-read-syntax!'?
 
 I didn't see any mention of this change to the reader in NEWS; was it
 intentional?
 
 There's been some work done on reading escaped/quoted literals to
 improve our SRFI-88 support (see ticket #322).  It looks like the
 preliminary changes (the ticket hasn't been closed yet) have
 (accidentally?) been integrated:
 

This change is intentional. `\' is now a (single) escape character.
The reading of keywords is indeed incomplete, yet.


cheers,
felix

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-06 Thread Felix
From: Peter Danenberg p...@roxygen.org
Subject: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 
and 4.6.0
Date: Tue, 5 Oct 2010 18:17:37 -0500

 In 4.5.0, this sufficed to create a backslash symbol:
 
   '\
 
 whereas in 4.6.0, we need:
 
   '\\
 
 This change screws up a scheme-latex transformer I had written,
 unfortunately; can we revert to the old behaviour, or can I revert
 locally by using `set-read-syntax!'?

You can use the `-no-symbol-escape' command-line option or the
`symbol-escape' parameter.


cheers,
felix

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-06 Thread Peter Danenberg
Quoth Felix on Prickle-Prickle, the 60th of Bureaucracy:
 This change is intentional. `\' is now a (single) escape character.
 The reading of keywords is indeed incomplete, yet.

Ok; is the consensus, then, that I should escape all my backslashes in
symbols with another backslash from 4.6.0 onwards?

I agree with Peter Bex, though, that R5RS seems to be mum on the
matter of backslashes in identifiers; according to 7.1.1 [1], in fact,
these are the only explicitly allowed symbols in addition to letters
and numbers:

! $ %  * / :  =  ? ^ _ ~ + - . @

It might have been presumptuous of me to depend on the 4.5.0
behaviour; but it would be nice, on the other hand, to document the
change somewhere.

Footnotes: 
[1]  
http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-10.html#%_sec_7.1.1


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-05 Thread Peter Danenberg
In 4.5.0, this sufficed to create a backslash symbol:

  '\

whereas in 4.6.0, we need:

  '\\

This change screws up a scheme-latex transformer I had written,
unfortunately; can we revert to the old behaviour, or can I revert
locally by using `set-read-syntax!'?

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0

2010-10-05 Thread Peter Danenberg
Quoth Peter Danenberg on Pungenday, the 59th of Bureaucracy:
 [C]an we revert to the old behaviour, or can I revert locally by
 using `set-read-syntax!'?

Fortunately or unfortunately, this hideous hack suffices to bring back
the 4.5.0 behaviour without permanently modifying the global
read-table:

  (define (call-with-read-syntax char-or-symbol proc thunk)
(let ((old-read-table (copy-read-table (current-read-table
  (dynamic-wind
  (lambda () (void))
  (lambda ()
(set-read-syntax! char-or-symbol proc)
(thunk))
  (lambda () (set! current-read-table
   (lambda () old-read-table))

  ;;; 4.5.0 behaviour: '\ = '\
  (call-with-read-syntax
   #\\
   (lambda (port) '\\)
   (lambda ()
 (with-input-from-string '\\ read)))

  ;;; 4.6.0 behaviour: '\\ = '\
  (with-input-from-string ' read)

I didn't see any mention of this change to the reader in NEWS; was it
intentional?

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users