Giter Site home page Giter Site logo

r7rs-work's People

Contributors

aag avatar alaricsp avatar arcfide avatar arthurgleckler avatar arvyy avatar ashinn avatar axch avatar bh avatar bitwize avatar dekudekuplex avatar dpk avatar johnwcowan avatar jrincayc avatar kevinwortman avatar kumoyuki avatar lassik avatar medernach avatar rgherdt avatar samdphillips avatar stevenganz avatar wayne avatar willclinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

r7rs-work's Issues

scheme-report-environment instead of null-environment in r7rs small

I think I found an error in https://github.com/johnwcowan/r7rs-spec/blob/errata/spec/r7rs.pdf . On page 55 I see this:

(scheme-report-environment version)
...
The effect of defining or assigning (through the use of eval)
an identifier bound in a scheme-report-environment (for
example car) is unspecified.
...
(null-environment version)
...
The effect of defining or assigning (through the use of eval)
an identifier bound in a scheme-report-environment (for
example car) is unspecified

It seems in last sentence null-environment should be

Small errors in R7RS small

In R7RS small, § 1.3.1, The full list all the standard libraries should be The full list of all the standard libraries.
In § 1.3.4, "40." should be "40". - the English custom to move punctuation inside quote signs is confusing here, especially to people from other cultures. Elsewhere (e.g. "(8 13)". in § 3.3 it is well done correctly.
In § 3.2, eof and null are interchanged - or otherwise the corresponding predicates are.
§ 3.5 seems to be missing rules for cond-expand. It also seems to be missing a rule -> , capturing the case of a clause with an empty expression list.
§ 4.2.1 - cond: In ( => ), what if returns multiple values, and can take them?
§ 4.2.1 - case: What if yields 0 values?

(Also, I'd prefer to be mentioned as J. A. "Biep" Durieux rather than just Biep Durieux.)

"Each use of a variable is associated with a lexically apparent binding of that variable" is wrong

In https://github.com/johnwcowan/r7rs-spec/blob/errata/spec/r7rs.pdf on page 5 I see: "Each use of a variable is associated with a lexically apparent binding of that variable". My interpretation of this sentence is: "It is possible to find binding (if it exists) of any used variable (i. e. to find place where the variable was introduced) merely by parsing, without need to evaluate anything". But this is not true! Consider this code:

(define-syntax dd (syntax-rules () ((dd x) (define x 0))))
(dd xx)
xx

(I tested this code on mit-scheme.)

It is not possible to find binding for variable xx merely by parsing, you need to actually expand macros dd for this. Moreover, syntax-rules are based on term rewriting, which are Turing complete! I. e. you need to evaluate Turing-complete sublanguage to find a binding!

Consider this more complex example:

(define-syntax if-add-peano (syntax-rules (succ zero)
  ((if-add-peano zero     zero     zero     a b) a)
  ((if-add-peano (succ x) zero     (succ y) a b) (if-add-peano x zero y a b))
  ((if-add-peano x        zero     y        a b) b)
  ((if-add-peano x        (succ y) z        a b) (if-add-peano (succ x) y z a b))
))
(if-add-peano (succ (succ zero)) (succ (succ zero)) (succ (succ (succ (succ zero)))) (define xxx 33) (begin))
(write xxx)

(Tested on mit-scheme.)

Here we verify that 2 + 2 = 4 using Peano arithmetic. And if so, we define xxx as 33. So, Scheme implementation should perform this complex macro expanding just to know whether xxx is defined.

So, please remove or change somehow that phrase "Each use of a variable is associated with a lexically apparent binding of that variable" and similar phrases

Custom Reader

Hello,

Apologies if this is not the best place to propose this idea, but I have thought of two ways that I think R7RS could sensibly allow for custom readers in certain contexts. To be clear, when I say "reader", I mean a procedure which receives a port, and returns s-exps based on the content of that port until it reaches an eof-object, and to customize the reader, I mean to replace the behavior of read from (scheme read) with the behavior of a different procedure.

One way would be to provide a similar form to include, that takes an extra reader argument. Perhaps it could be called include-with-reader. It would be ideal for this to be an additional library declaration, so that people could use different languages for library definitions.

For example:

foo.py:

def greet_person(name):
    display(string_append("Hello, ", name, "!\n"))

foo.sld:

(define-library (foo)
  (export (rename (greet_person greet-person)))
  (import (rename (scheme base) (string-append string_append) (define def))
          (scheme write)
	  (rename (python read) (read python-reader)))
  (include-with-reader "foo.py" python-reader))
> (import (foo))
> (greet-person "Robby")
Hello, Robby!

Another interesting way to specify a custom reader is to add a new reader parameter object to (scheme read). The default value of this object would be a procedure that behaves as read currently does, and the behavior of read would be modified to apply the procedure in the reader parameter.

(define-library (scheme read)
  (export read
          reader)
  (import (scheme base))
  (begin
    (define reader
      (make-parameter
        (lambda port
	  ;; current implementation of read
	)))
    (define (read . port)
      (apply (reader) port))))

This could be interesting as it would allow systems that use read internally to be extended to handle new kinds of data. For example, it may be useful to specify json-read from SRFI 180 as the reader parameter value, to handle JSON data in a context that otherwise could not.

The problem I see with going this route (at least exclusively this route) is that there does not seem to be a good way to leverage this to implement a library. For example, given foo.py from above, if we try to do the following:

foo.sld:

(define-library (foo)
  (export (rename (greet_person greet-person)))
  (import (rename (scheme base) (string-append string_append) (define def))
          (scheme write)
	  (rename (python read) (read python-reader)))
  (begin
    (parameterize ((reader python-reader))
      (include "foo.py"))))

The definition of greet_person will be captured by the body of the parameterize, rather than expanding into a top-level definition in (foo). Thus, the export would fail. Maybe there is another way that a reader parameter could be used with include for the body of a library like this, but I cannot think of a way that seems great.

I think both of these features would be interesting to see in R7RS large, but the former is more interesting to me personally.

Thoughts?

R7RSHomePage updates

@johnwcowan, can you check that the URLs on R7RSHomePage.md are up to date? Some of them still point to BitBucket.

That document should probably also link to the repo's top-level https://github.com/johnwcowan/r7rs-work URL for people who want to browse the pre-SRFIs.

Linking to the nice PDF someone made of the Red Edition a few months back would also be great.

We should really establish that files.scheme.org so we can get easier permanent URLs for our PDFs.

cc @filiplajszczak via schemedoc/awesome-scheme#60

UrisCowan data scheme parsing parameters

Currently, uri-parse-data returns two values: media type and decoded data. However, media type itself can have multiple parameters encoded within. Maybe it'd be sensible to return 3 values, and add parsed parameters as an alist to the returned value set? Parameter parsing needs to be done either way to pull out charset parameter in case of textual content.

UrisCowan automatic decoding

Sequences of %-escapes representing non-ASCII characters are replaced by the corresponding Unicode character.

This needs clarity, I think. Does this mean non-standard %uxxxx format? %xx encoded bytes with some assumption of encoding (eg. utf8)? Both?

More meaningful names for Red Libraries?

Hi, @johnwcowan! I know I am coming late to the subject, but still is there any discussion on the Red Libraries names?

Scheme is such an expressive language and it seems (at least to me) far way more intelligible, instead of (scheme ilist) and (scheme ideque), to use (scheme immutable list) and (scheme immutable deque), and (scheme immutable ...) for the many other immutable data structures yet to come. The same applies to (scheme lseq): R7RS-small already have (scheme lazy), so (scheme lazy sequence) or, if typing is really a constraint, (scheme lazy seq), seems much more Scheme-ish IMHO.

I really assume there have been a long discussion about naming libraries and I definitely do not want to seem disrespectful. But I am a hobbyist and being so makes me feel responsible to make the entrance (and stay) of the many newcomers of the future as comfortable as possible. Scheme, due to its flexibility, including the many characters allowed for its identifiers, has a huge advantage over those fancy other languages we see out there. We do not fear long names, as far as they bring clarity, preciseness and call-with-current-continuation :)

What do you think?

Duplicate copies of Twinjo spec

There are copies of Twinjo and TwinjoLib in r7rs-work and s-expressions/twinjo. Are the ones in r7rs-work still relevant?

https and user-friendliness of the r7rs URLs.

At the moment the following urls would be expected of the r7rs project. The checkmark means that the URL exists and is working in an expected way.

What needs to be done to implement the websites now working at the moment?

Bottom Scheme Discussion (was: BottomScheme has read-char and write-char, but not chars)

BottomScheme has read-char and write-char, but not the char type, which would probably result in strange incompatibilities.

For example, in R7RS, (write-char (substring "abc" 1 2)) is an error, but I think as BottomScheme is specified, that is the correct way to print part of a string.

If compatibility with R7RS is desired, I think using write-string and read-string might be better.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.