Re: chicken literary spoofs (was: Re: argument against using '() for null values? ([Chicken-users] DBI))

2008-03-03 Thread Elf

On Mon, 3 Mar 2008, Shawn Rutledge wrote:


On Mon, Mar 3, 2008 at 2:40 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote:

 Fortunately, Chicken Literary and his friends visited the fox, Henry
 Baker, who reminded them that their stacks are GC'd frequently. All
 was well again in Chicken Literary Land!

 But when he added that function-calls never return, Chicken Literary
 and friends lapsed into an existential stupor. And Henry the Fox ate
 them.


You handled the continuation very well, congratulations.  Not a very
happy ending though.  After (eat ...) I suppose the return value is
undefined, isn't it...



nah, its not undefined.  there is no return value, remember?  and the 
continuation is clearly 'eat -> burp -> digest'


-elf


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


Re: chicken literary spoofs (was: Re: argument against using '() for null values? ([Chicken-users] DBI))

2008-03-03 Thread Shawn Rutledge
On Mon, Mar 3, 2008 at 2:40 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote:
>  Fortunately, Chicken Literary and his friends visited the fox, Henry
>  Baker, who reminded them that their stacks are GC'd frequently. All
>  was well again in Chicken Literary Land!
>
>  But when he added that function-calls never return, Chicken Literary
>  and friends lapsed into an existential stupor. And Henry the Fox ate
>  them.

You handled the continuation very well, congratulations.  Not a very
happy ending though.  After (eat ...) I suppose the return value is
undefined, isn't it...


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


Re: chicken literary spoofs (was: Re: argument against using '() for null values? ([Chicken-users] DBI))

2008-03-03 Thread Graham Fawcett
On Mon, Mar 3, 2008 at 4:00 PM, Shawn Rutledge
<[EMAIL PROTECTED]> wrote:
> Chicken Literary is all in a panic that the stacks are falling.

lol!

Fortunately, Chicken Literary and his friends visited the fox, Henry
Baker, who reminded them that their stacks are GC'd frequently. All
was well again in Chicken Literary Land!

But when he added that function-calls never return, Chicken Literary
and friends lapsed into an existential stupor. And Henry the Fox ate
them.

G


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


Re: chicken literary spoofs (was: Re: argument against using '() for null values? ([Chicken-users] DBI))

2008-03-03 Thread Shawn Rutledge
Chicken Literary is all in a panic that the stacks are falling.


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


chicken literary spoofs (was: Re: argument against using '() for null values? ([Chicken-users] DBI))

2008-03-02 Thread Elf

On Sun, 1 Mar 2008, Graham Fawcett wrote:


On Sun, Mar 2, 2008 at 10:21 PM, Elf <[EMAIL PROTECTED]> wrote:


 heh, thats the longest response ive ever gotten to a random selection from
 the tao of programming.  cool :)


Yes. Beautiful work there, John.

Graham

Nice, nice, very nice,
Nice, nice, very nice,
Nice, nice, very nice,
So many different hackers in the same device.

   --  "The Book of Bokonon" for Unix
   (work in progress ;-)



Hehehe...

The Fourteenth Book of Bokonon for Unix, or What Can A Thoughtful Man Hope For
Computing on Earth, Given The Experience Of The Past Nine Decades? -

Almost nothing.


-elf
see the elf?  see the cradle?


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-03-02 Thread Graham Fawcett
On Sun, Mar 2, 2008 at 10:21 PM, Elf <[EMAIL PROTECTED]> wrote:
>
>  heh, thats the longest response ive ever gotten to a random selection from
>  the tao of programming.  cool :)

Yes. Beautiful work there, John.

Graham

Nice, nice, very nice,
Nice, nice, very nice,
Nice, nice, very nice,
So many different hackers in the same device.

--  "The Book of Bokonon" for Unix
(work in progress ;-)


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-03-02 Thread Elf


heh, thats the longest response ive ever gotten to a random selection from
the tao of programming.  cool :)

-elf

On Sun, 2 Mar 2008, John Cowan wrote:


Elf scripsit:


The wise programmer is told about the Tao and follows it.
The average programmer is told about the Tao and searches for it.
The foolish programmer is told about the Tao and laughs at it.


[snip]

Thoughtful hackers hear about Unix
  and try to use it.
Ordinary hackers hear about Unix
  and mess about with it a little.
Thoughtless hackers hear about Unix
  and crack wise about it.
It wouldn't be Unix
  if there weren't wisecracks about it.

So we establish the following rules:

The most brilliant Unix seems the most obscure.
Advanced Unix seems like retrocomputing.
The most powerful code seems like just loops and conditionals.
The clearest code seems to be opaque.
The sharpest tools seem inadequate.
Solid code seems flaky.
Stable code seems to change.

Great methodologies don't have boundaries.
Great talent doesn't code fast.
Great music makes no sound.
The ideal elephant has no shape.
The Unix Way has no name.

Yet for just this reason
  it brings things to perfection.

See more like this at http://ccil.org/~cowan/upc .





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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-03-01 Thread John Cowan
Elf scripsit:

> The wise programmer is told about the Tao and follows it.
> The average programmer is told about the Tao and searches for it.
> The foolish programmer is told about the Tao and laughs at it.

[snip]

Thoughtful hackers hear about Unix
   and try to use it.
Ordinary hackers hear about Unix
   and mess about with it a little.
Thoughtless hackers hear about Unix
   and crack wise about it.
It wouldn't be Unix
   if there weren't wisecracks about it.

So we establish the following rules:

The most brilliant Unix seems the most obscure.
Advanced Unix seems like retrocomputing.
The most powerful code seems like just loops and conditionals.
The clearest code seems to be opaque.
The sharpest tools seem inadequate.
Solid code seems flaky.
Stable code seems to change.

Great methodologies don't have boundaries.
Great talent doesn't code fast.
Great music makes no sound.
The ideal elephant has no shape.
The Unix Way has no name.

Yet for just this reason
   it brings things to perfection.

See more like this at http://ccil.org/~cowan/upc .

-- 
You let them out again, Old Man Willow! John Cowan
What you be a-thinking of?  You should not be waking!   [EMAIL PROTECTED]
Eat earth!  Dig deep!  Drink water!  Go to sleep!
Bombadil is talking.http://ccil.org/~cowan


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-03-01 Thread Elf


Graham

The Tao that can be tested
for equality with the Tao
is not the true Tao.
-- Chuang Tzu (paraphrased)



The wise programmer is told about the Tao and follows it.
The average programmer is told about the Tao and searches for it.
The foolish programmer is told about the Tao and laughs at it.

If it were not for laughter, there would be no Tao.

The highest sounds are the hardest to hear.  Going forward is a way to retreat.
Greater talent shows itself late in life.  Even a perfect program still
has bugs.



-elf


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-28 Thread Graham Fawcett
On Wed, Feb 27, 2008 at 10:53 PM, Ozzi <[EMAIL PROTECTED]> wrote:
>  > How is (sql-null?) harder or less intuitive?
>  It's not harder, but not being able to use null? to test for NULL is
>  counterintuitive in my eyes.

I know what you're saying. I guess I just like to keep my different
types of nulls in different baskets.

>  Count me as on the fence I guess, between null void and sql-null.

Sitting on the fence between null and void sounds like a scary place to be. :-)

Graham

The Tao that can be tested
for equality with the Tao
is not the true Tao.
-- Chuang Tzu (paraphrased)


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-27 Thread Ozzi

Vectors are currently used in the Postgres egg to represent date-time
values. Not saying it's good, but there it is. (BTW, a dbapi needs
consistent date/time support too...)

In Common Lisp, NIL is the same as '(), and both mean "false". In
Scheme we have an explicit #f. For the same reasons we should have an
explicit #. It is important that (sql-null? (sql-null)) is
#t, and (sql-null? anything-else) is #f.


 Since SQL NULL values are common, I really like the simple null? test. It's 
intuitive.


How is (sql-null?) harder or less intuitive?


It's not harder, but not being able to use null? to test for NULL is 
counterintuitive in my eyes.


Count me as on the fence I guess, between null void and sql-null.


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-27 Thread Graham Fawcett
On Wed, Feb 27, 2008 at 8:29 PM, Ozzi <[EMAIL PROTECTED]> wrote:
> > Three that I can think of:
>  >
>  > 1) It would make alist representations ugly:
>  > (query "select foo, NULL as bar, baz from stuff") =>
>  > ((foo . 1) (bar) (baz . "a string"))
>
>  This doesn't bother me.
>
>  > 2) It is not a disjoint type. (list? '()) => #t. That's bad.
>  >
>  > 3) As a special case of (2), some databases have array-type columns.
>  > An empty list may be a valid column value.
>
>  All right, there's the big problem.
>
>  How about keeping '() for sql NULL, and using vectors to represent array-type
>  columns?

Vectors are currently used in the Postgres egg to represent date-time
values. Not saying it's good, but there it is. (BTW, a dbapi needs
consistent date/time support too...)

In Common Lisp, NIL is the same as '(), and both mean "false". In
Scheme we have an explicit #f. For the same reasons we should have an
explicit #. It is important that (sql-null? (sql-null)) is
#t, and (sql-null? anything-else) is #f.

>  Since SQL NULL values are common, I really like the simple null? test. It's 
> intuitive.

How is (sql-null?) harder or less intuitive?

>  On the other hand, I didn't even know array-type columns existed until 
> tonight.
>  I'd prefer to go with something slightly less intuitive for representing 
> them if
>  it will let us use '() for NULL.

...and perhaps we should use '() for #f as well? ;-)

Graham


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-27 Thread Ozzi

Three that I can think of:

1) It would make alist representations ugly:
(query "select foo, NULL as bar, baz from stuff") =>
((foo . 1) (bar) (baz . "a string"))


This doesn't bother me.


2) It is not a disjoint type. (list? '()) => #t. That's bad.

3) As a special case of (2), some databases have array-type columns.
An empty list may be a valid column value.


All right, there's the big problem.

How about keeping '() for sql NULL, and using vectors to represent array-type 
columns?


Since SQL NULL values are common, I really like the simple null? test. It's 
intuitive.


On the other hand, I didn't even know array-type columns existed until tonight. 
I'd prefer to go with something slightly less intuitive for representing them if 
it will let us use '() for NULL.


Thoughts?


Personally, I'm okay with (void), though Vincent's comment about
displaying results is a good one. I think the only logical alternative
to (void) is a # value, similar in implementation to
#: a disjoint type plus a predicate. (Currently that's how
the postgresql egg handles it.)

Graham



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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-27 Thread Vincent Manis

On 2008 Feb 27, at 17:20, Graham Fawcett wrote:


The point is that any Scheme that can define records can define
(void), so there's nothing non-standard about it.



Indeed, just as there's nothing non-standard about creating a new
sql-null-object type. I would argue that most people would think
of void as meaning not `unspecified' but `no value'. So a list
whose car is not a value seems like an odd thing. So I am now
officially endorsing the sql-null-object type as my choice.

-- v


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-27 Thread Graham Fawcett
On Wed, Feb 27, 2008 at 6:33 PM, Jeremy Sydik <[EMAIL PROTECTED]> wrote:
> Thinking more about it, I'm leaning MORE toward '() than before.  I
>  also like relying
>  on a representation that's "standard" scheme rather than one that's
>  specifically part
>  of Chicken if we have the choice (and we do)

There's nothing particularly non-standard about (void).

(void) returns a value #, whose type is disjoint from all
other types, e.g. ((disjoin list? number? string? symbol? boolean?)
(void)) constantly returns #f. It ain't nothing but void, and that's
an important quality for a value that is supposed to represent the
absence of a value. This is also why '() is a bad idea.

R5RS doesn't guarantee or forbid the creation of disjoint types, but
every practical Scheme depends upon it. For example, for a Scheme to
be able to support SRFI-9, the "record-types SRFI", it must be able to
define disjoint types.

The point is that any Scheme that can define records can define
(void), so there's nothing non-standard about it.

Graham


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-27 Thread Graham Fawcett
On Wed, Feb 27, 2008 at 6:29 PM, Ozzi <[EMAIL PROTECTED]> wrote:
> > I suggest that a row be an a-list, and that null columns be represented
>  > by being non-existent in the a-list.  If you end up preferring a plain
>  > list or a vector, then use (void) instead -- I am trying to get this
>  > standardized as the Chicken representation of SQL's NULL.
>
>  Is there an argument against using '() instead of (void) SQL NULL values?

Three that I can think of:

1) It would make alist representations ugly:
(query "select foo, NULL as bar, baz from stuff") =>
((foo . 1) (bar) (baz . "a string"))

2) It is not a disjoint type. (list? '()) => #t. That's bad.

3) As a special case of (2), some databases have array-type columns.
An empty list may be a valid column value.

Personally, I'm okay with (void), though Vincent's comment about
displaying results is a good one. I think the only logical alternative
to (void) is a # value, similar in implementation to
#: a disjoint type plus a predicate. (Currently that's how
the postgresql egg handles it.)

Graham


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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-27 Thread Jeremy Sydik
Thinking more about it, I'm leaning MORE toward '() than before.  I  
also like relying
on a representation that's "standard" scheme rather than one that's  
specifically part

of Chicken if we have the choice (and we do)

On Feb 27, 2008, at 5:29 PM, Ozzi wrote:

I suggest that a row be an a-list, and that null columns be  
represented
by being non-existent in the a-list.  If you end up preferring a  
plain

list or a vector, then use (void) instead -- I am trying to get this
standardized as the Chicken representation of SQL's NULL.


Is there an argument against using '() instead of (void) SQL NULL  
values?



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




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


Re: argument against using '() for null values? ([Chicken-users] DBI)

2008-02-27 Thread Ozzi

I suggest that a row be an a-list, and that null columns be represented
by being non-existent in the a-list.  If you end up preferring a plain
list or a vector, then use (void) instead -- I am trying to get this
standardized as the Chicken representation of SQL's NULL.


Is there an argument against using '() instead of (void) SQL NULL values?


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