Re: [r6rs-discuss] What is meant by the entire tower of subtypes?

2014-04-22 Thread John Cowan
Michael Sperber scripsit:

 As far as I can see, the paragraph does not say anything about
 non-real numbers.

Not specifically, no.  But presumably they are included in the requirement
to provide a tower; that is, a system that provides only real numbers
(and raises an exception of type implementation-restriction when asked
to compute any non-real number) is not conformant.

 Also, I don't know what you mean by arbitrarily.

For example, would an implementation that can represent only a single
non-real number, such as +i, be technically conformant?

 An implementation is certainly free to restrict the ranges of non-real
 numbers, however.  For example, complex numbers with flonum parts were
 (intended to be) within what the report says.

Is an implementation that has no way to represent an exact non-real
number conformant?

 Could you parenthesize this?  I assume you mean bless having (exact
 (or some exact) but not inexact non-real numbers).

That is what I meant, yes.

 Since R6RS explicitly describes a tower, every inexact real is also a
 complex number, so I think the answer is no.

If an implementation may restrict the range of inexact numbers, it seems
to me that technically it may restrict the range to no inexact numbers
whatsoever.  Is that conformant?  If not, is it technically conformant
to have just one inexact number, say 0.0?

I ask these questions not because I think such hypothetical semi-broken
implementations matter, but to help determine how (if at all) R7RS-large
should tighten the requirements on implementations.  There is currently
consensus to require bignums and ratios, as R6RS does, but no consensus on
what to require about exact and inexact non-real numbers.  In particular,
there are committee members who want to do what R6RS does, but that
requires being able to determine what R6RS actually does require.

-- 
John Cowan  http://www.ccil.org/~cowanco...@ccil.org
They do not preach that their God will rouse them
A little before the nuts work loose.
They do not teach that His Pity allows them
to drop their job when they damn-well choose.
--Rudyard Kipling, The Sons of Martha

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] What is meant by the entire tower of subtypes?

2014-04-22 Thread John Cowan
Michael Sperber scripsit:

 I don't recall the inexact argument.

:-)

 I didn't consciously change anything in R6RS that might make it
 different from R5RS.

Except to require arbitrarily large exact rationals (and a fortiori
integers, though integers are particularly mentioned).

 However, I did try to do something about the whole broken concept of
 inexact numbers:

I read that paper some years back.  I'll re-review it now.

 Albeit, to no avail.

Nothing is ever quite useless, for the stone which the builders rejected
may become the cornerstone.  (Psalm 118 verse 22)

-- 
John Cowan  http://www.ccil.org/~cowanco...@ccil.org
Is not a patron, my Lord [Chesterfield], one who looks with unconcern
on a man struggling for life in the water, and when he has reached ground
encumbers him with help?--Samuel Johnson

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] What is meant by the entire tower of subtypes?

2014-04-21 Thread John Cowan
The R7RS-large committee is trying to sort out what R6RS Section 3.4
means by its first two sentences:

Implementations of Scheme must support number objects for
the entire tower of subtypes given in section 3.1. Moreover,
implementations must support exact integer objects and exact
rational number objects of practically unlimited size and
precision, and to implement certain procedures (listed in 11.7.1)
so they always return exact results when given exact arguments.

Does this mean that implementations may arbitrarily restrict the ranges
of non-real numbers?  All the procedures mentioned in 11.7.1 are closed
over the real numbers (except for division by zero), so they cannot
force the existence of non-real numbers.

3.4 explicitly says Implementations may support only a limited range
of inexact number objects of any type, subject to the requirements of
this section.  That would seem to bless having exact (or some exact)
but not inexact non-real numbers.

Of the implementations that aim at R6RS conformance, all but Guile support
effectively unlimited exact and IEEE-limited inexact complex numbers;
Guile supports only the latter.  By what I understand, people who need
to use complex numbers typically care much more about inexact numbers
than exact ones.  In particular, Fortran, C++, and NumPy support only
the inexact kind.

I'd appreciate authoritative, or even non-authoritative but convincing,
explanations of what R6RS means to imply here.

-- 
John Cowan  http://www.ccil.org/~cowanco...@ccil.org
Statistics don't help a great deal in making important decisions.
Most people have more than the average number of feet, but I'm not about
to start a company selling shoes in threes. --Ross Gardler

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Unclear word in license grant

2013-07-23 Thread John Cowan
Musical Notation scripsit:

 What sentence? You didn't include it in the reply. (Is it free to
 distribute commercially?)

Why are you so eager to commercially distribute something you have
obviously not read?

-- 
Let's face it: software is crap. Feature-laden and bloated, written under
tremendous time-pressure, often by incapable coders, using dangerous
languages and inadequate tools, trying to connect to heaps of broken or
obsolete protocols, implemented equally insufficiently, running on
unpredictable hardware -- we are all more than used to brokenness.
   --Felix Winkelmann

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Unclear word in license grant

2013-07-23 Thread John Cowan
Joe Marshall scripsit:

 Why are you so eager to find an interpretation of the text that
 prohibits the very distribution you claim you want to do?

That I understand.  Given the enormous penalties for copyright violation
(up to $150,000), if there is a restriction that can be read into the
text, and there is someone who stands to benefit (not us, we're too nice,
but possibly our heirs will not be) -- well, nobody wants to go there.
But that doesn't mean a single sentence can be interpreted out of context,
any more than the phrase changing it is not allowed can be clipped
out of the GPL and read to mean that the GPL forbids making changes
to software.

-- 
John Cowanhttp://ccil.org/~cowanco...@ccil.org
[T]here is a Darwinian explanation for the refusal to accept Darwin.
Given the very pessimistic conclusions about moral purpose to which his
theory drives us, and given the importance of a sense of moral purpose
in helping us cope with life, a refusal to believe Darwin's theory may
have important survival value. --Ian Johnston

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Unclear word in license grant

2013-07-23 Thread John Cowan
John David Stone scripsit:

 The lesson for future RnRS authors:  Please use one of the standard
 Creative Commons licenses, such as CC-BY.  Then, when people
 raise questions like this in the future, just point them to the
 lawyer-readable version of the relevant license.  No matter how many
 times they ask, send the same link.  It's a lot less frustrating.

Unfortunately, each report is a derivative of the reports that came
before, and on the usual theory (IMHO false, but IANAL) that all authors
must consent to a change of license, we probably can't do anything.
Some authors are dead, and we know nothing about their successors in
interest, nor is it likely that we could get them to pay attention.
Even the living authors are unlikely to get it together to actually agree.

-- 
John Cowan   http://www.ccil.org/~cowanco...@ccil.org
You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
Clear all so!  `Tis a Jute (Finnegans Wake 16.5)

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Unclear word in license grant

2013-07-23 Thread John Cowan
Perry E. Metzger scripsit:

 My problem with the license is straightforward: if I write a new
 document incorporating parts of the Scheme report, it is now a
 derived work. What license may I put on this derived work? I have no
 idea, because the license of the original work is completely unclear.

As a matter of general law, if you create a derived work under license,
you can put any license on your work that doesn't contradict the 
conditions of the original license on derivative works.  Since there
obviously are no such conditions, you can use any license you want.

IANAL, TINLA, but this is not UPL either

-- 
The Imperials are decadent, 300 pound   John Cowan co...@ccil.org
free-range chickens (except they have   http://www.ccil.org/~cowan
teeth, arms instead of wings, and
dinosaurlike tails).--Elyse Grasso

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Redistributing R6RS

2013-07-18 Thread John Cowan
Musical Notation scripsit:

 Let me ask again: Am I allowed to redistribute and modify the R6RS
 specification documents commercially?

From the Summary at the beginning of R6RS:

# We intend this report to belong to the entire Scheme community, and
# so we grant permission to copy it in whole or in part without fee. In
# particular, we encourage implementors of Scheme to use this report
# as a starting point for manuals and other documentation, modifying it
# as necessary.

In other words, yes.

-- 
Clear?  Huh!  Why a four-year-old child John Cowan
could understand this report.  Run out  co...@ccil.org
and find me a four-year-old child.  I   http://www.ccil.org/~cowan
can't make head or tail out of it.
--Rufus T. Firefly on government reports

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Procedure equivalence: the last debate

2013-06-05 Thread John Cowan
[+r6rs-discuss]

It occurs to me that because of the R6RS procedure equivalence rules,
it's impossible to efficiently implement something like `hashtable-map`
(which lifts a function to the domain of hash tables) while being
strictly conformant.  To do so, one must be able to create a hash
table with the same equality procedure and hash function as a given
hash table.  The `hashtable-copy` function does this, but it also copies
the associations, which is not wanted in this case.

However, in order to create a most-efficient hash table whose equality
predicate is `eq(v)?`, you need to invoke `make-eq(v)-hashtable` rather
than the general `make-hashtable`.  But although it is possible to
retrieve the equality predicate using `hashtable-equivalence-function`,
and although R6RS guarantees that this procedure returns `eq(v)?`
in the relevant cases, you cannot test whether that is what you have!
The following code fragment is not portable:

(let ((equiv? (hashtable-equivalence-function some-hash-table)))
  (cond
((eqv? equiv? eq?)
 (make-hashtable-eq))
((eqv? equiv? eqv?)
 (make-hashtable-eqv))
(else
 (make-hashtable equiv?

Code like this actually appears in the R6RS implementation of SRFI 69 at
https://code.launchpad.net/~scheme-libraries-team/scheme-libraries/srfi,
which suggests that in fact none of the R6RS implementations are making
use of this optimization, at least in this kind of case.

-- 
Only do what only you can do.   John Cowan co...@ccil.org
  --Edsger W. Dijkstra's advice
to a student in search of a thesis

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] Overview of R7RS-small

2012-12-25 Thread John Cowan
I have prepared a small Christmas gift for the Scheme community;
an adaptation of the Overview of Scheme from R6RS to the R7RS-small
language.  This was originally planned as part of the R7RS-small draft,
but nobody felt up to preparing it, and it wasn't clear that it was
appropriate in the R7RS-small context anyway.  So I have prepared it as
a separate paper using the same LaTeX framework.

Despite the impressive list of authors, this is purely an editor's draft,
the editor being me, and it hasn't been reviewed (never mind approved)
by anyone in any way.  So send me any errors you happen to find, along
with recommendations for new chapters to add.

So download it from
http://trac.sacrideo.us/wg/raw-attachment/wiki/WikiStart/overview.pdf.

-- 
When I'm stuck in something boring  John Cowan
where reading would be impossible or(who loves Asimov too)
rude, I often set up math problems for  co...@ccil.org
myself and solve them as a way to pass  http://www.ccil.org/~cowan
the time.  --John Jenkins

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Updated list of latest Scheme releases

2012-12-07 Thread John Cowan
Jim Wise scripsit:

 Chez 8.4 was October 2011, not 2012.

Thanks, fixed.

-- 
Is a chair finely made tragic or comic? Is the  John Cowan
portrait of Mona Lisa good if I desire to see   co...@ccil.org
it? Is the bust of Sir Philip Crampton lyrical, http://ccil.org/~cowan
epical or dramatic?  If a man hacking in fury
at a block of wood make there an image of a cow,
is that image a work of art? If not, why not?   --Stephen Dedalus

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] Updated list of latest Scheme releases

2012-09-28 Thread John Cowan
I have updated http://trac.sacrideo.us/wg/wiki/SchemeImplementationReleases
to contain the dates and version numbers for the latest stable releases
of the 45 Schemes currently in my test suite.  Where there doesn't seem to
be a stable release, I have tried to find the latest release available.

Please post any corrections.  Thanks.

-- 
Newbies always ask: John Cowan
  Elements or attributes?  http://www.ccil.org/~cowan
Which will serve me best?  co...@ccil.org
  Those who know roar like lions;
  Wise hackers smile like tigers.   --a tanka, or extended haiku

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-18 Thread John Cowan
w...@ccs.neu.edu scripsit:

 I misinterpreted your universal polymorphism to mean parametric
 polymorphism, with universal quantification over type parameters.

On investigation, I agree that I misused the term: I posted in haste
and now must repent at leisure.

 It looks as though you were really using that phrase to mean ad hoc
 polymorphism with a domain that includes all objects, as with Java's
 equals(Object), hashCode(), and toString() methods.

Just so.  Universal ad-hoc polymorphism, perhaps.

 Among other things, it's worth noting that Java does not require
 the equals(Object) method to agree with == (which is Java's
 closest equivalent to Scheme's eq?) on function objects such as
 comparators.  

I'm not sure I understand this.  If two objects (not of primitive type)
are ==, they are necessarily also equals(), but of course not vice versa.
The general contract for equals() guarantees the first part, and good
implementation technique is for the first statement of equals(Object that)
in any class to be if (this == that) return true;.

-- 
In my last lifetime,John Cowan
I believed in reincarnation;http://www.ccil.org/~cowan
in this lifetime,   co...@ccil.org
I don't.  --Thiagi

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-18 Thread John Cowan
w...@ccs.neu.edu scripsit:

  I'm not sure I understand this.  If two objects (not of primitive type)
  are ==, they are necessarily also equals(), but of course not vice versa.
  The general contract for equals() guarantees the first part, and good
  implementation technique is for the first statement of equals(Object that)
  in any class to be if (this == that) return true;.
 
 Yes, and that's precisely the guarantee that should have been
 made by the Scheme standards.

I think the comparison is bad, because Java `equals()` is much more like
Scheme `equal?`, only extensible.  There is no real Java equivalent
of `eqv?`, because boxed numbers and characters must be compared with
`equals()`.

 Instead, the R5RS and R6RS went beyond that guarantee by overspecifying:
 Both the R5RS and R6RS insist that eq? and eqv? have the same behavior
 on procedures, i.e.
 
 (eq? proc1 proc2) if and only if (eqv? proc1 proc2).
 
 That overspecification was a mistake.  I hope it will be fixed
 in some future standard for Scheme.

Funny you should say that.  I just added ticket #467 as a late-breaking
item on the current ballot.  Here's the text:

This proposal stems from ​remarks by Alaric Snell-Pym and Will
Clinger on the r6rs public mailing list. If eq? is allowed to
return #f on two procedures when eqv? nevertheless returns #t, as is
already the case for numbers and characters, then more intelligent
implementation-specific procedure comparisons using eqv? are possible,
while still keeping eq? simple enough to inline easily.

-- 
I now introduce Professor Smullyan, John Cowan
who will prove to you that either   co...@ccil.org
he doesn't exist or you don't exist,http://www.ccil.org/~cowan
but you won't know which.   --Melvin Fitting

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-17 Thread John Cowan
w...@ccs.neu.edu scripsit:

 Those who have been claiming this has to do with whether procedures
 are first-class objects are probably unfamiliar with the history of
 that phrase and with its usage in other language communities.  If
 you tried to argue that functions aren't first class in Standard ML,
 for example, SML programmers would think you've lost your marbles,
 but (IIRC) SML doesn't define equality on functions at all.

Different definitions for different contexts.  SML equality has ad-hoc
polymorphism; Scheme `eqv?` has universal polymorphism.  In SML, almost
everything is immutable, and Leibniz's criterion doesn't apply.  In
pre-R6RS Scheme, almost everything is mutable, and Leibniz's criterion
is all we have to work with.

 Unfortunately, both the R5RS and the R6RS require eq? to behave the
 same as eqv? on procedures.  With the semantics you have suggested
 and I have implemented, that cannot be done without making eq? too
 complicated to inline, which defeats the whole purpose of eq?.

Too complicated is meaningful only with respect to a given
implementation.  Plain Chicken, for example, has immediate characters
and fixnum/flonum arithmetic, so `eqv?` is just a pointer test, two type
tests, and a floating-point equality test.

-- 
MEET US AT POINT ORANGE AT MIDNIGHT BRING YOUR DUCK OR PREPARE TO FACE WUGGUMS
John Cowan  co...@ccil.org  http://www.ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-17 Thread John Cowan
w...@ccs.neu.edu scripsit:

  Different definitions for different contexts.  SML equality has ad-hoc
  polymorphism; Scheme `eqv?` has universal polymorphism.
 
 That's news to me.  Which of the Scheme reports/standards do you wish
 to cite as your source?

Any of them will do:  given two values x, y, `(eqv? x y)` answers either
#t or #f.  This is not the case in SML, where values cannot be compared
unless they have the same type, and only certain types can be compared
for equality at all.

 And how do you reconcile your just-so story with the change made long
 ago, when both (eqv? (vector) (vector)) and (eqv? (string) (string))
 were required to return true?

I don't understand the relevance of this question.

  In SML, almost
  everything is immutable, and Leibniz's criterion doesn't apply.
 
 In Scheme, procedures have never been immutable (although they can
 refer to mutable objects), so I guess Leibniz's criterion doesn't
 apply to procedures.

I suppose you mean have never been mutable.  But Leibniz's criterion is
that identical objects are indiscernible rather than that indiscernible
objects are identical, so I ought not to have referred to it.

 
 Will

-- 
John Cowanhttp://www.ccil.org/~cowan co...@ccil.org
if if = then then then = else else else = if;

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-16 Thread John Cowan
Aaron W. Hsu scripsit:
 William D Clinger w...@ccs.neu.edu wrote:
 
  Both the R5RS and R6RS insist that procedures that are eqv?
  behave the same.  Distinct procedures that share the same
  code are unlikely to behave the same.
 
 This is true in general, but I think the assertion was that two 
 procedures that do not need closures to run correctly, can only be 
 observationally different or distinct if they have different code bodies.
 I am not seeing a fault in this reasoning off the top of my head.

That's what I meant, allowing users to reliably get (eqv? eqv? eqv?) = #t.

-- 
Real FORTRAN programmers can program FORTRANJohn Cowan
in any language.  --Ed Post co...@ccil.org

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-16 Thread John Cowan
w...@ccs.neu.edu scripsit:

 With the R5RS semantics, closures (or unique tags, which are almost as
 expensive as closures) will probably have to be allocated for every
 call to f and for every internal call to g.  Since most calls to g
 occur within a tight loop, creating and garbage-collecting those
 closures or unique tags is likely to dominate the running time.
 That's a high price to pay for a theoretically inelegant misfeature
 that's seldom used correctly in portable code.

Well, you've convinced me of everything except the theoretical inelegance.
I still think this optimization demotes procedures to second-class status,
but I can live with second-class procedures.

-- 
John Cowan  http://www.ccil.org/~cowan  co...@ccil.org
After all, would you consider a man without honor wealthy, even if his
Dinar laid end to end would reach from here to the Temple of Toplat?
No, I wouldn't, the beggar replied.  Why is that? the Master asked.
A Dinar doesn't go very far these days, Master.--Kehlog Albran
Besides, the Temple of Toplat is across the street.  The Profit

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-08 Thread John Cowan
Aaron W. Hsu scripsit:

 I strongly suspect, but have no proof, that the cost of having a safe
 write procedure is dwarfed by most other costs, and will not contribute
 significantly to the running time of the vast majority of programs, if
 it contributes significantly to any at all.

[...]

 I think we are past this. We should not concern ourselves with hacks 
 to improve the performance of implementations that do not care about 
 performance. If performance is important, then use one of the already 
 useful and good Scheme implementations out there that produce fast 
 code. If you do not care about speed, feel free to use a naive
 implementation, but do not expect it to be fast. 

You utterly ignore the question of space.  Write/fast-small is not just
write/fast, it's also write/small: it can traverse trees requiring stack
space proportional to the depth of the tree and with no auxiliary space
at all.  Write/safe and write/cycle *cannot* do so.

There is, and I believe always will be, a need for implementations
in space-constrained environments.  If phones are no longer
space-constrained, there are still dust, skin, and clay (see the
Wikipedia article on ubiquitous computing).  For those things, space
beats speed handily, especially when executing embarrassingly parallel
algorithms (which is what the Real World has to do).

 Again, if you care about performance at all, then you should not use 
 an implementation that does not care about performance. It will not scale.

That sounds tautological, but what you are saying is If you care
about speed at all, you should not use an implementation that is not
designed for maximum speed.  That is not only not a tautology, it's
downright false.  Bytecode interpreters will never be *fast*, but they
are faster than tree-walking interpreters, faster enough to make them
well worth writing and using in environments where optimizing compilers
are emphatically the Wrong Thing.

-- 
weirdo:When is R7RS coming out?  John Cowan
Riastradh: As soon as the top is a beautiful co...@ccil.org
   golden brown and if you stick a toothpick
  in it, the toothpick comes out dry.www.ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-07 Thread John Cowan
w...@ccs.neu.edu scripsit:

 Maybe I'm not sufficiently clever, but I don't see how that could work.
 If h is the name of a known local procedure that's referenced only in
 call position, then the compiler shouldn't have to allocate a closure
 *or* a tag for it.  (Allocating unique tags is almost as expensive as
 allocating a closure.)

I'm probably missing something here, but if h doesn't need a closure,
what's wrong with using the code address as a unique tag?

 Consider, for example, the reference implementation for SRFI 69
 (Basic hash tables).  Its implementation of make-hash-table calls
 appropriate-hash-function-for, which uses eq? (not eqv?) tests on
 comparison procedures to try to identify an appropriate hash function.

Well, `eq?` and `eqv?` must return the same result on procedures anyway.

 (*)  Well, almost as well.  The general purpose hash function
 refuses to hash procedures.  That's just a deliberate bug in
 the reference implementation of the default hash function.

And rightly so by R6RS rules, since using an R6RS procedure as a key
in an R6RS hash table can't possibly work reliably.

 On the other hand, the R5RS semantics for eqv? on procedures
 appears to have encouraged the designer of SRFI 69 to make a
 serious mistake in his design.  If you provide a comparison
 procedure but no matching hash function, the implementation is
 supposed to infer an appropriate hash function.  

That's not the way I read SRFI 69:

However, an acceptable default is not guaranteed to be given for any
equivalence predicate coarser than equal?, except for string-ci=?.[1]
The function hash must be acceptable for equal?, so if you use
coarser equivalence than equal? other than string-ci=?, you must
always provide the function hash yourself.

[1] An equivalence predicate c1 is coarser than a equivalence
predicate c2 iff there exist values x and y such that (and (c1 x y)
(not (c2 x y))).

 2.  Most of the correct uses that we found were mere efficiency
 hacks.  Since the efficiency that's lost by supporting the R5RS
 semantics is considerably more important than the efficiency that's
 gained, the efficiency argument goes against the R5RS semantics.

Doubtless that's true for high-speed implementations, but I'm not sure
the argument generalizes to low-speed ones.  A cheap hack that saves
a little bit (like calling the string-specific hash functions when you
know the operands are strings, rather than the general hash function)
is probably even more important to a low-speed implementation.

-- 
John Cowanco...@ccil.orghttp://ccil.org/~cowan
The present impossibility of giving a scientific explanation is no proof
that there is no scientific explanation. The unexplained is not to be
identified with the unexplainable, and the strange and extraordinary
nature of a fact is not a justification for attributing it to powers
above nature.  --The Catholic Encyclopedia, s.v. telepathy (1913)

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-07-07 Thread John Cowan
Aaron W. Hsu scripsit:

 I question the sanity of minor optimizations on deliberately slow code.

It's precisely naive implementations that benefit most from an explicit
fast path through the code that an optimizing system may well be able to
find for itself.  Nowadays, C compilers normally disregard the register
declaration, but in the old days, a judiciously placed register in
the inner loop, or to put a global variable in a register (back when
machines *had* registers) made a hug difference to performance.

-- 
John Cowan  co...@ccil.org   http://ccil.org/~cowan
The exception proves the rule.  Dimbulbs think: Your counterexample proves
my theory.  Latin students think 'Probat' means 'tests': the exception puts
the rule to the proof.  But legal historians know it means Evidence for an
exception is evidence of the existence of a rule in cases not excepted from.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-05-14 Thread John Cowan
Andy Wingo scripsit:

 Isn't it permitted this rewrite either way, given that the other one
 will certainly be inlined, and thus there will only be one copy of the
 procedure?

Oh yes.  The identity of indiscernable procedures has been around a long
time; the issue here is the indiscernibility of identical procedures.

-- 
What has four pairs of pants, lives John Cowan
in Philadelphia, and it never rains http://www.ccil.org/~cowan
but it pours?   co...@ccil.org
--Rufus T. Firefly

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-05-08 Thread John Cowan
One of the changes between R5RS and R6RS is that (eqv? x x), where
x is a variable whose value is a procedure, is allowed to return #f.
The R6RS Rationale, section 11.5.1, says in its entirety:

The definition of eqv? allows implementations latitude in their
treatment of procedures: implementations are free either to detect or
to fail to detect that two procedures are equivalent to each other,
and can decide whether or not to merge representations of equivalent
procedures by using the same pointer or bit pattern to represent
both. Moreover, they can use implementation techniques such as
inlining and beta reduction that duplicate otherwise equivalent
procedures.

The first sentence of the rationale is only partly true: the R6RS
gen-counter example shows that if procedures are not operationally
equivalent, eqv? must treat them as distinct, as was true in R5RS.
The second sentence does not seem to me to constitute a sufficient
explanation for results like this:

(let ((x (lambda (x) (+ x 1 (eqv? x x)) = #f rather than #t
(memv cdr (list car cdr cons)) = #f rather than (cdr cons)

In essence, that freedom makes procedures not really first-class:
they can't be placed into data structures and taken out again reliably.
Furthermore, none of the existing R6RS implementations (Racket, Guile,
Chez, Vicare, Larceny, Ypsilon, Mosh) actually takes advantage of this
freedom, at least at the REPL.

Can someone explain the thinking of the R6RS committee here?
Adv-thanks-ance.

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
The competent programmer is fully aware of the strictly limited size of his own
skull; therefore he approaches the programming task in full humility, and among
other things he avoids clever tricks like the plague.  --Edsger Dijkstra

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Why is (eqv? g g) unspecified when g is a procedure?

2012-05-08 Thread John Cowan
leppie scripsit:

 The closest notion I can see is that, for some reason, the code could
 possibly be transformed into:
 
 (eqv? (lambda (x) (+ x 1)) (lambda (x) (+ x 1)))

What is more, an implementation is free to notice that these two lambdas
are operationally equivalent and return #t!

 which IMO, is a wasted optimization in the case where the procedure is
 not applied.

I think the purpose of it is for systems that inline known procedures:
if you always rewrite (car x) as (%internal-car x), where %internal-car
is not a value, then it may not be worthwhile keeping around an object
to represent car for those cases when it is not being invoked.

If anyone actually exploits this R6RS innovation, I still hope to hear
of it.

-- 
But I am the real Strider, fortunately,   John Cowan
he said, looking down at them with his face co...@ccil.org
softened by a sudden smile.  I am Aragorn son  http://www.ccil.org/~cowan
of Arathorn, and if by life or death I can
save you, I will.  --LotR Book I Chapter 10

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [scheme-reports] Scheme pattern matching R*RS

2011-01-21 Thread John Cowan
David Rush scripsit:

 Given the wide variety of things that get affected by pattern
 matching, while I admit that this is possible, I don't think it is
 advisable. Pattern matching is a powerfully expressive mechanism - if
 we are going to have it we should properly percolate its power all the
 way through the language.

You are making the best the enemy of the good, and saying Because we
won't have deeply integrated pattern matching in R7RS, we shouldn't have
standardized pattern matching available on implementations that choose
to provide it.  The whole idea of WG2 is to provide a large battery
of optional modules, such that if implementations choose to provide a
feature, users can rely on *how* it is provided, and thus write programs
that are portable across sufficiently powerful implementations.

 Are we really willing to go here? I'd be up for it, but I thought that
 the community was shying away from radical changes through
 standardization, and that deep innovation in the Scheme community was
 supposed to be led by implementations.

Quite so, for WG1.  WG2 tracks implementations where they exist,
and attempts to provide them where they don't.  This is a case where
implementations exist; all I've done is relabel them, which in a language
with modules is a fairly trivial thing to do.

-- 
One Word to write them all, John Cowan co...@ccil.org
  One Access to find them,  http://www.ccil.org/~cowan
One Excel to count them all,
  And thus to Windows bind them.--Mike Champion

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] [scheme-reports] Scheme pattern matching R*RS

2011-01-21 Thread John Cowan
Andre van Tonder scripsit:

 Just note, FWIW, that R6RS library semantics have no such thing as
 overriding.  You would need to do a complicated EXCEPT import to
 exclude the usual WG1 meanings.

I've just filed a ticket for this: http://trac.sacrideo.us/wg/ticket/132 .

-- 
Ambassador Trentino: I've said enough. I'm a man of few words.
Rufus T. Firefly: I'm a man of one word: scram!
--Duck Soup John Cowan co...@ccil.org

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] redefining eqv?

2010-12-26 Thread John Cowan
Adrien Pied Piérard scripsit:

 Now that I think about it, I think that I almost never use CASE with
 something else than symbols and numbers.

Characters work too.  CASE can only work well with something that has
a datum syntax and for which EQV? produces the right result.

 And the more I think about it (that, is, not a lot though), the more I
 think that CASE is quite useless, as it could be implemented I guess
 straightforwardly in terms of COND.

The same is true of COND, which can be implemented in terms of IF.  That
is why R5RS separates the descriptions of derived and primitive syntax.

-- 
John Cowan  co...@ccil.org http://www.ccil.org/~cowan
Statistics don't help a great deal in making important decisions.
Most people have more than the average number of feet, but I'm not about
to start a company selling shoes in threes. --Ross Gardler

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] redefining eqv?

2010-12-24 Thread John Cowan
Peter Kourzanov scripsit:

 BTW...Can someone with enough grey hairs remember why we have the horde
 of predicates like =, eq?, equal? and eqv? What I understood is that
 eqv? is sort-of one-size-fits-all idea gone astray

EQV? is object equality, the identity of indiscernibles.  EQ? is an
variant of EQV? that can answer #f on on characters and numbers in exchange
for (hopefully) better performance.

= is type-specific equality on numbers, and corresponds to things like
CHAR=? and STRING=?.

EQUAL? was originally structural equality, but the exact way it works
is historical: it descends into pairs, vectors, and strings, but works
like EQV? on all other types.  Programmers are encouraged to substitute
a different structural-equality predicate if EQUAL? doesn't suit their
needs: it is not primitive.

The proposed EQUAL=? will be like EQUAL, but will employ = rather than
EQV? to compare numbers.

-- 
Híggledy-pìggledy / XML programmersJohn Cowan
Try to escape those / I-eighteen-N woes;http://www.ccil.org/~cowan
Incontrovertibly / What we need more of is  co...@ccil.org
Unicode weenies and / François Yergeaus.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] redefining eqv?

2010-12-24 Thread John Cowan
Peter Kourzanov scripsit:

  Peter, the better way to do the kind of thing you are looking for
  is PARAMETERIZE.  I wouldn't advocate it for CASE, though.
 
 Any pointers? Or is it the PLT/Racket thing?

SRFI 39.

-- 
John Cowan   co...@ccil.org   http://ccil.org/~cowan
I must confess that I have very little notion of what [s. 4 of the British
Trade Marks Act, 1938] is intended to convey, and particularly the sentence
of 253 words, as I make them, which constitutes sub-section 1.  I doubt if
the entire statute book could be successfully searched for a sentence of
equal length which is of more fuliginous obscurity. --MacKinnon LJ, 1940

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] redefining eqv?

2010-12-24 Thread John Cowan
Peter Kourzanov scripsit:

 So, RRS's (fluid) redux (or shall I say Rabbit redux). Its so 
 well-hidden I didn't know it existed. Any plans on going back
 that for R7RS?

It's under WG1 ballot, and I think if it doesn't make WG1, it will
very likely make WG2.  There are several variants available besides the
SRFI itself.

It's easy to implement parameters portably in a non-threaded
system, so the proposals are about how mutation (as
opposed to rebinding, which is per-thread) interacts with
threads.  http://trac.sacrideo.us/wg/wiki/ParametersSnellPym
defines parameters as thread-safe under mutation, whereas
http://trac.sacrideo.us/wg/wiki/ImmutableParametersCowan excludes
mutation.

-- 
If I read upcoming in [the newspaper]  John Cowan
once more, I will be downcoming  http://www.ccil.org/~cowan
and somebody will be outgoing.   co...@ccil.org

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] redefining eqv?

2010-12-24 Thread John Cowan
Peter Kourzanov scripsit:

   Programmers are encouraged to substitute
  a different structural-equality predicate if EQUAL? doesn't suit their
  needs: it is not primitive.
 
 Exactly. And how are they are supposed to branch on the outcome of 
 their brand-new predicate? Redefine their own special (case)?

CASE doesn't use EQUAL?, so it's irrelevant; it uses EQV?, which as
I say is object identity.

  The proposed EQUAL=? will be like EQUAL, but will employ = rather than
  EQV? to compare numbers.
 
 So, the list is growing already...

Yes, and it's really unbounded.  As I say, the existence and properties
of EQUAL? are merely historical.  The least jewel-like thing about
Scheme is its standard library.

-- 
John Cowanco...@ccil.orghttp://ccil.org/~cowan
Sound change operates regularly to produce irregularities;
analogy operates irregularly to produce regularities.
--E.H. Sturtevant, ca. 1945, probably at Yale

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] redefining eqv?

2010-12-23 Thread John Cowan
Peter Kourzanov scripsit:

 Just do $man _syscall on Linux (imagine open i.s.o. sysinfo in the
 example there).

_Syscall is obsolete and deprecated.  Anyhow, the _syscallX macros
*generate* functions that make system calls, they don't substitute
for them.

It's possible for any Posix function to be implemented as a macro,
but it's not common outside a standard set like getc() and isascii().

-- 
Mos Eisley spaceport.  You will never   John Cowan
see a more wretched hive of scum andco...@ccil.org
villainy --unless you watch thehttp://www.ccil.org/~cowan
Jerry Springer Show.   --georgettesworld.com

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Scheme pattern matching: the case for (case)

2010-12-22 Thread John Cowan
Andre van Tonder scripsit:

 No, I think this would be wrong.  There is no requirement in R6RS to 
 implement CASE using macros at all, never mind hygienic macros.  The 
 sematics of CASE is perfectly well described in R6RS as part of the core, 
 and precludes Peter's interpretation already.

I've clarified the ticket to say that standard syntax forms must be
implemented *as if* hygienic macros were used.

 The standard should remain agnostic as to how CASE is implemented.

+1

-- 
John Cowanhttp://ccil.org/~cowanco...@ccil.org
[T]here is a Darwinian explanation for the refusal to accept Darwin.
Given the very pessimistic conclusions about moral purpose to which his
theory drives us, and given the importance of a sense of moral purpose
in helping us cope with life, a refusal to believe Darwin's theory may
have important survival value. --Ian Johnston

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Scheme pattern matching: the case for (case)

2010-12-22 Thread John Cowan
Peter Kourzanov scripsit:

 (define eqv? equal?)
 (newline)
 (write (case asd ((asd) #t)))
 (newline)
 
 You'll find Tinyscheme, Minischeme, MIT, Scheme48/SCSH
 included in your list. Ypsilon and Stalin exhibit this
 behaviour for strings, but not for more structured data 
 like vectors.

Chicken, Bigloo, Kawa, SISC, Chibi, STklos, and Scheme 9 also have this
problem; Racket, Gauche, Gambit, Guile, Chez, SCM, Larceny, Mosh, and
SSCM do not; Ikarus won't let you rebind EQV?.

However, this is a problem not of hygiene but of reusing implementation,
I think.  Consider this:

(define cdr #f)
(length '(a b c))

I haven't found any Schemes except Scheme 9 on which this fails, but
there is nothing in any Scheme standard to make it work.  In C, on the
other hand, the equivalent construction is not allowed to fail: fopen()
is naturally definable in terms of open(), but if you define your own open(),
it cannot affect the behavior of fopen() on conformant ISO C systems.

On the gripping hand, if you define your own length in terms of cdr
(as is natural), you will get a failure if cdr is redefined later in the
REPL.

The problem's a mess.

-- 
John Cowan  co...@ccil.org  http://www.ccil.org/~cowan
Most people are much more ignorant about language than they are about
[other subjects], but they reckon that because they can talk and read and
write, their opinions about talking and reading and writing are as well
informed as anybody's.  And since I have DNA, I'm entitled to carry on at
length about genetics without bothering to learn anything about it.  Not.
--Mark Liberman

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] redefining eqv?

2010-12-22 Thread John Cowan
Peter Kourzanov scripsit:

 That's because the definition of open() (typically a macro) 

I don't know any Posix or Posix-like system on which open() is a macro.

-- 
John Cowan  co...@ccil.org   http://ccil.org/~cowan
Promises become binding when there is a meeting of the minds and consideration
is exchanged. So it was at King's Bench in common law England; so it was
under the common law in the American colonies; so it was through more than
two centuries of jurisprudence in this country; and so it is today.
   --Specht v. Netscape

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Scheme pattern matching: the case for (case)

2010-12-22 Thread John Cowan
Eli Barzilay scripsit:

 That distinction forces the above to work, but that's little comfort
 for any piece of code that I write, since that disguised assignment
 can break my code completely (unless I invent my own module system,
 and avoid relying on anything but the standard core...).  A module
 system is a much better solution that keeps things sane without
 resorting to such special cases.

R6RS provided a module system at the expense of not providing semantics
for a REPL.  R7RS, however, is mandated to have both.

In practice, a REPL semantics can't be made perfectly consistent.
For example, no Scheme REPL allows post hoc redefinition of syntax forms,
although SCM allows it if the code containing the form has not yet been
executed.  Post hoc redefinition of free variables does work
everywhere, though.

Similarly, for a REPL to be functional it must be meaningful to re-import
the revised version of a module.

-- 
John Cowan  co...@ccil.org  http://www.ccil.org/~cowan
Does anybody want any flotsam? / I've gotsam.
Does anybody want any jetsam? / I can getsam.
--Ogden Nash, No Doctors Today, Thank You

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Scheme pattern matching: the case for (case)

2010-12-22 Thread John Cowan
Eli Barzilay scripsit:

  R6RS provided a module system
 
 Still does.

By R6RS I mean the process, not the product.

 There are some implementations that provide module systems and a
 (deterministic) repl.  

Can you elaborate on this?  Obviously, it's possible to have *some*
sort of REPL, such as the one discussed some months ago in which typing
#!r6rs throws away the world and implicitly starts over with an empty
top-level program.  But that's nothing like a Scheme REPL as we know it.

-- 
A: Spiro conjectures Ex-Lax.  John Cowan
Q: What does Pat Nixon frost her cakes with?  co...@ccil.org
  --Jeopardy for generative semanticists  http://www.ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Scheme pattern matching: the case for (case)

2010-12-21 Thread John Cowan
Peter Kourzanov scripsit:

 Extending this to cover (case), i.e., a list of possible patterns
 rather than a single pattern is a very Schemey thing to do, in
 my opinion.

A match-case is a plausible idea, but it's not an upward compatible
extension to case, and so should not be named case.

 eqv? is immaterial here:
 
 (let ([eqv? equal?]) (case asd ((asd) #t)))

That does not mean what you think it means, for two reasons.  One is that
with a proper hygienic macro system, rebinding eqv? does not affect any
uses of eqv? in the expansion of the case macro.  The second reason is
that implementations are free to make literal strings eqv? if they have
the same content.

 Not necessarily so. One can consider a (case) pattern to be implicitly 
 quasiquoted (just like traditional case is implicitly quoted). So, if
 one needs extended (case) capabilities, one would write:
 
 (case 'b
   ((,a) (list a)))

Quoting, alas, is incompatible with quasiquoting.  (,a) is just syntax
sugar for ((unquote a)), which is a perfectly legitimate argument for
a case arm that matches on a list eqv? to it.  Somewhat unlikely that
you will find such a list, but that's still what it means.

 From my perspective, (case) is a degenerate case of (match) and should 
 be merged - we don't need two switch constructs in a simple and small 
 language.

Note that this is a WG2 proposal, ergo not the simple and small language.

-- 
Real FORTRAN programmers can program FORTRANJohn Cowan
in any language.  --Ed Post co...@ccil.org

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Date and time arithmetic library proposal for R7RS large Scheme

2010-12-19 Thread John Cowan
r6rs...@free-comp-shop.com scripsit:

 A nitpick or typo, but there is no 23:61.  

A brain fart, rather.

 I do not think there is any repeat in NTP.  NTP transmits time as an
 integer count of seconds, a fractional second, and a leap second
 warning.  It is up to the client (user) software to break this into
 hh:mm:ss form and insert the leap in the proper place or (more likely)
 torque it up.

I was referring not to NTP-the-protocol, but
NTP-the-reference-implementation.  See
http://en.wikipedia.org/wiki/Unix_time#Non-synchronous_Network_Time_Protocol-based_variant
 .

-- 
My confusion is rapidly waxing  John Cowan
For XML Schema's too taxing:co...@ccil.org
I'd use DTDshttp://www.ccil.org/~cowan
If they had local trees --
I think I best switch to RELAX NG.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-16 Thread John Cowan
Jim Wise scripsit:

 Enclosed is the draft I've put together for this.  Let me know if you
 would like me to send this to one or more of the wg or reports lists for
 further comment.

I've posted it at http://trac.sacrideo.us/wg/wiki/MatchingWise.  I
removed the section on exceptions (which is still unsettled) and
changed the MUSTard.  I've also removed the (rnrs match core)
library in favor of just renaming on import.

-- 
LEAR: Dost thou call me fool, boy?  John Cowan
FOOL: All thy other titles  http://www.ccil.org/~cowan
 thou hast given away:  co...@ccil.org
  That thou wast born with.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-16 Thread John Cowan
Per Bothner scripsit:

 I think that misses the point - it becomes too much hassle to
 manually type in the renames, so people aren't going to do it.

Ah, but the default names are the overrides, *not* the match- forms.
Sneaky, eh?

-- 
John Cowan  co...@ccil.org   http://ccil.org/~cowan
Assent may be registered by a signature, a handshake, or a click of a computer
mouse transmitted across the invisible ether of the Internet. Formality
is not a requisite; any sign, symbol or action, or even willful inaction,
as long as it is unequivocally referable to the promise, may create a contract.
   --Specht v. Netscape

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-16 Thread John Cowan
Per Bothner scripsit:

 Cute.  But there seems to be a mistake in the definitions of lambda
 and lambda* - they have the same definitions and expansions in terms
 of core:lambda.

No, the former is defined as (core:lambda (id) ...) and the latter as
(core:lambda id ...).  The names may well be reversed, but I'll wait
for the author to weigh in on that.

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
And now here I was, in a country where a right to say how the country should
be governed was restricted to six persons in each thousand of its population.
For the nine hundred and ninety-four to express dissatisfaction with the
regnant system and propose to change it, would have made the whole six
shudder as one man, it would have been so disloyal, so dishonorable, such
putrid black treason.  --Mark Twain's Connecticut Yankee

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Per Bothner scripsit:

 To win pattern-matching really should be the default and integrated
 into the language core, rather than an optional module that uses
 separate keywords.  E.g. there shouldn't be a difference between lambda
 and match-lambda*.  The latter is too verbose!

Being in the core and being spelled lambda are orthogonal points.  The
module can say (export (rename match-lambda* lambda)) and then importers
will get the pattern-matching lambda, or they themselves can import it as
(import (rename (scheme patterns) (match-lambda* lambda))).  In a world
of import and export renaming, the precise name of a procedure or syntax
keyword is no longer much of an issue.

 At the least we could have a standard library that redefines the
 standard keywords lambda, let, ... etc to versions that support
 patterns.

Exactly.

 The biggest issue appears to be define.  Changing define to have
 the syntax:
(define pattern expression)

Why wouldn't it be (define (name . pattern) expression)?  A define
without an identifier being defined doesn't make much sense to me.

(begin
  (def var1 exp1)   ;; OR: (::= var1 exp1) etc (def var2 exp2)
  (def varn expn)

Reading 'define' for 'def', this looks like R5RS to me.  We only use
'let' out of habit, really; nine times out of ten, the definitions are
independent, and any of 'let', 'let*', 'letrec', or internal 'define'
(aka 'letrec*') will work.

-- 
John Cowan  co...@ccil.orghttp://ccil.org/~cowan
No man is an island, entire of itself; every man is a piece of the
continent, a part of the main.  If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friends or of thine own were: any man's death diminishes me,
because I am involved in mankind, and therefore never send to know for
whom the bell tolls; it tolls for thee.  --John Donne

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Jim Wise scripsit:

 Are there plans to include explicit pattern matching operations, such as
 Common Lisp's DESTRUCTURING-BIND or Racket's match[1]?

We don't work in terms of plans, but in terms of proposals, and right now
there are no concrete proposals.  If you put together a concrete proposal
(doesn't have to be detailed, just clear) and send it to me, I will be
happy to post it for WG consideration.

-- 
John Cowanco...@ccil.orghttp://ccil.org/~cowan
   There was an old manSaid with a laugh, I
 From Peru, whose lim'ricks all  Cut them in half, the pay is
   Look'd like haiku.  He  Much better for two.
 --Emmet O'Brien

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Jim Wise scripsit:

 I'd be willing to cull the list discussion as a proposal, if there seems
 to be a common thread.  Are there any details on what's wanted in such a
 proposal?  Or just the discussion on the list?  Any standard formatting?

Take a look at http://trac.sacrideo.us/wg/wiki/ArraysCowan for a sample.
The markup is ''...'' for italics and `...` for monowidth font.  An
example should be preceded by a line containing just {{{, and followed
by a line containing just }}}.  But if this is too much trouble, I can
insert the markup later.

-- 
The experiences of the past showJohn Cowan
that there has always been a discrepancyco...@ccil.org
between plans and performance.  http://www.ccil.org/~cowan
--Emperor Hirohito, August 1945

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [scheme-reports] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Per Bothner scripsit:

 The (default/preferred) syntax for lambda should do pattern-matching
 *without* having to use a verbose name like match-lambda*.  I don't
 want either of these:
 (1) People learning and using Scheme having to mix 2 sets of
 keywords depending on whether they want to use pattern-matching.
 (2) Having to use keywords that are *even more* verbose than R6RS.

I quite agree.  However, I don't think it's too great an imposition
to ask people to write (import (scheme patterns)) at the top of their
code in order to get pattern-matching lambda, define, let, let*, etc.
That disposes of your point 2, and I don't understand your point 1
unless it is another way of stating your point 2.  Are you objecting
to syntactic keywords having different significance in different parts
of the code?

What is more, in R7RS (as currently proposed) a REPL may auto-import
whatever set of modules the implementer chooses, so it is conformant to
provide pattern matching in the REPL automagically.

 If we did this, we should also allow GREEK SMALL LETTER LAMBDA.  In fact,
 it would be preferable, I think, as it has a standard HTML escape: lambda;

I agree that this character is more suitable, as it will normally
adjust to the font you are using for the rest of your code.  Note that,
in accordance with modern Greek orthography, the formal spelling of the
character's name is always LAMDA.

 (Neither, alas, seems to have a standard compose-key binding, though
 perhaps we could lobby X.org to have the greek letters added.  For example
 lambda == compose+g+l, using g as a prefix for Greek letters.)

Sounds good to me.

 
  Concerning the other half of your mail, I would like to keep (define)
  orthogonal to (lambda), i.e., using a syntax like this (also using LIGHT
  VERTICAL BAR, i.s.o | because in some implementations | is reader's
  special quotation)
 
 Those two characters are too similar to each other.
 
 A unrelated problem, where using more of Unicode can help:
 Using the same character for both the start and end of a string
 is bad design, especially if you allow multi-line strings.  The problem
 it is not robust in terms of errors, or (worse) incomplete programs:
 Imagine a syntax highlighter or other on-the-fly parser trying to
 keep up while you're editing an expression containing multi-line
 string literals - what is inside vs outside the string literal
 changes from moment to moment.
 
 Unfortunately, there aren't any good start-quote/end-quote pairs.
 The old texinfo way of using apostrophe `like this' is wrong with
 current fonts and Unicode semantics.  One could use {braces} or
 [brackets], but they're more naturally used for other things.
 One could use a #2-character sequence# but that is ugly and
 error-prone.
 
 However Unicode provides options: «double angle quotation marks»
 or “double quotation marks”.  Both of these have standard HTML
 named-character escapes *and* compose-key combinations.  The
 «former» is I think more readable (and has an easier compose-key
 sequence).  (The problem with “double quotation marks” is that it
 is harder to see the difference between “ and ” and  - at least
 with the font and eyes I'm using.)
 -- 
   --Per Bothner
 p...@bothner.com   http://per.bothner.com/
 
 ___
 r6rs-discuss mailing list
 r6rs-discuss@lists.r6rs.org
 http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

-- 
John Cowanco...@ccil.orghttp://ccil.org/~cowan
Rather than making ill-conceived suggestions for improvement based on
uninformed guesses about established conventions in a field of study with
which familiarity is limited, it is sometimes better to stick to merely
observing the usage and listening to the explanations offered, inserting
only questions as needed to fill in gaps in understanding. --Peter Constable

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Per Bothner scripsit:

 I.e. where (var1 var2 var3) is a valid pattern matching a 3-element list.
 This syntax for patterns has the advantage that it is a generalization of
 syntax-rules patterns, in addition to being natural and compact.

Ah, I see.  I think that the natural extension of define is to allow it
to define a single named pattern-matching procedure rather than allowing
it to define multiple names simultaneously.

 In that case, how do you distinguish:

   (define (function-name param1 param2) expression)

 from

   (define (var1 var2 var3) expression)

The former is the only meaning, but with pattern-matching define
you may also write (define (foo (v1 v2) v3) ...) to define
a procedure which accepts two arguments, the first of which is a
two-element list.

-- 
John Cowan  co...@ccil.org
Not to know The Smiths is not to know K.X.U.  --K.X.U.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Per Bothner scripsit:

 There is SRFI 16's case-lambda, but it's pretty simple.

Case-lambda is on the table for WG1, and I expect it will most likely pass.

 That means that if R7RS supports optional arguments then the following
 (or something functionally equivalent) should be a valid pattern:
 
(a b #!optional c (d 10))

Both optional arguments and keyword arguments will be WG2 modules, but
I don't expect that DSSSL keywords will be the syntax, as that was the
bottom-ranked choice in the WG1 vote.

 Also, a question to ponder: For implementations that provide some
 kind of abstract sequence type that is (at least) a superset of
 both list and vector: They might want to allow a list pattern to
 match either a sequence or vector.  Not perhaps directly relevant
 to R7RS standardization, unless we're considering abstract sequences
 types for R7RS, but note that is a direction some of us might like to
 move towards.

Generic sequences were voted down by WG2.

-- 
John Cowanco...@ccil.org
At times of peril or dubitation,  http://www.ccil.org/~cowan
Perform swift circular ambulation,
With loud and high-pitched ululation.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] LAMBDA and Unicode (Was: Scheme pattern matching R*RS)

2010-12-14 Thread John Cowan
Shiro Kawai scripsit:

 The issue is that plain text files doesn't have metadata to
 indicate which encodings it is in.  Is it on the table of WGs
 to specify the source-code encoding in some way?

It's not currently on the table.

-- 
Let's face it: software is crap. Feature-laden and bloated, written under
tremendous time-pressure, often by incapable coders, using dangerous
languages and inadequate tools, trying to connect to heaps of broken or
obsolete protocols, implemented equally insufficiently, running on
unpredictable hardware -- we are all more than used to brokenness.
   --Felix Winkelmann

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-12 Thread John Cowan
Peter Kourzanov scripsit:

 Hence my question: what is the state of pattern matching in Scheme? Are
 there ideas to move this forward, or are we, the poor users, left to
 live with incompatible pattern matching interfaces and implementations?

Working Group 2 has decided that an optional pattern matching module
will be part of R7RS.

 Just to mention a few: Bigloo's match-case, PLT/Racket match.ss variants
 and many more.

If you care to do some work preparing one or more proposals either based
on these, or on something else, or on suitable combinations of them,
you will get much love from the WG.  Just send it to me, and I will
post it for WG2's consideration.

-- 
He played King Lear as though   John Cowan co...@ccil.org
someone had played the ace. http://www.ccil.org/~cowan
--Eugene Field

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Date and time arithmetic library proposal for R7RS large Scheme

2010-12-01 Thread John Cowan
Thomas Bushnell, BSG scripsit:

 I think it's confusing to call this century, since it's one off from
 the ordinal number of the century. Perhaps hundreds or something
 that is more digity sounding?

The term is ISO's, as is the chronology.

In any case, languages differ: in Italian the 15th century is called
the Quattrocento, and even in English we can say the 1400s.

-- 
Si hoc legere scis, nimium eruditionis habes.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Date and time arithmetic library proposal for R7RS large Scheme

2010-11-29 Thread John Cowan
Thomas Bushnell, BSG scripsit:

 If the interface says number of seconds since the epoch, not counting leap
 seconds (which is what Posix's gettimeofday is), then let it be that. Add
 1 to the value means add one second. The precision is about the precision
 of the particular numeric representation. 

Anything described as number of seconds is evidently an integer,
since we count things with integers.  And yet you say not to think
about integers.

 Remember to separate the exactness of a numeric representation from the
 accuracy of the underlying clock. If the accuracy is 10ms (typical for lots
 of systems), then that does not mean it's pointless for the numeric
 representation to be exact. So I agree that there should be no
 recommendation about what sort of numeric format to use. Keep in mind that
 inexact rational does not mean floating point in Scheme.

In principle, no; in practice, it definitely does.  There are no Schemes
out there which use something other than floats for inexact rationals,
and the great bulk of them use 64-bit IEEE floats only.

 I think we should have a interface for it, but alas, Linux and Posix don't
 provide a way to get it. Given NTP and the granularity of clock interrupts,
 the accuracy is known in some sense to the system as a whole, but in
 practice difficult to determine.

It sounds like you are talking about precision, not accuracy.  If the
clock is off by a day because I botched setting it, do you expect the
system to know that and report it?

-- 
First known example of political correctness:   John Cowan
After Nurhachi had united all the other http://www.ccil.org/~cowan
Jurchen tribes under the leadership of the  co...@ccil.org
Manchus, his successor Abahai (1592-1643)
issued an order that the name Jurchen should   --S. Robert Ramsey,
be banned, and from then on, they were all   The Languages of China
to be called Manchus.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Date and time arithmetic library proposal for R7RS large Scheme

2010-11-28 Thread John Cowan
Marc Feeley scripsit:

 (alarm (+ (now) (year-seconds 1)))

The year-seconds procedure makes no sense, because you need to know if
this is leap year or not, and whether we are talking Gregorian or Julian
leap years.  This is a fine example of the need for broken-out time.

-- 
There are three kinds of people in the world:   John Cowan
those who can count,co...@ccil.org
and those who can't.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [scheme-reports-wg2] Re: Date and time arithmetic library proposal for R7RS large Scheme

2010-11-28 Thread John Cowan
Faré scripsit:

 If we can't agree on what fraction that shall be, because of portability
 issues, why not introduce an implementation-dependent unit jiffies or
 some such, and an implementation-dependent constant conversion rate
 jiffies-per-second, which could be an integer, fraction, real number,
 but hopefully not a complex number, and if possible exact. This would
 allow embedded implementation of Scheme to use whatever the hardware
 or OS clock provides them without further expensive conversion during
 time-sensitive operations.

I'm in favor of such an API, but it's out of scope for my current needs.

 My modest proposal, for a Scheme implementation faithful to the spirit
 of Scheme, of doing The Right Thing at the expense of respect for
 convention, would be for a jiffy to be the Planck Unit of time:

Modest indeed.  The size of the bignums will not be so modest.
Let's stick with nanoseconds if we must prescribe a size, or leave it
implementation-defined, better yet.

-- 
Do I contradict myself? John Cowan
Very well then, I contradict myself.co...@ccil.org
I am large, I contain multitudes.   http://www.ccil.org/~cowan
--Walt Whitman, Leaves of Grass

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [Scheme-reports] Date and time arithmetic library proposal for R7RS large Scheme

2010-11-28 Thread John Cowan
Marc Feeley scripsit:

 The problem is that a date is just a label for a point in time.
 A label assigned by humans in a rather arbitrary way that can't
 even be determined ahead of time (leap seconds, time zones, etc).

Quite so, which is why I have both instants and date objects.

 It is quite a shock to think that our date labelling system isn't
 even one-to-one with time points (for example, on the US east coast,
 there are two points in time that correspond to 1:30 AM November 7,
 2010, because at 2 AM November 7, 2010 the clocks are set back to 1
 AM to return to Standard Time).

Hence the existence of the daylight-savings-time field and its C analogue,
the dstflag.

 I want to make sure that the date and time abstractions are not
 hopelessly intertwined.  The thread/process scheduler of an OS should
 work with time points.  A calendar application should work with dates.

Correct.  And it's a calendar API I'm proposing.

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
The penguin geeks is happy / As under the waves they lark
The closed-source geeks ain't happy / They sad cause they in the dark
But geeks in the dark is lucky / They in for a worser treat
One day when the Borg go belly-up / Guess who wind up on the street.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Date and time arithmetic library proposal for R7RS large Scheme

2010-11-26 Thread John Cowan
r6rs...@free-comp-shop.com scripsit:

  In any case, most computer clocks aren't accurate to
  1 part in 10^8, which is the discrepancy between
  Posix time and UTC time since the beginning of UTC.
 
 How many milliseconds is that?

It's 24,000 ms out of the last 39 years, or approximately
1,230,720,117,120 ms.  That is one part in 0.0002.

 I am not worried about precision, I am worried about correct arithmetic.

I agree that subtracting one value of current-posix-millisecond from
another has a rather small empirical probability of being off by 1000 ms,
namely 1 in 10^-8.  I have added a note to TimeCowan saying so.

Note that 1 ms resolution does not necessarily imply 1 ms precision: in
most Java implementations, you get 1 ms resolution but only 1 s precision.
As for accuracy, typical computers with access to the Internet can be
made accurate to about 35 ms, if carefully watched.

 You are *forbidding* an implementation to increment the clock before
 a leap second?

Yes, absolutely.  UTC time is readily available (except during leap
seconds), TAI time is not.

-- 
John Cowan  co...@ccil.orghttp://ccil.org/~cowan
No man is an island, entire of itself; every man is a piece of the
continent, a part of the main.  If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friends or of thine own were: any man's death diminishes me,
because I am involved in mankind, and therefore never send to know for
whom the bell tolls; it tolls for thee.  --John Donne

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Date and time arithmetic library proposal for R7RS large Scheme

2010-11-25 Thread John Cowan
r6rs...@free-comp-shop.com scripsit:

 If fractions are allowed, why count milliseconds?

Given that it should be easy to implement most dates as fixed-size
objects, milliseconds seem like a good compromise between range and
precision.

 What does Posix have to do with a language that may be implemented on
 any OS?  Use UTC.

With what epoch?  If you are to represent time as a number,
there has to be a zero time, or epoch.  There are various
alternatives, such as the start of 1900 C.E. Gregorian (Common
Lisp), the start of 4173 B.C.E. Julian (Julian days), the start of
November 17, 1858 (modified Julian days), and lots more listed at
http://en.wikipedia.org/wiki/Julian_day .  But Posix-epoch time is
available to 1 second precision on every modern system, so I chose it.
It's also the only one close enough to the start of UTC timekeeping to
make conversions possible.

 In particular, Posix torques up leap seconds.

Yes, it does.  But almost all computers do too.  In any case, most
computer clocks aren't accurate to 1 part in 10^8, which is the
discrepancy between Posix time and UTC time since the beginning of UTC.

 Trying to put both time-and-date *and* precise sub-second intervals
 into one number is a loser.

Why?  2^53 is a lot of range, and the further away from the present,
the less precision we need or even can use, given the fundamental
uncertainties about things like day length.  It doesn't even make sense
to ask about UTC time much before 1970.

 In particular, does the current instant increment uniformly, or does
 it encode the current date?  It can not do both, and it is unclear
 which you intend.

The latter, as Posix clock() does.

 It may or may not be incremented when a leap second passes.  If it is
 not incremented then the same number will be given to the leap second
 as to the preceding second.  In other words, sometimes the time is
 23:59:59 for two seconds before the new year arrives.  This ambiguity
 is the price of encoding the time-of-day as a single integer.

The same as what I'm proposing, except that may or may not is just
may not in my proposal.  That way, at least every second except a leap
second and the preceding second have fully specified instant values.
In your proposal, there's no knowing what they mean, as some leap seconds
but not others may be accounted for if the leap-second file (or other
source) is out of date.

 (tick-count) - An integer that is incremented at
 regular intervals as quickly as possible consistent
 with regularity.  This number will never decrease while
 the program is running, but may be changed arbitrarily
 when the system is re-booted or equivalent.
 
 (ticks-per-second) - The tick rate of the above
 counter.  This number does not change, but may differ
 from system to system.
 
 (epoch-of-zero-ticks) - the second, in time-of-day
 form, at the beginning of which the tick-count 
 was zero.  (extrapolated, the tick-count
 need not actually have been zero, indeed the
 computer need not have yet been built)

This is a good API, but functionally disjoint from what I'm dealing
with now.

-- 
John Cowanco...@ccil.orghttp://ccil.org/~cowan
The whole of Gaul is quartered into three halves.
--Julius Caesar

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Date and time arithmetic library proposal for R7RS large Scheme

2010-11-24 Thread John Cowan
Christopher Chittleborough scripsit:

 Err, you don't use the word string, only name. 

Fixed.

 Agreed. How about adding (a symbol) to the spec? Like this:
  Returns the numeric value of the field named fieldname (a symbol)

Done.

-- 
Well, I have news for our current leaders   John Cowan
and the leaders of tomorrow: the Bill ofco...@ccil.org
Rights is not a frivolous luxury, in force  http://www.ccil.org/~cowan
only during times of peace and prosperity.
We don't just push it to the side when the going gets tough.  --Molly Ivins

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Date and time arithmetic library proposal for R7RS large Scheme

2010-11-22 Thread John Cowan
Adrien Pied Piérard scripsit:

 This may be just a typo, but don't you mean instant instead of instance?

Fixed.

 Supposing that #f is a valid value for a field, 

All date fields are numeric; see the Date objects section.

  (date-round date fieldname)
 May this too have some effect on other fields than the one mentioned?

Fixed.

-- 
What asininity could I have uttered John Cowan co...@ccil.org
that they applaud me thus?  http://www.ccil.org/~cowan
--Phocion, Greek orator

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] [scheme-reports-wg2] Date and time arithmetic library proposal for R7RS large Scheme

2010-11-22 Thread John Cowan
Neil Van Dyke scripsit:

 There are also important decisions to make, like the semantics of
 mixed-precision arithmetic on, say, time points.

Can you clarify this?

 A few years ago, I spent person-weeks implementing most of ISO 8601, and  
 the API that I arrived at was necessarily (I felt) not nearly as neat  
 and tidy as TimeAdvancedCowan.  

I have another proposal in the works for periods, intervals, and recurring
intervals, but I consider them less complicated.  Note also that date
objects are broader than ISO 8601: they can contain values that don't
constitute time points, such as '((month . 4) (day-of-month . 2)).
XML Schema notates this as --4-2, but I don't know why.

Can we have a pointer to docs for your implementation?  In standards work,
API buccaneering is a good thing.

Note: I have just added date-alist to get the fields out of a date
object in bulk.

 However, the experience has led me to believe that RnRS should make
 a conscious, informed decision of how much of ISO 8601 to support,
 even though the answer might be only what Java does.

I looked at the official Java support, and it was a horrible mess, so I
worked from Joda Time instead.  It's overly complicated and Javaesque,
so I tried to boil it down as much as seemed feasible.

-- 
Kill Gorgun!  Kill orc-folk!John Cowan
No other words please Wild Men. co...@ccil.org
Drive away bad air and darkness http://www.ccil.org/~cowan
with bright iron!   --Ghan-buri-Ghanhttp://www.ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] div, mod, div0, mod0

2010-08-27 Thread John Cowan
On Fri, Aug 27, 2010 at 11:47 AM, Andy Wingo wi...@pobox.com wrote:

 What has the experience with div and mod been? The arguments in section
 11.6.6 of the rationale sound convincing, but it is a change from Scheme
 going back to at least R2R6, and I would like to hear how people have
 found div and mod to be, in practice.

I can't speak to that directly, but I would like to advertise Taylor
Campbell's write-up of the issues, which I think is excellent. The
problems with the R5RS names is that they are basically Maclisp names
that escaped the Great Renaming, perhaps because they were
inadequately analyzed at the time.  I haven't tested it, but I bet
there are lots of implementations that get the edge cases wrong.  R6RS
replaced both names and functions, but the results are still highly
irregular, and people don't have a clear idea of which one does what.

The write-up:  http://mumble.net/~campbell/tmp/division.txt

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] WG1 and WG2 mailing lists now open to lurkers

2010-02-25 Thread John Cowan
It is now possible to join the Scheme Reports WG1 and
WG2 mailing lists either through the Google Groups websites
(http://groups.google.com/group/scheme-reports-wg[12]) or in the usual
way via email to scheme-reports-wg[12]-subscr...@googlegroups.com.
Only members of the WG may post, however.

This is offered as a service to the Scheme community; please propagate.

-- 
John Cowan  http://www.ccil.org/~cowan  co...@ccil.org
Would your name perchance be surname Puppet, given name Sock?
--Rick Moen

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Arctic Repository 1.2 and Portable, Extensible Sockets

2010-01-02 Thread John Cowan
Aaron W. Hsu scripsit:

 The record system is the only library on which I have mixed feelings.  
 After having used it, I like it, and I take full advantage of some of the  
 hairier things like protocols. On the other hand, some of these things can  
 be done with a more simple interface. The result, however, isn't quite so  
 compact, and it's nice to have it in a record form. Were the editors  
 justified in creating such a complex record system? I'm not sure they  
 were, but now that we have it, I'm not sure that I am sorry about it.

I wonder what your views on SRFI 99 are.  I am very taken with it.

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
The penguin geeks is happy / As under the waves they lark
The closed-source geeks ain't happy / They sad cause they in the dark
But geeks in the dark is lucky / They in for a worser treat
One day when the Borg go belly-up / Guess who wind up on the street.

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Thing1: Dealing with VALUES

2009-12-02 Thread John Cowan
David Rush scripsit:
 The full article including references with source code links is at
 http://scheme-punks.org/wiki/index.php?title=Auric. This is really
 just an abstract.
 
 Cheney Meets a Chicken
 or
 Henry Baker Redux: CONS Should STILL Not CONS Its Arguments
 or
 Lambda the Ultimate Algebraic Constructor

I have read your whole paper, and I don't have time/energy/health level
enough to give it a full response right now, so here are some scattered
thoughts instead.

1) (lambda foo . body) isn't quite what you say, because foo is
a first-class list, not an opaque cookie that only a destructuring
operation can access.  This is one the one place where Scheme control
meets Scheme data: a Schemoid language that didn't have lists as a data
structure would need a different mechanism for writing variadic functions.

2) Under CPS, multiple returns are just multiple arguments passed to
the continuation, but while there is syntactic sugar for specifying a
fixed number, or minimum number, of arguments, there is no such sugar for
specifying a fixed number of results.  This matters because if something
is sugared the compiler can optimize it freely.  Typically LET-VALUES is
implemented on top of CALL-WITH-VALUES, but because the consumer is not a
first-class procedure, it can't escape and the compiler can in principle
implement LET-VALUES more efficiently.  Likewise for SET! vs. boxes, or
R[01]RS CATCH vs. R[2-]RS CALL/CC.  Often, of course, this opportunity
to optimize is not worth having: many Scheme compilers do in fact compile
SET! using boxes.

3) There are a couple of possibilities for adding such syntactic sugar:
I suggested (LAMBDA n (arg ...) . body), where n is a compile-time integer
constant, as a declaration that this procedure returns exactly n values.
One could also support (= n) instead of n, to indicate returning at
least n values.

4) Many languages go with out parameters, something like (LAMBDA (x y
(a :out) (b :out) . body).  Here a and b are bound but undefined, and you
define them with SET! or a specialization thereof.  Exiting the procedure
is equivalent to returning (values a b).  This idea has been around since
the beginning of HLLs: Fortran used call by reference to the right effect,
and Algol 60 had the more general call by name.  Ada is I think the most
recent language to have in, out, and in out (call by value and return)
arguments; they are allowed only in subroutines, not in functions.

-- 
John Cowan   co...@ccil.org
You need a change: try Canada  You need a change: try China
--fortune cookies opened by a couple that I know

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Thing1: Dealing with VALUES

2009-12-02 Thread John Cowan
David Rush scripsit:

 [1] I vaguely recall someone saying that Common Lisp uses APPLY/LIST
 for CALL-WITH-VALUES/VALUES and takes the car of the returned object
 if the continuation only accepts a single value

CL returns multiple values using VALUES, the same as R5RS.  There are
a set of syntaxes for receiving multiple values: MULTIPLE-VALUE-BIND,
which is the same as LET-VALUES in SRFI 11; MULTIPLE-VALUE-CALL,
which calls a function passing all the values of all the argument
forms; MULTIPLE-VALUE-LIST, which returns a list of all the values;
MULTIPLE-VALUE-PROG1, which evaluates all its arguments and returns the
values of the first argument only; MULTIPLE-VALUE-SETQ, which is like
M-V-BIND but does assignments rather than making bindings; and NTH-VALUE,
which returns the nth value only.  M-V-CALL and M-V-PROG1 are primitive.

There is also a function VALUES-LIST, which applies VALUES to its arguments.

-- 
John Cowan  http://www.ccil.org/~cowan  co...@ccil.org
Would your name perchance be surname Puppet, given name Sock?
--Rick Moen

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Implicitly Concurrent Scheme

2009-11-22 Thread John Cowan
Antonio Vieiro scripsit:

 Aubrey has requested the restriction to be removed, so let's remove it. 
 And if someone has something to say in *favour* of the restriction to be 
 kept in the report then I'd like to see a serious reason for it to be 
 kept (I haven't seen none yet).
 
 After all that's the spirit of Scheme: removing superfluous features and 
 restrictions, isn't it?

No.  The meaning of the celebrated paragraph, as I explained before, is to
remove restrictions on *programmers*.  This is a restriction on programmers
whose purpose is to provide freedom to implementations.

-- 
After fixing the Y2K bug in an application: John Cowan
WELCOME TO censored   co...@ccil.org
DATE: MONDAK, JANUARK 1, 1900   http://www.ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Implicitly Concurrent Scheme

2009-11-12 Thread John Cowan
Aubrey Jaffer scripsit:

 I am suggesting the following restriction be *removed* from the
 Procedure calls section of RnRS:
 
 _Note:_ Although the order of evaluation is otherwise unspecified,
 the effect of any concurrent evaluation of the operator and
 operand expressions is constrained to be consistent with some
 sequential order of evaluation.  The order of evaluation may be
 chosen differently for each procedure call.

[snip]

 Removing a restriction would seem to be justified solely on the basis
 of:
 
 Programming languages should be designed not by piling feature on
 top of feature, but by removing the weaknesses and restrictions
 that make additional features appear necessary.

This is a fine example of the rhetorical fallacy of equivocation.
The second quotation refers to removing restrictions on programmers.
The first quote imposes a restriction on implementations, partly for
the benefit of those same implementations, but mostly for the benefit
of programmers trying to reason about side effects.

R5RS has a restriction that the forms in a BEGIN must be evaluated
sequentially and in order.  Lifting this restriction would benefit some
uses, but would force programmers to devise a new way of doing things
sequentially and in order (like output), because they could no longer
rely on BEGIN.

Like all contracts, a spec specifies the agreements between implementers
and users.  Each accepts some restrictions.

-- 
Using RELAX NG compact syntax toJohn Cowan co...@ccil.org
develop schemas is one of the simplehttp://www.ccil.org/~cowan
pleasures in life
--Jeni Tennison co...@ccil.org

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Implicitly Concurrent Scheme

2009-11-08 Thread John Cowan
Aaron W. Hsu scripsit:

[huge snippage]

Just to pick on one little point:

 You can't get around the problem of procedures existing in other
 modules,

You can if you are only interested in interpreters and whole-program
compilers.

-- 
A witness cannot give evidence of his   John Cowan
age unless he can remember being born.  co...@ccil.org
  --Judge Blagden   http://www.ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Implicitly Concurrent Scheme

2009-11-06 Thread John Cowan
Marc Feeley scripsit:

 Not true.  Lazy-task creation will do a very good job dynamically.   
 Read my PhD thesis for details:

Well, I have read the whole thesis now (impressive stuff) and it still
seems to me that near the leaves of a spawning tree there comes a
point when the overhead, however small, must exceed the overhead of the
fork/join operations, however efficient.  Consider the sum benchmark
(which, for the rest of you, adds up the elements of an array of size
2^n by divide-and-conquer, splitting the array in half repeatedly until
one is adding two elements in each leaf thread).

Can it really be that it is more efficient to add four numbers in two
threads than in one thread?  Somewhere, exactly where will depend
on implementation details, one must cross the line where constant
factors dominate.  And that is not a point that, in the general case,
will be known.

-- 
John Cowan   http://ccil.org/~cowanco...@ccil.org
In might the Feanorians / that swore the unforgotten oath
brought war into Arvernien / with burning and with broken troth.
and Elwing from her fastness dim / then cast her in the waters wide,
but like a mew was swiftly borne, / uplifted o'er the roaring tide.
--the Earendillinwe

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Proposed features for small Scheme, part 4F: more symmetry

2009-11-05 Thread John Cowan
Brian Harvey scripsit:

 Vectors are the implementation of sequences whose length you know in advance.
 Lists are the implementation of sequences that might grow or shrink,

Quite true.  In addition, it used to be true that vectors had O(1) access
and lists O(N); now they both have O(N) access, but the constant factor
is hugely larger for lists.

 or whose length is just however much stuff READ returns.

The same is true of strings and vectors, though; READ works the same on all.

 So it really does make
 sense that vectors are made all at once, whereas lists are consed together.

That argument would be more convincing if we didn't already have the
variadic constructor LIST, exactly parallel to STRING and VECTOR.

 You are flying in the face of decades of tradition here.  This isn't an issue
 I would die on the barricades about, but I can't see why anyone would ever
 /use/ make-list.  

I find myself often wanting it precisely when I am changing vectors to
lists.  I start by using a vector in some application, then change it to
a list, then curse fate and type in the recursive definition of MAKE-LIST.
Yet again.

Still, if this is really idiosyncratic of me (does everyone else reach
for a list first, and have to be convinced that a vector is the Right
Thing?), I'll leave it out, I suppose.

I *am* having second thoughts about EMPTY-STRING? and EMPTY-VECTOR?,
though, precisely because we do recurse on lists but normally loop
through strings and vectors.

-- 
A rabbi whose congregation doesn't want John Cowan
to drive him out of town isn't a rabbi, http://www.ccil.org/~cowan
and a rabbi who lets them do it co...@ccil.org
isn't a man.--Jewish saying

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Proposed features for small Scheme, part 4F: more symmetry

2009-11-05 Thread John Cowan
David Van Horn scripsit:

 As far as I know, there have never been time bounds placed on list-ref 
 or vector-ref.  So I don't understand the it used to be true comment. 

Vectors are normally allocated contiguously in memory, whereas lists
are normally not (CDR-coding being an exception).  On older hardware
where most people's intuitions about access time developed, contiguous
allocation meant O(1) access time, whereas lists had to be and still
are traversed in O(N) time.

However, so-called RAM is no longer random access in the sense of O(1)
access time; it is now O(N) (though with a much smaller constant than
is required for linked access) unless the vector is entirely within a
CPU cache.

  Moreover, I don't understand why vectors would now have O(N) access 
 times (I assume you mean time and not space) based on what's in your 
 Thing One document.

Nothing to do with Thing One.

-- 
Ambassador Trentino: I've said enough. I'm a man of few words.
Rufus T. Firefly: I'm a man of one word: scram!
--Duck Soup John Cowan co...@ccil.org

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] Proposed features for small Scheme, part 4F: more symmetry

2009-11-04 Thread John Cowan
This is a proposal for a few new sequence procedures in R7RS small Scheme.
I am publishing this document to invite wide comment. There is nothing
official about it.  I retain sole responsibility for it, including
all errors.

I've published a little table at
http://docs.google.com/View?id=dc46qrdf_25hkqq95dd ; you can
always reach it from the sequence procedures link at the bottom
of http://tinyurl.com/thing-one .  It shows the basic constructors,
predicates, length procedures, element accessors and mutators, and
converters for Scheme's three sequence data types: lists, strings,
and vectors.  R5RS and even R6RS are pretty spotty about uniform support
for these fundamental datatypes, and I'm now adding a few proposals to
fill out the table so that all sequence types are equally provided for.

I had earlier proposed importing make-list from SRFI 1 as the basic
constructor for lists, and copy-vector from SRFI 43 as the copy
constructor for vectors.  In addition, although string-vector and
vector-string are not part of any SRFI, they will be very useful if
strings become immutable.

I am now completing the table by proposing to add list-copy from SRFI 1.
In addition, empty-string? and empty-vector? provide the analogues of
null?, and list-set! provides the analogue of string-set! and vector-set!.
These last three are also not in any SRFI, but are likewise obvious.
(There is an analogue of list-set! in CL.)

These are all conservative extensions, and will make the procedure set
more symmetrical and thus easier for novices to learn.

-- 
John Cowan   co...@ccil.orghttp://ccil.org/~cowan
[R]eversing the apostolic precept to be all things to all men, I usually [before
Darwin] defended the tenability of the received doctrines, when I had to do
with the [evolution]ists; and stood up for the possibility of [evolution] among
the orthodox --thereby, no doubt, increasing an already current, but quite
undeserved, reputation for needless combativeness.  --T. H. Huxley

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Proposed features for small Scheme, part 4F: more symmetry

2009-11-04 Thread John Cowan
Brian Harvey scripsit:
  make-list from SRFI 1 as the basic constructor for lists
 
 Umm, that position is already filled, by CONS.

Cons is the basic constructor for pairs, which are not sequences.
Make-list has the same arguments as make-string and make-vector: an
element count and an optional fill.

-- 
The Unicode Standard does not encodeJohn Cowan
idiosyncratic, personal, novel, or private  http://www.ccil.org/~cowan
use characters, nor does it encode logos
or graphics.co...@ccil.org

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Macro Timing and the Art of the Meta-Circular Interpreter

2009-10-29 Thread John Cowan
Alaric Snell-Pym scripsit:

 First, some definitions. I think we can take it as a given that a
 desirable feature of a macro system is that macro expansions should be
 decidable before run time. It's overspecifying to call that compile
 time, link time, or tea time; 

I just call it macro-expansion time.  But no, there is a small but
vocal minority that is absolutely opposed to this notion.

 That desire for being able to expand all the macros away before run
 time, revealing a semantically equivalent program without any macros
 in it (and from which all the macro definitions can therefore be
 stripped or ignored), is part of what makes fexprs bad.

Unfortunately, this argument is easily caricatured:

# That desire for being able to expand all the typecases away before
# run time, revealing a semantically equivalent program without any
# polymorphism in it, is part of what makes dynamic typing bad.

 It's also tied to another desirable property, that of being easy to
 reason about. Macros whose expansions can change at run time open up
 the potential for some terrible obfuscations of the meaning of a
 program.

I absolutely agree.

 On the other hand, one can go to the extreme in the other direction:
 you can produce a macro system that has no relationship whatsoever
 with the semantics of Scheme. A sort of M4 for sexprs. Allowing just
 define-syntax at the top level and let-syntax elsewhere, with syntax-
 rules, produces this; you could write a macro-expansion function that
 takes a list of sexprs, some of which may be define-syntax, the rest
 of which may contain let-syntax or calls to defined macros, and return
 an expanded form - and use it for Scheme source code just as well as
 for SXML representations of HTML documents.

Indeed, that's what alexpander is.  Alexpander is only written in Scheme
for Al* Petrofsky's convenience: it could perfectly well be written in
Cobol (only with extra added pain) and would work in exactly the same way.

 For a start, you can macroexpand as you walk the code, whether that
 code-walk is for compilation or interpretation. The difference being
 that the compilation code-walk will not know the values of all
 symbols, while an interpretation codewalk will.

The essence of hygienic macro expansion (as opposed to pseudo-hygienic
macro expansion, or define-macro + gensyms) is that you have to walk
*all* the code.  It's not enough to just process forms with macro
keywords specially.

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
If I have not seen as far as others, it is because giants were standing
on my shoulders.
--Hal Abelson

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Macro Timing and the Art of the Meta-Circular Interpreter

2009-10-28 Thread John Cowan
David Rush scripsit:

 Which is all well and good, but what does any of this have to do with
 macros? Early Lisps treated macros as syntactic abstractions and

Rather, early Lisps treated them as *procedural* abstractions and ...

 therefore incorporated their reduction into the APPLY function. 
 This led us to FEXPRs,

FEXPRs were there from the Lisp 1.5 days; macros came much later.

 However, it seems that macros could also be
 viewed as syntactic *extensions* and as such be more properly
 considered as part of EVAL's functional remit.

That is in fact the realization that led to the abolition of user-written
FEXPRs from Common Lisp and Scheme: that macros do everything FEXPRs do
that's worthwhile, and are far more tractable.  (You still need some
primitive FEXPRs, now renamed syntax in Scheme and special forms
elsewhere.)

 From this view it seems that we ultimately derive hygienic macros -
 as their reduction can be accomplished entirely in terms of textual
 manipulation with only minimal (actually zero I think) reference to
 anything outside of the syntactic reduction machinery in the MCI.

Well, it depends.  Certainly true for syntax-rules, but low-level macro
systems (hygienic or not) depend on the whole Lisp system, since they
provide access to the entire language to construct the macro.  (ISLisp is
an exception; only a subset of ISLisp is available at macro expansion
time; roughly speaking, nothing that can side-effect the environment in
which the macro expander is executing.)

 Now it is interesting to note that hygienic macros float the syntactic
 extension functionality outside of the entire EVAL/APPLY loop and into
 a conceptually separate pass.

That's true of any macros whatsoever; it is, in some sense, the point of
macros.  It's possible to intertwine that pass with ordinary evaluation,
as SCM shows, but at a high price in conceptual machinery.

 This makes environmental manipulations completely impossible to the
 macro processor.

Again, not so.  That's a matter of level.  C macros can't do environmental
manipulation because they are high-level, not because they are hygienic
(they aren't).

It's very important not to conflate hygiene with level -- they are
utterly orthogonal.

-- 
Yes, chili in the eye is bad, but so is yourJohn Cowan
ear.  However, I would suggest you wash yourco...@ccil.org
hands thoroughly before going to the toilet.http://www.ccil.org/~cowan
--gadicath

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Fwd: [plt-scheme] [ANN] Scheme Language Working Groups 1 and 2 draft charters

2009-10-28 Thread John Cowan
Peter Michaux scripsit:

 An arbitrarily embeddable language cannot have any I/O API
 requirements. ECMAScript, for example, doesn't have any I/O. It is up
 to the host program, into which the language is embedded, to add host
 objects which enable an I/O API appropriate to the embedding.

Hence the fact that in my proposals http://tinyurl.com/thing-one,
all I/O is in the modules files, reader, writer, and binary.
(String ports are part of the core, and so are read-char and write-char.)

-- 
John Cowan co...@ccil.org http://www.ccil.org/~cowan
Today an interactive brochure website, tomorrow a global content
management system that leverages collective synergy to drive outside of
the box thinking and formulate key objectives into a win-win game plan
with a quality-driven approach that focuses on empowering key players
to drive-up their core competencies and increase expectations with an
all-around initiative to drive up the bottom-line. --Alex Papadimoulis

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Implicitly Concurrent Scheme

2009-10-28 Thread John Cowan
Marc Feeley scripsit:

 Not true.  Lazy-task creation will do a very good job dynamically.   
 Read my PhD thesis for details:

I confess to not having read it yet, but it appears to be about futures,
which are directly inserted into code by the programmer, not inferred
by the implementation for *every* argument of *every* call.

-- 
John Cowan   co...@ccil.org   http://www.ccil.org/~cowan
One time I called in to the central system and started working on a big
thick 'sed' and 'awk' heavy duty data bashing script.  One of the geologists
came by, looked over my shoulder and said 'Oh, that happens to me too.
Try hanging up and phoning in again.'  --Beverly Erlebacher

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Proposed features for small Scheme, part 4E: cond-expand

2009-10-16 Thread John Cowan
Peter Bex scripsit:

 These sound useful, but are they available on, say a system which
 runs on top of Java or another VM?  Or would that VM _be_ the CPU?

I'll add jvm, clr, and llvm to the list.  Such a list is inevitably
open-ended anyhow.

 Also, I propose to add big-endian and little-endian to that list.

I'm not even sure why I left them out, though they belong on a different
list.  The JVM and CLR make it impossible to determine (short of native
code) what the underlying byte order is, however, so some systems will
have neither.

 How useful is this?  I've seen code that checks if a certain minimum
 version of an implementation is in use, but the precise version isn't
 *that* useful in cond-expand (except maybe in rare cases where only
 that version is known to contain a critical bug which needs to be
 worked around).

That's what I had in mind.

-- 
Go, and never darken my towels again!   John Cowan
--Rufus T. Firefly  http://ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] Proposed features for small Scheme, part 4E: cond-expand

2009-10-15 Thread John Cowan
This is a proposal for cond-expand in R7RS small Scheme. I am publishing
this document to invite wide comment. There is nothing official about
it. I acknowledge the kind help of members of the r6rs-discuss mailing
list and the #scheme IRC channel in the discussions that led up to
this document. However, I retain sole responsibility for it, including
all errors.

Cond-expand as explained in SRFI 0 doesn't explain where the feature
identifiers come from.  I'm proposing the following list.  A small Scheme
implementation has the feature identifier if it has the feature.

thing-one (temporary name)
All R7RS small Scheme implementations have this feature.

exact-closed
All rational operations on exact values produce exact values, with
the possible exception of /.  If an implementation restriction
is reached, an error is signaled.  If this feature identifier
is missing, some results may be inexact.

ratios
/ with exact arguments produces an exact result.

ieee-float
Inexact numbers are IEEE 754 floating point values.  This implies
support for +inf.0, -inf.0, +nan.0, and -0.0.

full-unicode
All Unicode characters are supported

windows
This Scheme implementation is running on Windows.

posix
This Scheme implementation is running on a Posix system.

unix, darwin, linux, bsd, netbsd, openbsd, freebsd, ...
OS-specific flags.

i386, x86_64, ppc, sparc, sparc64, ...
CPU-specific flags.

ilp32, lp64, ilp64, ...
C-memory-model-specific flags.
name
The name of this implementation.

name-version
The name and version of this implementation.

other
Anything implementation-specific.

In addition, if a module is _importable_, then its name appears in the
feature identifiers list (now something of a misnomer, since not all
module names are identifiers).  A module is importable if it is:

already loaded and imported;

already loaded but not currently imported;

not loaded, but known to exist due to an implementation-specific
mapping between (at least some) module names and external entries
such as file names.

--
John Cowan  co...@ccil.org   http://www.ccil.org/~cowan
Dievas dave dantis; Dievas duos duonos  --Lithuanian proverb
Deus dedit dentes; deus dabit panem --Latin version thereof
Deity donated dentition;
  deity'll donate doughnuts --English version by Muke Tever
God gave gums; God'll give granary  --Version by Mat McVeagh

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] Proposed features for small Scheme, part 6 bis: standard modules

2009-10-15 Thread John Cowan
 should be available too, though in principle load's argument
could be something else.

The %transcripts module exports the 2 identifiers transcript-on,
transcript-off.  Neither of these is in IEEE Scheme, and they are optional
in R5RS.

Removed features

As part of this proposal, I am proposing the removal of 3 R5RS procedures
from small Scheme.  The char-ready? procedure is not in IEEE Scheme and
doesn't, in general, do what users will expect.  The reasons for removing
the string-set!  and string-fill! procedures are explained separately.
I note here only that string-set! is in IEEE Scheme, but string-fill! is
not.

-- 
The experiences of the past showJohn Cowan
that there has always been a discrepancyco...@ccil.org
between plans and performance.  http://www.ccil.org/~cowan
--Emperor Hirohito, August 1945

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Import choices: flexibility vs. discoverability

2009-10-14 Thread John Cowan
Brian Harvey scripsit:

 Yes, exactly.  But I'm not just asserting this as a personal preference,
 which can battle forever against other people's personal preferences.  I'm
 claiming that the difference between these two preferences is precisely
 (well, more or less precisely :-) the difference between R6-haters and
 R6-lovers, and therefore, precisely the reason why we have this WG1/WG2
 business in the first place.

Well, that's an empirical claim and easily refuted.  Among the R5RS
implementations, meaning those that have no intention to move to R6RS,
*exactly one* behaves in the way you mention.  Either you rule out all
Schemes but SCM as lacking in the true R5RS nature (a no true Scotsman
fallacy), or you accept that people can and do love R5RS while making
a clear distinction between expand time and run time (which does *not*
mean they are not intertwingled).

A Scheme world without Gauche, MIT Scheme, Gambit, Chicken, Bigloo,
scsh, Guile, Kawa, SISC, or Chibi is a pretty strange place.

 I hereby name all of the above the WG1ical Imperative.

In some alternate universe, perhaps.

-- 
MEET US AT POINT ORANGE AT MIDNIGHT BRING YOUR DUCK OR PREPARE TO FACE WUGGUMS
John Cowan  co...@ccil.org  http://www.ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Counter-proposal (Re: Proposed features for small Scheme, part 9: modules)

2009-10-14 Thread John Cowan
Arthur A. Gleckler scripsit:

 I'm curious: What primitives do different Scheme implementations use
 to implement their module systems, both R6RS-compliant and otherwise?

I don't know the specifics.  I suspect the short answer is Low-level macro
systems.  Clearly in some Schemes, modules are a separate language from
Scheme itself, whereas in others they are part of it.

 If we could agree on a common set of such primitives in WG1, different
 implementations could implement both R6RS-style modules and completely
 different module systems, but have them interoperate.  I'm
 particularly interested in the lowest layer of procedural abstraction
 that can be used to implement practical module systems.
 
 I don't mean to take a stand on whether R6RS-style modules should be
 in WG1.  I'm just interested in whether there's also a useful lower
 layer on which we could agree.

I share this ambition, but fear that it will lead to a dreadful rathole.

-- 
The Unicode Standard does not encodeJohn Cowan
idiosyncratic, personal, novel, or private  http://www.ccil.org/~cowan
use characters, nor does it encode logos
or graphics.co...@ccil.org

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Import choices: flexibility vs. discoverability

2009-10-14 Thread John Cowan
Aaron W. Hsu scripsit:

 My use of the term syntactic modules is meant to distinguish the ability  
 to generate modules from macros from module systems that in essence exist  
 at a level different than othere Scheme code, such that Scheme code can  
 not naturally manipulate or work with module forms directly. R6RS  
 libraries are an example of libraries that cannot be treated in this  
 manner.

I see.  Thanks for the explanation.  (This is an example of why I'm still
using module rather than library as the keyword: I think it's very bad to
reuse a standardized keyboard with a new and different semantics.)

 I also believe that modules should be valid anywhere a definition  
 is valid. This is a direct result of the syntactic thinking. That is, I  
 see modules as just another Scheme form, not as a separate language.

But not as a first-class run-time object like strings or procedures, then.

 Most of the Scheme implementations I am seeing use separate files rather  
 than cond-expand to do this sort of glueing. I'm inclined to think that  
 this is the way to go, and that neither of these is suitable to put in the  
 Core Scheme. I just don't see enough of cond-expand in widespread use.

It's rather widely implemented (20 out of 28 Schemes); I find it hard
to believe that nobody uses it.

 Maybe we can define cond-expand somewhere else and say that  
 modules defined should have a cond-expand element registered, but that's  
 in the specification of cond-expand, not modules.

Indeed; as you'll see, my http://tinyurl.com/thing-one basic proposal
incorporates cond-expand with SRFI 0 semantics, which I extend by saying
that modules defined should have a cond-expand element registered.

-- 
John Cowan  co...@ccil.org  http://www.ccil.org/~cowan
Thor Heyerdahl recounts his attempt to prove Rudyard Kipling's theory
that the mongoose first came to India on a raft from Polynesia.
--blurb for Rikki-Kon-Tiki-Tavi

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Counter-proposal (Re: Proposed features for small Scheme, part 9: modules)

2009-10-14 Thread John Cowan
Brian Harvey scripsit:

 Well, I confess that this is a good argument for first class
 environments.

The good thing about 1CEs is that with them you can do almost anything.
The bad  thing about 1CEs is that with them you can do almost anything.

-- 
John Cowan   http://www.ccil.org/~cowanco...@ccil.org
You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
Clear all so!  `Tis a Jute (Finnegans Wake 16.5)

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Import choices: flexibility vs. discoverability

2009-10-14 Thread John Cowan
Ray Dillinger scripsit:

 My problem with this plan is that I can't express that I 
 *DON'T NEED* the other two modules if I can get full POSIX. 

But how can that be?  I don't understand this.  Either you need to
call certain routines or you don't.  If those routines are exported
from your version of the Posix library but don't actually work, you
need to supplement them.

-- 
I don't know half of you half as well   John Cowan
as I should like, and I like less than half co...@ccil.org
of you half as well as you deserve. http://www.ccil.org/~cowan
--Bilbo

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Counter-proposal (Re: Proposed features for small Scheme, part 9: modules)

2009-10-14 Thread John Cowan
Aaron W. Hsu scripsit:

 I would like to make a counter-proposal to your module proposal.   

This is just a response to your responses.  I'll make a separate response
to your counter-proposal when I have digested it.

 We might as well use the library word, because this is the word that is  
 standardized already. I also don't agree with choosing a subset of R6RS  
 libraries.

The two go together.  I'm fine with using the keyword library if there is
indeed to be full backward compatibility, but otherwise not.

 The reason I say this is that I don't think the core module system should  
 be changed by WG2. If it is, then this hampers portability between the two  
 systems.

Portability in the sense of downward compatibility will be quite hampered
enough for other reasons.  For example, R6RS requires (and I suppose that
Thing Two will require also) that all Unicode characters be supported and
that something similar to the (rnrs unicode (6)) library be available.
Thing One systems, in general, will not meet this requirement and will
not have such a library, so Thing Two modules that depend on it are not
guaranteed to work in Thing One.

On the other hand, if the Thing One module system is a subset (not
necessarily a proper one) of Thing Two's, then Thing One modules will work
in Thing Two.  This satisfies the contravariance restriction I mentioned.

 i would prefer to assure implementations that at least, some level
 of communication is possible intra-working group here. I don't think
 choosing only a subset is going to be good enough in this case. The R6RS
 library form is simple enough that I think the WG1 can deal with it.

Given that there are people clamoring for R4RS as Thing One and LAMBDA
as the module system, that proposal is going to have trouble flying.

 I am going to argue that this is a new feature we should not implement in  
 the standard. We can try it as an experiment somewhere else, but I don't  
 think such an idea is ready for the standardization process yet, and  
 because no Scheme system does this currently, I do not have this in my  
 proposal. 

Based on this and other arguments, I've replaced feature groups with
magic modules (which need a better name).  The names exported by magic
modules are optional in the core, so importing a magic module that the
implementation already supports does nothing.  If the implementation
cannot support it, an expand-time error results.  If the implementation
is capable of mutating itself to one that supports the behavior in the
magic module, then it does so.

As I've said, feature groups / magic modules just make explicit the variability
that R5RS and the WG1 charter provide in how a small Scheme implementation
may subset the standard while remaining compliant.

 Most existing systems allow forward macro references,

I suppose you mean most existing module systems rather than most
existing R5RS REPLs, which typically don't allow forward references
to syntax even in definition forms.  (Obviously, forward references to
syntax in top-level expression forms makes no sense in a REPL.)

 among other things, and a module form will be evaluated as a whole
 on the REPL, so there is no need to worry that we won't know for sure
 one way or the other. This is a restriction that I don't like.

Well, tastes differ.  Modules are simplest to implement if the body
of the module is treated as if it were simply a begin-body modulo the
handling of bound names.

 I do suggest that include should be a form, but it should be usable
 anywhere.

I agree.

 I also propose the addition of INCLUDE/CI for case-insensitve
 includes. This may not be necessary, but in practice, makdes a
 difference with code that doesn't use the #!case-fold specifier
 (legacy code that you don't want to change).

Presumably you'd also need a corresponding function to correctly import
case-sensitive code into a case-insensitive system.

 Be careful about the differences in visiting, evaluating, loading, c.  
 What if I LOAD the library before hand and it has some side-effects? When  
 should those side-effects take place?

At load time, certainly.

 I don't know that we should specify this any more than the R6RS did,
 to accomodate people who think that the library should be instantiated
 the moment it is loaded, as well as those who think it shold be at
 the import time or even the usage time, some of whom may instantiate
 it multiple times.

R6RS doesn't have LOAD, or any mechanism to load code at run time
(though you could write your own LOAD using existing R6RS mechanisms,
it might not do quite what you expect).

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
Any sufficiently-complicated C or Fortran program contains an ad-hoc,
informally-specified bug-ridden slow implementation of half of Common Lisp.
--Greenspun's Tenth Rule of Programming (rules 1-9 are unknown)

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http

Re: [r6rs-discuss] Proposed features for small Scheme, part 9: modules

2009-10-14 Thread John Cowan
Alaric Snell-Pym scripsit:

 Hopefully the Posix example makes things clearer.  It's not whether an
 OpenGL module is available (it always is) but whether OpenGL itself is
 available, a notion outside the Scheme system.
 
 An OpenGL module *is always available*? What other modules is WG1
 scheme going to mandate as always available?!?

Not at all.  I'm saying that *you*, the developer, can have an OpenGL
module that is present on the user's system whether or not OpenGL *itself*
is present, and works (for sufficiently small values of works) both
with and without OpenGL.

-- 
The Imperials are decadent, 300 pound   John Cowan co...@ccil.org
free-range chickens (except they have   http://www.ccil.org/~cowan
teeth, arms instead of wings, and
dinosaurlike tails).--Elyse Grasso

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Import choices: flexibility vs. discoverability

2009-10-14 Thread John Cowan
Ray Dillinger scripsit:

 the programmer should need to think only about runtime. 

If you want R4RS, or Common Lisp, or SCM, you know where to find all
those things.

-- 
Andrew Watt on Microsoft:   John Cowan
Never in the field of human computing   co...@ccil.org
has so much been paid by so manyhttp://www.ccil.org/~cowan
to so few! (pace Winston Churchill)

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Counter-proposal (Re: Proposed features for small Scheme, part 9: modules)

2009-10-14 Thread John Cowan
David Rush scripsit:

 The wonderful thing about Toplevel?

Thanks for the good laugh this morning.

 But really the wonderful thing about Top-Levels
 Is that there's ONLY ONE.

I assume this is the moral, but I don't understand it.  I count 20 Scheme
top-levels installed on my system today.  Some of them support nested
REPLs, too.

If there is no moral, then fine; I'll sing it to my grandson tonight.

-- 
Cash registers don't really add and subtract;   John Cowan
they only grind their gears.co...@ccil.org
But then they don't really grind their gears, either;   
they only obey the laws of physics.  --Unknown

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Counter-proposal (Re: Proposed features for small Scheme, part 9: modules)

2009-10-14 Thread John Cowan
Ray Dillinger scripsit:

 I can demonstrate now (I've done some research since then) that 
 if you allow user-defined generalized functions to take their 
 arguments lazily or applicatively rather than just eagerly, 
 that's all you need to get expressive power equal to anything
 that can be expressed without mutation in hygienic macrology.

We put macros into Lisp to get *rid* of flambdas and all their issues.

-- 
Time alone is real  John Cowan co...@ccil.org
  the rest imaginary
like a quaternion   --phma  http://www.ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Import choices: flexibility vs. discoverability

2009-10-14 Thread John Cowan
Ray Dillinger scripsit:

 Hm. The distinction I had been drawing between the desired 
 functionality of load vs. import is that import is aware 
 of and can be used for names defined as libraries/modules 
 (whose implementation may be binary or FASL or whatever) 

So that's just (load (module-search name)).

 whereas load is aware of and can be used for filenames 
 (implicitly files of scheme source code) only. 

R5RS explicitly allows loaded files not to be in Scheme.

-- 
John Cowan co...@ccil.org http://www.ccil.org/~cowan
Today an interactive brochure website, tomorrow a global content
management system that leverages collective synergy to drive outside of
the box thinking and formulate key objectives into a win-win game plan
with a quality-driven approach that focuses on empowering key players
to drive-up their core competencies and increase expectations with an
all-around initiative to drive up the bottom-line. --Alex Papadimoulis

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Import choices: flexibility vs. discoverability

2009-10-14 Thread John Cowan
Alaric Snell-Pym scripsit:

 Ah, cond-expand knows if a module *exists*, does it? Your earlier
 wording said *is imported* or some such, which is the source of my
 concern :-)

That was hastily said: it should probably have been if a module
is loaded (and therefore accessible for import).  Load-on-import of
course complicates the issue, so maybe it should really be if a module
is loadable.

Anyhow, cond-expand's feature list is independent of current bindings.

-- 
Take two turkeys, one goose, four   John Cowan
cabbages, but no duck, and mix them http://www.ccil.org/~cowan
together. After one taste, you'll duck  co...@ccil.org
soup the rest of your life.
--Groucho

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Counter-proposal (Re: Proposed features for small Scheme, part 9: modules)

2009-10-14 Thread John Cowan
Arthur A. Gleckler scripsit:

 What does Chicken do?

I am not the (or even an) implementer, but I believe that module
in Chicken is not a macro, but primitive syntax.  All it does is to
make any definitions use magic names of the form modname#truename.
When the module is imported, the modname#truename names are located
and aliases are constructed for them in the current context.

A Chicken module is not an implicit begin.  In particular, the semantics
of the forms in a module body are exactly the same as those of the REPL:
they are read and eval'ed (or the compiled equivalent) one at a time.
Only the usual kind of forward references are allowed: undefined
identifiers generate a warning and are treated as variables, never
as syntax.

-- 
While staying with the Asonu, I met a man from  John Cowan
the Candensian plane, which is very much like   co...@ccil.org
ours, only more of it consists of Toronto.  http://www.ccil.org/~cowan
--Ursula K. Le Guin, Changing Planes

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Import choices: flexibility vs. discoverability

2009-10-14 Thread John Cowan
Ray Dillinger scripsit:

 That isn't the case.  A system that manages inventory and orders 
 will use a database on a system where databases are available.  
 
 But say the DBMS requires a full posix environment.
 
 This implies that if I can't get a full posix, there is no database
 to communicate with and I have to do things in a different way, 
 which means I *don't* call the posix socket functions (which don't 
 work anyway) and use some other module to manage things in a 
 different way instead.

Okay, I'm convinced.  Conditional import is necessary, so imports have to
be able to appear embedded within syntax.

That doesn't mean I endorse your other propositions.

-- 
We pledge allegiance to the penguin John Cowan
and to the intellectual property regime co...@ccil.org
for which he stands, one world underhttp://www.ccil.org/~cowan
Linux, with free music and open source
software for all.   --Julian Dibbell on Brazil, edited

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Counter-proposal (Re: Proposed features for small Scheme, part 9: modules)

2009-10-14 Thread John Cowan
Per Bothner scripsit:

 I guess one use case is module signatures, which can be saitified
 by different module providers (implementations), perhaps with
 hot-swapping.  A module signature is basically a set of aliases.

This is what I was talking about in the OpenGL thread, but for module
signatures read modules and for module providers read sets of
source code, conditionally included.

-- 
Possession is said to be nine points of the law,John Cowan
but that's not saying how many points the law might have.   co...@ccil.org
--Thomas A. Cowan (law professor and my father)

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Import choices: flexibility vs. discoverability

2009-10-14 Thread John Cowan
Brian Harvey scripsit:

 John, John, this is a regression from your new ultra-reasonable image to
 the former I'm-right-you're-wrong one I used to hate.

I haven't changed in either case.  You might say I'm dogmatic about what
I know and skeptical/cautious about what I don't.  Some people think
this is a character flaw.

 1.  Face it, the idea of a language standard that specifies two different
 languages (WG1/WG2) is an incredible kludge.

It's *very* common for standards to have conformance levels.  Examples:
Minimal Basic and Full Basic, Basic Fortran and Fortran, Cobol Level
I/II/..., well-formed XML and valid XML, simple and full conformance to
XLink (not yet published).

 2.  The reason the SC found it necessary to endorse such a kludge is that
 they recognized the existence of /irreconcilable differences/ within the
 Scheme community, and (commendably) want a way to settle the dilemma
 without reading anyone out of the community.

Quite.

 3.  To characterize the desires of people who don't want to be forced to
 live in an R6-like world as unSchemely [I am reacting here mainly to the
 inclusion of Common Lisp in your litany] defeats this purpose.  

I *never* intended or implied that.  I do have problems with people
who think R5RS is unSchemely.  The reason to mention CL was that it
is an example of an extremely dynamic language, far more so than R5RS.
About the only static thing is the bindings of names in the LISP: package.

 I'm aware that the SC doesn't pose the issue in the terms suggested by #2
 above.  Indeed, they want WG1 and WG2 to be the Lite and Pro versions of the
 same language.  I think this is Pollyannaish of them; if that were possible,
 then we wouldn't need two standards.  We would call WG1 the core, and WG2
 the standard library, of a single language.

That's a big change.  In R6RS, or ISO C for that matter, the standard library
is just as much part of the implementation as the language proper is.
(Another pair for the list above: freestanding C and hosted C.)

 You've been suggesting, in various ways, that R6 is an inevitable working
 out of ideas introduced in R5.

Again, not at all.

-- 
John Cowanhttp://www.ccil.org/~cowan  co...@ccil.org
Please leave your valuesCheck your assumptions.  In fact,
   at the front desk.  check your assumptions at the door.
 --sign in Paris hotel   --Cordelia Vorkosigan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Proposed features for small Scheme, part 9: modules

2009-10-13 Thread John Cowan
Alaric Snell-Pym scripsit:

 Ah-hah. So having feature groups separate like that is a way to allow
 programmers to omit to declare their requirements in order to create
 code that may break unexpectedly? :-)

Pretty much.  Look how things work today:

$ chibi-scheme
 (define x (make-rectangular 1 2))
ERROR: undefined variable: make-rectangular
WARNING: reference to undefined variable: make-rectangular


Okay, switch to a different Scheme.  I'm not proposing to change that,
just to add a small amount of introspection so that you can see this
Scheme doesn't support complex numbers.  That's all feature groups are,
really.

Having to import complex numbers from a module, when we know that most
Schemes either have them built in or can't do them at all, is overkill
for a small Scheme.

ObData: I tried the above expression on my usual list of Schemes, and
came up with this:

Returns 1+2i:  PLT, MIT, Gambit, Chicken with numbers egg, scsh/Scheme48,
Kawa, Chez, Ikarus, Larceny, Scheme 7.

Returns 1.0+2.0i: Gauche, SISC, SCM, VScheme.

Error: Chicken, Bigloo, Scheme 9, SScheme, SXM, Chibi.

-- 
John Cowanco...@ccil.orghttp://ccil.org/~cowan
The present impossibility of giving a scientific explanation is no proof
that there is no scientific explanation. The unexplained is not to be
identified with the unexplainable, and the strange and extraordinary
nature of a fact is not a justification for attributing it to powers
above nature.  --The Catholic Encyclopedia, s.v. telepathy (1913)

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Proposed features for small Scheme, part 9: modules

2009-10-13 Thread John Cowan
Alaric Snell-Pym scripsit:

 How about letting implementations provide the symbols defined by
 feature-modules by default, making importing them optional?

So that would mean that (import inexacts) does nothing if you have
inexact numbers, and just reports an error if you don't?  (Okay, some
Schemes might be able to load inexact number support, but nobody
does that today.)

I suppose I could live with that, but it seems very weird.

-- 
Man has no body distinct from his soul,  John Cowan
for that called body is a portion of the soulco...@ccil.org
discerned by the five senses,http://www.ccil.org/~cowan
the chief inlets of the soul in this age.  --William Blake

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Proposed features for small Scheme, part 9: modules

2009-10-13 Thread John Cowan
Alaric Snell-Pym scripsit:

 No.  The idea is this:
 
 (module open-gl
  (export ...)
  (cond-expand
(has-open-gl (include open-gl-glue.scm))
(else (include open-gl-emulator.scm
 
 Ah, but where in this appears your import of the OpenGL library, if
 it's available? :-)

The actual library is written in C, and I assume we don't import C
source into Scheme.  The open-gl-glue.scm would be Scheme code
that uses the FFI to talk to OpenGL itself.

-- 
Go, and never darken my towels again!   John Cowan
--Rufus T. Firefly  http://ccil.org/~cowan

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] Proposed features for small Scheme, part 9: modules

2009-10-13 Thread John Cowan
leppie scripsit:

 I think more along the lines of:
 
 1. define all not implemented procedures/syntax as identifier-syntax, raise 
 an expand time not-implemented condition on usage

How is this different in actual use from just leaving them undefined?
The point of feature groups is to be able to *introspect* on what your
chosen Scheme can and can't do.

-- 
John Cowan  co...@ccil.org  http://ccil.org/~cowan
Micropayment advocates mistakenly believe that efficient allocation of
resources is the purpose of markets.  Efficiency is a byproduct of market
systems, not their goal.  The reasons markets work are not because users
have embraced efficiency but because markets are the best place to allow
users to maximize their preferences, and very often their preferences are
not for conservation of cheap resources.  --Clay Shirkey

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


  1   2   3   4   5   6   >