unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* String syntax changed?
@ 2004-01-19  0:55 Roland Orre
  2004-01-19  3:21 ` Joshua Judson Rosen
  2004-01-19  4:37 ` Paul Jarc
  0 siblings, 2 replies; 12+ messages in thread
From: Roland Orre @ 2004-01-19  0:55 UTC (permalink / raw)


In guile-1.6 and earlier versions, the following
	(begin (display "$\\scriptstyle{P(A\|D)}$") (newline))
gives the intentional string:
	$\scriptstyle{P(A|D)}$

but in 1.7 I get:
ERROR: In procedure scm_lreadr:
ERROR: #<unknown port>:1:38: illegal character in escape sequence: #\|
ABORT: (read-error)
ERROR: Unbound variable: D
ABORT: (unbound-variable)
ERROR: In procedure scm_lreadr:
ERROR: #<unknown port>:1:40: unexpected ")"
ABORT: (read-error)
ERROR: Unbound variable: }$
ABORT: (unbound-variable)

There it seems as \| has a special meaning
and the following gives the intentional string:

(begin (display "$\\scriptstyle{P(A|D)}$") (newline))

I don't understand. Can someone hint me about documentation about this?
Fortunately "|" still works in older versions.

	Roland Orre




_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-01-19  0:55 String syntax changed? Roland Orre
@ 2004-01-19  3:21 ` Joshua Judson Rosen
  2004-01-19 10:24   ` Roland Orre
  2004-01-19  4:37 ` Paul Jarc
  1 sibling, 1 reply; 12+ messages in thread
From: Joshua Judson Rosen @ 2004-01-19  3:21 UTC (permalink / raw)
  Cc: guile-user


[-- Attachment #1.1: Type: text/plain, Size: 395 bytes --]

On Mon, Jan 19, 2004 at 01:55:11AM +0100, Roland Orre wrote:
> In guile-1.6 and earlier versions, the following
> 	(begin (display "$\\scriptstyle{P(A\|D)}$") (newline))
> gives the intentional string:
> 	$\scriptstyle{P(A|D)}$

Why do you have a backslash before the "|"?

-- 
"the question is: are you in the business to write code,
 or to write programs?" --"geekoid" (#135745@/.)

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user

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

* Re: String syntax changed?
  2004-01-19  0:55 String syntax changed? Roland Orre
  2004-01-19  3:21 ` Joshua Judson Rosen
@ 2004-01-19  4:37 ` Paul Jarc
  2004-01-19  5:53   ` Keith Wright
  2004-02-17 21:52   ` Marius Vollmer
  1 sibling, 2 replies; 12+ messages in thread
From: Paul Jarc @ 2004-01-19  4:37 UTC (permalink / raw)
  Cc: guile-user

Roland Orre <orre@nada.kth.se> wrote:
> 	(begin (display "$\\scriptstyle{P(A\|D)}$") (newline))
...
> ERROR: #<unknown port>:1:38: illegal character in escape sequence: #\|
> ABORT: (read-error)

1.7 is more strict than 1.6 about unrecognized escaped characters.

> ERROR: Unbound variable: D
> ABORT: (unbound-variable)

Hm.  With different string contents, this could have done something
dangerous.  I'm not sure what could have been done about it, though.

> I don't understand. Can someone hint me about documentation about this?

I don't think it was ever documented that unnecessary backslashes were
allowed.


paul


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-01-19  4:37 ` Paul Jarc
@ 2004-01-19  5:53   ` Keith Wright
  2004-02-17 21:52   ` Marius Vollmer
  1 sibling, 0 replies; 12+ messages in thread
From: Keith Wright @ 2004-01-19  5:53 UTC (permalink / raw)


> From: prj@po.cwru.edu (Paul Jarc)
> 
> Roland Orre <orre@nada.kth.se> wrote:
> > 	(begin (display "$\\scriptstyle{P(A\|D)}$") (newline))
> ...
> > ERROR: #<unknown port>:1:38: illegal character in escape sequence: #\|
> > ABORT: (read-error)
> 
> 1.7 is more strict than 1.6 about unrecognized escaped characters.
> 
> I don't think it was ever documented that unnecessary backslashes were
> allowed.

...which is good, because if you let people throw extra
backshlashes just anywhere you lose the possibilty of making
extensions.  Maybe someday "\|... will mean something not
yet invented.  For now an error message is the Right Thing.

-- 
     -- Keith Wright  <kwright@free-comp-shop.com>

Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
         ---  Food, Shelter, Source code.  ---


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-01-19  3:21 ` Joshua Judson Rosen
@ 2004-01-19 10:24   ` Roland Orre
  0 siblings, 0 replies; 12+ messages in thread
From: Roland Orre @ 2004-01-19 10:24 UTC (permalink / raw)
  Cc: guile-user

On Mon, 2004-01-19 at 04:21, Joshua Judson Rosen wrote:
> On Mon, Jan 19, 2004 at 01:55:11AM +0100, Roland Orre wrote:
> > In guile-1.6 and earlier versions, the following
> > 	(begin (display "$\\scriptstyle{P(A\|D)}$") (newline))
> > gives the intentional string:
> > 	$\scriptstyle{P(A|D)}$
> 
> Why do you have a backslash before the "|"?

That was a good question. I'm sure it was a reason, but I've
completely forgotten, several years ago...




_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-01-19  4:37 ` Paul Jarc
  2004-01-19  5:53   ` Keith Wright
@ 2004-02-17 21:52   ` Marius Vollmer
  2004-02-17 22:11     ` Paul Jarc
  1 sibling, 1 reply; 12+ messages in thread
From: Marius Vollmer @ 2004-02-17 21:52 UTC (permalink / raw)
  Cc: guile-user

prj@po.cwru.edu (Paul Jarc) writes:

> Roland Orre <orre@nada.kth.se> wrote:
>> 	(begin (display "$\\scriptstyle{P(A\|D)}$") (newline))
> ...
>> ERROR: #<unknown port>:1:38: illegal character in escape sequence: #\|
>> ABORT: (read-error)
>> ERROR: Unbound variable: D
>> ABORT: (unbound-variable)
>
> Hm.  With different string contents, this could have done something
> dangerous.  I'm not sure what could have been done about it, though.

We could gobble up the rest of the string after detecting an error.
Any takers?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-02-17 21:52   ` Marius Vollmer
@ 2004-02-17 22:11     ` Paul Jarc
  2004-02-18 23:38       ` Marius Vollmer
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Jarc @ 2004-02-17 22:11 UTC (permalink / raw)
  Cc: guile-user, Roland Orre

Marius Vollmer <mvo@zagadka.de> wrote:
> prj@po.cwru.edu (Paul Jarc) writes:
>> Roland Orre <orre@nada.kth.se> wrote:
>>> 	(begin (display "$\\scriptstyle{P(A\|D)}$") (newline))
>> ...
>>> ERROR: #<unknown port>:1:38: illegal character in escape sequence: #\|
>>> ABORT: (read-error)
>>> ERROR: Unbound variable: D
>>> ABORT: (unbound-variable)
>>
>> Hm.  With different string contents, this could have done something
>> dangerous.  I'm not sure what could have been done about it, though.
>
> We could gobble up the rest of the string after detecting an error.
> Any takers?

The problem is that after a syntax error, you don't really know where
the end of the string was supposed to be.  And even if you guess right
on that, you're still left in the middle of (begin (display.

Or did you mean the rest of the line?  At least interactively, we
could gobble up and discard all input until select()/poll() says there
is no more, or read in non-blobking mode until EAGAIN.


paul


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-02-17 22:11     ` Paul Jarc
@ 2004-02-18 23:38       ` Marius Vollmer
  2004-02-19  6:21         ` Paul Jarc
  0 siblings, 1 reply; 12+ messages in thread
From: Marius Vollmer @ 2004-02-18 23:38 UTC (permalink / raw)
  Cc: guile-user

prj@po.cwru.edu (Paul Jarc) writes:

> At least interactively, we
> could gobble up and discard all input until select()/poll() says there
> is no more, or read in non-blobking mode until EAGAIN.

Yes, you are right, this would be much better.  Maybe 'drain-input' is
all that is needed?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-02-18 23:38       ` Marius Vollmer
@ 2004-02-19  6:21         ` Paul Jarc
  2004-02-23 19:18           ` Marius Vollmer
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Jarc @ 2004-02-19  6:21 UTC (permalink / raw)
  Cc: guile-user, Roland Orre

Marius Vollmer <mvo@zagadka.de> wrote:
> Maybe 'drain-input' is all that is needed?

That won't be enough.

guile> (drain-input (current-input-port)) ; foo
";"
guile> <unnamed port>: In expression foo:
<unnamed port>: Unbound variable: foo
ABORT: (unbound-variable)

Type "(backtrace)" to get more information or "(debug)" to enter the debugger.

I think we would want to consume data all the way through to the
newline.  (Not because it is a newline, but because that's how much
data has been flushed through the tty driver, and is available to
read() without blocking.)


paul


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-02-19  6:21         ` Paul Jarc
@ 2004-02-23 19:18           ` Marius Vollmer
  2004-02-24 22:19             ` Paul Jarc
  0 siblings, 1 reply; 12+ messages in thread
From: Marius Vollmer @ 2004-02-23 19:18 UTC (permalink / raw)
  Cc: guile-user

prj@po.cwru.edu (Paul Jarc) writes:

> Marius Vollmer <mvo@zagadka.de> wrote:
>> Maybe 'drain-input' is all that is needed?
>
> That won't be enough.
> [...]
> I think we would want to consume data all the way through to the
> newline.  (Not because it is a newline, but because that's how much
> data has been flushed through the tty driver, and is available to
> read() without blocking.)

Yes, maybe that the best we can do... could you try this out?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-02-23 19:18           ` Marius Vollmer
@ 2004-02-24 22:19             ` Paul Jarc
  2004-03-20 23:03               ` Marius Vollmer
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Jarc @ 2004-02-24 22:19 UTC (permalink / raw)
  Cc: guile-user, Roland Orre

Marius Vollmer <mvo@zagadka.de> wrote:
> prj@po.cwru.edu (Paul Jarc) writes:
>> I think we would want to consume data all the way through to the
>> newline.  (Not because it is a newline, but because that's how much
>> data has been flushed through the tty driver, and is available to
>> read() without blocking.)
>
> Yes, maybe that the best we can do... could you try this out?

Well, it looks to me like it would go into boot-9.scm, in
error-catching-loop/error-catching-repl.  To make things tidy,
error-catching-loop could take an extra procedure argument that gets
called in the case of an exception, and error-catching-repl could pass
such a procedure that consumes any available input in the case of
'read-error.  Or, if error-catching-loop isn't used anywhere else, the
consumption could go directly in there.  What do you think?


paul


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

* Re: String syntax changed?
  2004-02-24 22:19             ` Paul Jarc
@ 2004-03-20 23:03               ` Marius Vollmer
  0 siblings, 0 replies; 12+ messages in thread
From: Marius Vollmer @ 2004-03-20 23:03 UTC (permalink / raw)
  Cc: guile-user

prj@po.cwru.edu (Paul Jarc) writes:

> To make things tidy, error-catching-loop could take an extra
> procedure argument that gets called in the case of an exception, and
> error-catching-repl could pass such a procedure that consumes any
> available input in the case of 'read-error.

That sounds good to me.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

end of thread, other threads:[~2004-03-20 23:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-19  0:55 String syntax changed? Roland Orre
2004-01-19  3:21 ` Joshua Judson Rosen
2004-01-19 10:24   ` Roland Orre
2004-01-19  4:37 ` Paul Jarc
2004-01-19  5:53   ` Keith Wright
2004-02-17 21:52   ` Marius Vollmer
2004-02-17 22:11     ` Paul Jarc
2004-02-18 23:38       ` Marius Vollmer
2004-02-19  6:21         ` Paul Jarc
2004-02-23 19:18           ` Marius Vollmer
2004-02-24 22:19             ` Paul Jarc
2004-03-20 23:03               ` Marius Vollmer

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).