Re: Guile: What's wrong with this?

2012-01-04 Thread David Kastrup
Mike Gran spk...@yahoo.com writes:   In many systems it is desirable for constants (i.e. the values of literal   expressions) to reside in read-only-memory.  To express this, it is   convenient to imagine that every object that denotes locations is   associated with a flag telling whether

Re: Guile: What's wrong with this?

2012-01-04 Thread Mark H Weaver
Bruce Korb bruce.k...@gmail.com writes: 2. it is completely, utterly wrong to mutilate the Guile library into such a contortion that it interprets this: (define y hello) to be a request to create an immutable string anyway. It very, very plainly says, make 'y' and

Continuation sets and order-independency

2012-01-04 Thread David Kastrup
Hi, I was just wondering about the ability for using multiple continuations in contexts that don't guarantee an order of execution. Functions like map, list and other structure builders. If one uses those for building a structure, and some paths of execution hit a

Re: Continuation sets and order-independency

2012-01-04 Thread Noah Lavine
Let me see if I understand what you mean. I think you're talking about an expression like this: (cons (call/cc store-this-continuation) (call/cc store-this-continuation)) and you want a way to distinguish the first and the second call/cc, by guaranteeing the order they are hit. This will let

Re: Continuation sets and order-independency

2012-01-04 Thread David Kastrup
Noah Lavine noah.b.lav...@gmail.com writes: On Wed, Jan 4, 2012 at 8:16 AM, David Kastrup d...@gnu.org wrote: Hi, I was just wondering about the ability for using multiple continuations in contexts that don't guarantee an order of execution.  Functions like map, list and other structure

Re: Guile: What's wrong with this?

2012-01-04 Thread Mike Gran
From: Mark H Weaver m...@netris.org No, `define' does not copy an object, it merely makes a new reference to an existing object.  This is also true in C for that matter, so this is behavior is quite mainstream.  For example, the following program dies with SIGSEGV on most modern systems,

Re: Guile: What's wrong with this?

2012-01-04 Thread David Kastrup
Mike Gran spk...@yahoo.com writes: If you follow that logic, then Guile is left without any shorthand to create and initialize a mutable string other than   (define y (substring hello 0)) or (define y (string-copy hello)) Sure. Guile does not have shorthands for _mutable_ literals for

Re: Guile: What's wrong with this?

2012-01-04 Thread Andy Wingo
On Wed 04 Jan 2012 12:16, Bruce Korb bk...@gnu.org writes: We could add a compiler option to turn string literals into (string-copy FOO). Perhaps that's the thing to do. No, because your clients have no control over how Guile gets built. We _do_ have control over startup code, however: I

Re: Guile: What's wrong with this?

2012-01-04 Thread Bruce Korb
On 01/04/12 08:47, Andy Wingo wrote: I was going to propose a workaround with an option to change vm-i-loader.c:43 and vm-i-loader.c:115 to use a scm_i_mutable_string_literals_p instead of 1, but that really seems like the path to perdition: previously compiled modules would start creating

Re: Guile: What's wrong with this?

2012-01-04 Thread David Kastrup
Bruce Korb bk...@gnu.org writes: On 01/04/12 04:19, Ian Price wrote: ... As for mutable strings, I consider them a mistake to begin with,... Let's step back and consider the whole point of Guile in the first place. My understanding is that one primary purpose is to be a facilitation

Re: Guile: What's wrong with this?

2012-01-04 Thread David Kastrup
Bruce Korb bruce.k...@gmail.com writes: On 01/04/12 08:47, Andy Wingo wrote: I was going to propose a workaround with an option to change vm-i-loader.c:43 and vm-i-loader.c:115 to use a scm_i_mutable_string_literals_p instead of 1, but that really seems like the path to perdition: previously

Re: Guile: What's wrong with this?

2012-01-04 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Wed 04 Jan 2012 12:14, David Kastrup d...@gnu.org writes: Andy Wingo wi...@pobox.com writes: We could add a compiler option to turn string literals into (string-copy FOO). Perhaps that's the thing to do. What for? It would mean that a literal would

Re: A Plan for Hacking

2012-01-04 Thread Andy Wingo
Hi Noah, I never contributed to this thread, but I've had it marked for months now, so FWIW... On Sat 24 Sep 2011 19:58, Noah Lavine noah.b.lav...@gmail.com writes: So this is my proposal for the next several months: I work on a static analyzer for Guile, hoping to expand it to other

Re: Minimal Guile

2012-01-04 Thread Andy Wingo
On Tue 03 Jan 2012 22:44, Mark H Weaver m...@netris.org writes: If this single file is to be built only during the package build process, and never modified after that, then it should be super-easy to invent your own little homebrew format. Indeed. It would be nice to use ELF, though. I'd

Re: Guile: What's wrong with this?

2012-01-04 Thread Mark H Weaver
Andy Wingo wi...@pobox.com writes: David Kastrup d...@gnu.org writes: What for? It would mean that a literal would not be eq? to itself, a nightmare for memoization purposes. I agree that it should not be the default behavior, but I don't see the harm in allowing users to compile their own

Re: Guile: What's wrong with this?

2012-01-04 Thread Bruce Korb
On 01/04/12 11:43, Andy Wingo wrote: The correct behavior is the status quo. We are considering adding a hack to produce different behavior for compatibility purposes. We don't have to worry about correctness in that case, only compatibility. IMO anyway :) It would be a nice added benefit

Re: Guile: What's wrong with this?

2012-01-04 Thread David Kastrup
Bruce Korb bruce.k...@gmail.com writes: On 01/04/12 11:43, Andy Wingo wrote: The correct behavior is the status quo. We are considering adding a hack to produce different behavior for compatibility purposes. We don't have to worry about correctness in that case, only compatibility. IMO

Re: Guile: What's wrong with this?

2012-01-04 Thread David Kastrup
Bruce Korb bruce.k...@gmail.com writes: Who knows where I learned the idiom. I learned the minimal amount of Guile needed for my purposes a dozen years ago. My actual problem stems from this: Backtrace: In ice-9/boot-9.scm: 170: 3 [catch #t #catch-closure 8b75a0 ...] In unknown file:

Re: Chunked Encoding

2012-01-04 Thread Andy Wingo
On Thu 29 Sep 2011 16:09, Ian Price ianpric...@googlemail.com writes: If you've used the (web ...) modules, you may have noticed that guile does not currently support chunked-encoding. This is expected in a HTTP/1.1 world, so I wrote an implementation to cover my immediate need, but I'm not

Re: Guile: What's wrong with this?

2012-01-04 Thread Ian Price
Bruce Korb bk...@gnu.org writes: On 01/04/12 04:19, Ian Price wrote: ... As for mutable strings, I consider them a mistake to begin with,... Let's step back and consider the whole point of Guile in the first place. This was not intended as an answer to this question, nor to be

Re: Guile: What's wrong with this?

2012-01-04 Thread Mark H Weaver
Bruce Korb bk...@gnu.org writes: You have to go to some extra trouble to be certain that a string value that you have assigned to an SCM is not read only. If you're going to mutate a string, you'd better be safe and make a copy before mutating it, unless you know very clearly where it came

Re: Guile: What's wrong with this?

2012-01-04 Thread David Kastrup
Bruce Korb bk...@gnu.org writes: On 01/04/12 13:52, Ian Price wrote: So my main question is: Which is the higher priority, language purity or ease of use? That is a loaded question, as it presupposes ease of use is always the same thing as impurity e.g. ... Absolutely not. Making