Giter Site home page Giter Site logo

algol60's Introduction

Racket is a general-purpose programming language and an ecosystem for language-oriented programming.

This repository holds the source code for the core of Racket plus some related packages. The rest of the Racket distribution source code is in other repositories, mostly under the Racket GitHub organization.

Quick Start

Pre-built versions of Racket for a variety of operating systems and architectures, as well as convenient source distributions are available at

https://download.racket-lang.org

Racket comes with extensive documentation, including several tutorials. You can read all of this documentation, as well as documentation for third-party packages at

https://docs.racket-lang.org

Building from Source

For information on building Racket from this repository, see the Build Guide.

Contributing

Contribute to Racket by

By making a contribution, you are agreeing that your contribution is licensed under the LGPLv3, Apache 2.0, and MIT licenses. Those licenses are available in this repository in the files racket/src/LICENSE-LGPL.txt, racket/src/LICENSE-APACHE.txt, and racket/src/LICENSE-MIT.txt.

See the Building, Distributing, and Contributing to Racket for more guidance on contributing.

The Friendly Environment Policy contains guidelines on expected behavior within the Racket community.

License

Racket is free software; see LICENSE for more details.

algol60's People

Contributors

calvis avatar dyoo avatar elibarzilay avatar liberalartist avatar melted avatar mflatt avatar paddymahoney avatar rfindler avatar rmculpepper avatar samth avatar shhyou avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

algol60's Issues

Consecutive comments are not accepted

This bug report ist for Racktet 8.13 [cs] from May 2024.
The experimental Algol 60 system does not accept a program text with two consecutive comments.
The following example demonstrates this:

#lang algol60
begin
  comment
      Example of two consecutive comments
    ;
  comment
      Racket Algol 60 does not allow two consecutive comments
    ;
  printsln(`Hello!')
end

The error message is

program.rkt:7:6: parse error near <identifier>
  context...:
   /usr/share/racket/collects/syntax/readerr.rkt:15:2: -raise-read-error
   .../syntax/module-reader.rkt:82:28: read
   /usr/share/racket/collects/syntax/module-reader.rkt:211:2: wrap-internal
   .../syntax/module-reader.rkt:76:9: wrap-internal/wrapper

A parameterless function used as an expression is not called

This bug report demonstrates a problem with parameterless functions.

The following piece of code

#lang algol60
begin
  integer procedure getvalue;
     getvalue := 4;

  integer i;
  i := getvalue;
  printnln(i)
end

fails with this message:
bad value: expected a number, got #<procedure:getvalue>
In my understanding, the problem is that in

i := getvalue;

the function getvalue is not called. Instead, the generated code attempts to assign a function to an integer, which of course fails.
The following modified example works:

#lang algol60
begin
  integer procedure getvalue(arg);
     Boolean arg;
     getvalue := 4;
  integer i;
  i := getvalue(true);
  printnln(i)
end

This works because the call of a function with parameters is unambiguous.

To further clarify the more tricky aspects of parameterless functions, consider the following example:

#lang algol60

begin
  real procedure r;
  begin
    r := 5.0;
  end;

  real procedure p1(rv, rp);
    real rv;
    real procedure rp;
  begin
    p1 := rv + rp
  end;
  printnln(p1(r, r))
end

In Racket Algol 60 this does not work. Note that in the expression
p1(r, r)
the first occurance of r is a function call, while the second isn't. For some reason, Racket Algol 60 does not see the difference because r is parameterless.

Again, the introduction of a dummy parameter (to function r) disambiguates a function call from a reference to a function:

#lang algol60
begin
  real procedure r(x);
    Boolean x;
  begin
    r := 5.0;
  end;

  real procedure p1(rv, rp);
    real rv;
    real procedure rp;
  begin
    p1 := rv + rp(true)
  end;

  printnln(p1(r(true), r))
end

Now a function call requires a syntax that is different from a function reference and everything is fine.

Internal error compiling the "man or boy" test

This program (by Donald Knuth):

begin real procedure A(k, x1, x2, x3, x4, x5);
  value k; integer k;
  real x1, x2, x3, x4, x5;
  begin real procedure B;
    begin k := k - 1;
          B := A := A(k, B, x1, x2, x3, x4)
    end;
    if k <= 0 then A := x4 + x5 else B
  end;
  printnln(A(10, 1, -1, -1, 1, 0))
end

fails to compile, producing the following error:

val: unbound identifier;
 also, no #%top syntax transformer is bound
  context...:
   #(43855 intdef) [common scopes]
  other binding...:
   local
   #(-6132 module base) #(-6129 module) [common scopes]
  common scopes...:
   #(43766 module top-level) #(43776 local) #(43777 intdef)
   #(43781 local) #(43783 intdef) #(43786 local) #(43787 intdef)
   #(43788 local) #(43793 intdef) #(43795 local) #(43796 intdef)
   #(43815 local) #(43816 intdef) #(43818 local) #(43819 intdef)
   #(43822 local) #(43823 intdef) #(43824 local) #(43829 intdef)
   #(43831 local) #(43832 intdef) #(43846 local) #(43847 intdef)
   #(43854 local) in: val

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.