Re: [Chicken-users] set! on unbound variable

2016-09-24 Thread Dan Leslie
Particularly since Chicken is in the minority of Schemes that allow this behaviour. I'm not a fan of fast-and-loose binding and typing, personally; it's a source of too many mistakes. -Dan On 2016-09-24 5:14 PM, Derrell Piper wrote: > I agree that it's allowed but it would an optional warning w

Re: [Chicken-users] set! on unbound variable

2016-09-24 Thread Derrell Piper
I agree that it's allowed but it would an optional warning would be very nice. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users

Re: [Chicken-users] set! on unbound variable

2016-09-24 Thread John Cowan
On Sat, Sep 24, 2016 at 11:39 AM, Dan Leslie wrote: > It seems that Chicken has a parameter to enforce R5RS strictness: > > > -r5rs-syntax disables the Chicken extensions to R5RS syntax > All that does is disable the syntax keywords that are normally available but are not part of R5RS, so it's n

Re: [Chicken-users] set! on unbound variable

2016-09-24 Thread Dan Leslie
> 0: https://wiki.call-cc.org/man/4/The%20R5RS%20standard#assignments >> >> -Dan >> >> Sent from my BlackBerry 10 smartphone. >> *From: *Jinsong Liang >> *Sent: *Friday, September 23, 2016 6:27 PM >> *To: *chicken chicken >> *Subject: *[Chicken-users] s

Re: [Chicken-users] set! on unbound variable

2016-09-23 Thread Jinsong Liang
Then I think this seriously deserves a warning, because the code is not only against the standard, but potentially a bug, as shown in my case. Thank you everyone for your help! Jinsong On Fri, Sep 23, 2016 at 9:47 PM, Evan Hanson wrote: > Hi Jinsong, > > Not a bug, but certainly something th

Re: [Chicken-users] set! on unbound variable

2016-09-23 Thread Evan Hanson
Hi Jinsong, Not a bug, but certainly something that can be confusing if you don't expect it. In your example, `helo` is implicitly defined as a toplevel variable at the point of `set!. The difference is noted (very, very succinctly) in the manual here: http://wiki.call-cc.org/man/4/Extensions%

Re: [Chicken-users] set! on unbound variable

2016-09-23 Thread Kon Lovett
t; Sent from my BlackBerry 10 smartphone. > From: Jinsong Liang > Sent: Friday, September 23, 2016 6:27 PM > To: chicken chicken > Subject: [Chicken-users] set! on unbound variable > > Hi, > > I have been tripped by the following mistake a few times: > > (let ((hell

Re: [Chicken-users] set! on unbound variable

2016-09-23 Thread Dan Leslie
martphone.From: Jinsong LiangSent: Friday, September 23, 2016 6:27 PMTo: chicken chickenSubject: [Chicken-users] set! on unbound variableHi,I have been tripped by the following mist

[Chicken-users] set! on unbound variable

2016-09-23 Thread Jinsong Liang
Hi, I have been tripped by the following mistake a few times: (let ((hello 0)) (set! helo 1)) I meant to set! on hello. However, due to a typo, I did set! on helo. This bug is extremely hard to debug to me. Is there a way to make Chicken give warning on this? Or how do you handle this issue?

Re: [Chicken-users] set!

2014-02-28 Thread Pedro Henrique Antunes de Oliveira
In scheme, you can understand a variable as holding a reference to a value. In the first case a holds a reference (call it RA) to a cons pair (the car and cdr of the cons pair also hold references to values - in this case I'm calling RA0 the reference to 1, and RA1 the reference to 2). When you fe

Re: [Chicken-users] set!

2014-02-28 Thread Andy C
Hi, I think I get it now. Thank you, Andy ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users

Re: [Chicken-users] set!

2014-02-27 Thread Jonathan Chan
Hi! I think that the relevant section 3.4 of R5RS might be relevant: 3.4 Storage model Variables and objects such as pairs, vectors, and strings implicitly denote locations or sequences of locations. [snip] An object fetched from a location, by a variable reference or by a procedure such

[Chicken-users] set!

2014-02-27 Thread Andy C
Hi, I am trying to wrap my head around following, from SICPbook: #;1> (define a (cons 1 2)) #;2> (define b (cons a a)) #;3> a (1 . 2) #;4> b ((1 . 2) 1 . 2) #;5> (set-car! (car b) 3) #;6> a (3 . 2) ... changing underlying value affects every

Re: [Chicken-users] set! atomic?

2013-06-12 Thread Alaric Snell-Pym
In the above code, will the primordial thread ever print a list that isn't exactly (1 2 3) or (iota 1e8)? The assignment itself is fully atomic, as is the destructive modification of any single data-cell like pair-cells, vector-elements or record-structure slots. Even so, code that uses someth

Re: [Chicken-users] set! atomic?

2013-06-05 Thread Felix
From: Bryan Vicknair Subject: [Chicken-users] set! atomic? Date: Tue, 4 Jun 2013 19:15:52 -0700 > SRFI-18 states: > > "Read and write operations on the store (such as reading and writing a > variable, an element of a vector or a string) are not required to be atomic. >

Re: [Chicken-users] set! atomic?

2013-06-04 Thread Dan Leslie
Yes, many mutate operations are not srfi-18 threads aware, in my (possibly incorrect) experience. Also, just as an FYI, Chicken's SRFI-18 threads are not system threads, and so cannot avail themselves of additional processors. If "real" parallel operations are your goal then you'll want to loo

[Chicken-users] set! atomic?

2013-06-04 Thread Bryan Vicknair
SRFI-18 states: "Read and write operations on the store (such as reading and writing a variable, an element of a vector or a string) are not required to be atomic. It is an error for a thread to write a location in the store while some other thread reads or writes that same location." Is

Re: [Chicken-users] Set data structure

2009-12-01 Thread John Cowan
Alex Shinn scripsit: > For integer sets there's the iset egg, which is highly > optimized. For other data types you can just use a > hash-table. I had understood that Chicken's hash tables were not competitive for speed unless you have at least 100 keys or so. Is that still true? -- If you ha

Re: [Chicken-users] Set data structure

2009-12-01 Thread Alex Shinn
Lam Luu writes: > Well, that's is set in list, which is horribly slow (O(n) IS very > slow, for most intends and purposes). I guess my question something > like, is there any implementation of set in chicken that is at least > O(log n), aka using binary search tree of some sort? For integer sets

Re: [Chicken-users] Set data structure

2009-12-01 Thread Lam Luu
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Well, that's is set in list, which is horribly slow (O(n) IS very slow, for most intends and purposes). I guess my question something like, is there any implementation of set in chicken that is at least O(log n), aka using binary search tree of some so

Re: [Chicken-users] Set data structure

2009-12-01 Thread Kon Lovett
On Dec 1, 2009, at 6:47 PM, Lam Luu wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello everyone, Currently, I need to have a data structure that implement set (unordered list, in other words). As of know, it seems that there is no egg or anything like that implement this, but I jus

[Chicken-users] Set data structure

2009-12-01 Thread Lam Luu
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello everyone, Currently, I need to have a data structure that implement set (unordered list, in other words). As of know, it seems that there is no egg or anything like that implement this, but I just want to make sure. Do you know of any egg or un

Re: [Chicken-users] set-file-position! only works with fixnums

2009-10-03 Thread Nicholas "Indy" Ray
On Sat, Oct 3, 2009 at 5:21 AM, Andreas Rottmann wrote: > Uhm, GMP is LGPL, so Chicken can use whatever license it likes, even if > it would start to use GMP. > While strictly that is true, It does put some limitations on chicken and built binaries. For instance, the LGPL requires everything to

Re: [Chicken-users] set-file-position! only works with fixnums

2009-10-03 Thread Andreas Rottmann
John Cowan writes: > Thomas Bushnell BSG scripsit: > >> I think this is a mistake, but "fixing" it is harder than it seems. >> >> Really, this is totally non-schemey. >> >> The criterion should be an exact integer, just as it is for arrays. >> Instead of allowing inexact integers to be file p

Re: [Chicken-users] set-file-position! only works with fixnums

2009-10-02 Thread Kon Lovett
Hi folks, Since I do not know the correct DLL for _ftelli64 and _fseeki64 these will not used in posixwin. They are in the MinGW header but not in libmsvcrt (in libmsvcr80/90 but, again, what DLL). Interestingly _lseeki64 is found. Sorry, Kon ___

Re: [Chicken-users] set-file-position! only works with fixnums

2009-10-02 Thread Thomas Bushnell BSG
On Fri, 2009-10-02 at 00:30 -0400, John Cowan wrote: > Kon Lovett scripsit: > > > Possible is adding a int64_t heap type. But involves hitting every > > piece of code that any extension of the core number system would. > > Indeed. If we're going to do that, I'd rather go with core bignums > af

Re: [Chicken-users] set-file-position! only works with fixnums

2009-10-01 Thread John Cowan
Kon Lovett scripsit: > Possible is adding a int64_t heap type. But involves hitting every > piece of code that any extension of the core number system would. Indeed. If we're going to do that, I'd rather go with core bignums after all, perhaps from LibTomMath (which is dedicated to the public

Re: [Chicken-users] set-file-position! only works with fixnums

2009-10-01 Thread Kon Lovett
On Oct 1, 2009, at 12:27 AM, John Cowan wrote: Thomas Bushnell BSG scripsit: I think this is a mistake, but "fixing" it is harder than it seems. Really, this is totally non-schemey. The criterion should be an exact integer, just as it is for arrays. Instead of allowing inexact integers to b

Re: [Chicken-users] set-file-position! only works with fixnums

2009-10-01 Thread John Cowan
Thomas Bushnell BSG scripsit: > I think this is a mistake, but "fixing" it is harder than it seems. > > Really, this is totally non-schemey. > > The criterion should be an exact integer, just as it is for arrays. > Instead of allowing inexact integers to be file positions, how about > extendin

Re: [Chicken-users] set-file-position! only works with fixnums

2009-09-30 Thread Thomas Bushnell BSG
On Wed, 2009-09-30 at 17:32 -0700, Kon Lovett wrote: > On Sep 29, 2009, at 7:55 AM, John Cowan wrote: > > > In the posix unit, you should be able to pass an integral flonum to > > set-file-position! and get one back from file-position so that files > > longer than 2^31 bytes can be handled. > >

Re: [Chicken-users] set-file-position! only works with fixnums

2009-09-30 Thread Kon Lovett
On Sep 29, 2009, at 7:55 AM, John Cowan wrote: In the posix unit, you should be able to pass an integral flonum to set-file-position! and get one back from file-position so that files longer than 2^31 bytes can be handled. Thank you. It will be fixed. -- A witness cannot give evidence of

[Chicken-users] set-file-position! only works with fixnums

2009-09-29 Thread John Cowan
In the posix unit, you should be able to pass an integral flonum to set-file-position! and get one back from file-position so that files longer than 2^31 bytes can be handled. -- A witness cannot give evidence of his John Cowan age unless he can remember being born. co...@ccil

[Chicken-users] Set! question - errata

2007-05-06 Thread William Ramsay
Forgot to answer the question of how colors are actually stored. They are represented as Hex strings (i.e. #b5b5b5). ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users

[Chicken-users] Set! question - long example

2007-05-06 Thread William Ramsay
Graham, This is a long example, but it's my actual code that now does exactly what I want.It's a typical dialog box for choosing preferences in a in a text editor. The colors-set box has a label explaining what it is, a Gtk color button, and another label showing a string in the colors

Re: [Chicken-users] Set! question

2007-05-05 Thread Graham Fawcett
On 5/5/07, William Ramsay <[EMAIL PROTECTED]> wrote: The colors are kept in a vector. What I tried was setting a variable for each color by referencing it's match in the vector. This failed because changing the variable changed the vector.I now use vector-copy!, which seems to work. If I c

Re: [Chicken-users] Set! question

2007-05-05 Thread William Ramsay
Now I'm really confused. Let me describe what I'm trying to do.I have a dialog box of color buttons the user can use in my program (a text editor). The user can change the colors to try them out but can also cancel the changes and go back to the beginning. The colors are kept in a vect

Re: [Chicken-users] Set! question

2007-05-04 Thread Graham Fawcett
On 5/4/07, William Ramsay <[EMAIL PROTECTED]> wrote: I'm suddenly confused on how set! works. Suppose I have two variables, A & B.If A ="Hello" and I call (set! B A), both A and B will equal "Hello". If I call (set! B "Good-bye") I would assume that B now equals "Good-bye" and that A st

[Chicken-users] Set! question

2007-05-04 Thread William Ramsay
Hi, I'm suddenly confused on how set! works. Suppose I have two variables, A & B.If A ="Hello" and I call (set! B A), both A and B will equal "Hello". If I call (set! B "Good-bye") I would assume that B now equals "Good-bye" and that A still equals "Hello", but is this the case? My

Re: [Chicken-users] set-finalizer! and disable-interrupts

2007-03-01 Thread felix winkelmann
On 3/2/07, Hans Bulfone <[EMAIL PROTECTED]> wrote: hi, the documentation of set-finalizer! contains: "Note that the finalizer will not be called when interrupts are disabled." does this mean that when an object with a finalizer happens to be garbage-collected while some code in a unit with dis

[Chicken-users] set-finalizer! and disable-interrupts

2007-03-01 Thread Hans Bulfone
hi, the documentation of set-finalizer! contains: "Note that the finalizer will not be called when interrupts are disabled." does this mean that when an object with a finalizer happens to be garbage-collected while some code in a unit with disabled interrupts is running (a) the finalizer is not

Re: [Chicken-users] set-finalizer! and cons

2006-01-24 Thread felix winkelmann
On 1/24/06, Zbigniew <[EMAIL PROTECTED]> wrote: > For what it's worth, attached is a quick and dirty patch to resize the > pending finalizer buffer upward dynamically. Not being an expert in > Chicken internals, I'm sure there are subtleties I overlooked. > Thanks, I've applied the patch and it s

Re: [Chicken-users] set-finalizer! and cons

2006-01-23 Thread Zbigniew
For what it's worth, attached is a quick and dirty patch to resize the pending finalizer buffer upward dynamically. Not being an expert in Chicken internals, I'm sure there are subtleties I overlooked. Example run: 5600 finalizers, normally takes 27 seconds and 3575 major GCs (at -:f2048), and ju

Re: [Chicken-users] set-finalizer! and cons

2006-01-23 Thread felix winkelmann
On 1/23/06, Zbigniew <[EMAIL PROTECTED]> wrote: > Sorry if I'm being dense---why does it need to release any finalizers > at all, if the pending buffer is totally empty? I thought the size of > the pending buffer was the issue here. > It's me who is dense, I guess - even if the pending buffer is

Re: [Chicken-users] set-finalizer! and cons

2006-01-22 Thread Zbigniew
Sorry if I'm being dense---why does it need to release any finalizers at all, if the pending buffer is totally empty? I thought the size of the pending buffer was the issue here. On 1/23/06, felix winkelmann <[EMAIL PROTECTED]> wrote: > The runtime system doesn't know at that time how many of the

Re: [Chicken-users] set-finalizer! and cons

2006-01-22 Thread felix winkelmann
On 1/21/06, Zbigniew <[EMAIL PROTECTED]> wrote: > I've thought about this some more, and I guess I don't fully > understand it after all. Given a pending-finalizer buffer size of > XXX, using the -:fXXX option, simply having more than XXX live > finalizers forces a major GC every time a new finali

Re: [Chicken-users] set-finalizer! and cons

2006-01-21 Thread Zbigniew
I've thought about this some more, and I guess I don't fully understand it after all. Given a pending-finalizer buffer size of XXX, using the -:fXXX option, simply having more than XXX live finalizers forces a major GC every time a new finalizer is created. None of these finalizers are pending, s

Re: [Chicken-users] set-finalizer! and cons

2006-01-20 Thread Zbigniew
Thanks for the excellent explanation. Increasing the buffer size does work. A dumb mistake is also obvious in retrospect. I had written a fold-right (recursive) function, and even when the incoming "kons" converts NSStrings to scheme strings, a full chain of recursive calls (and objc:instances)

Re: [Chicken-users] set-finalizer! and cons

2006-01-19 Thread felix winkelmann
On 1/18/06, Zbigniew <[EMAIL PROTECTED]> wrote: > I'm in the middle of adding a bunch of stuff to the objc egg, and have > encountered a problem. For the first time, I happened to write some > code which consed together a few thousand Objective C objects > (#) into a list. Suddenly, I took a gig

[Chicken-users] set-finalizer! and cons

2006-01-17 Thread Zbigniew
I'm in the middle of adding a bunch of stuff to the objc egg, and have encountered a problem. For the first time, I happened to write some code which consed together a few thousand Objective C objects (#) into a list. Suddenly, I took a gigantic speed hit using cons, as compared to code which sim