Giter Club home page Giter Club logo

Comments (6)

dubek avatar dubek commented on August 25, 2024

Mal (like Clojure) has nil as a separate type/entity from the empty list.

Clojure treats () as the empty list, identical to '() or (quote ()). The last two work in Mal but simply () is treated as a function application and the function is not found (hence the exceptions/crashes).

Note that proper behaviour under bad input is not defined in Mal. For example, + requires two numeric arguments (e.g., (+ 10 26)), but it's undefined what will happen if you pass 0, 1 or 3 arguments to +, or pass string arguments, for example.

from mal.

kanaka avatar kanaka commented on August 25, 2024

@igravious an unquoted empty list is a common enough issue that implementations shouldn't crash. So we'll fix any implementations that crash. In the general case though, @dubek is correct. It's perfectly acceptable for individual mal implementations to do rigorous error checking and useful error reporting, however, requiring that of all implementations is a non-goal. I know it's a little bit unusual, but the goal of mal is to support learning of both Lisp and other languages. Each implementation should run correct mal code the same way, but completeness and productization of the implementation is up to the implementor of each implementation.

I'll keep this issue open to fix empty list unrecoverable crashes.

from mal.

dubek avatar dubek commented on August 25, 2024

I started fixing this in #194 . The travis status there will show how many more implementations need fixing.

from mal.

igravious avatar igravious commented on August 25, 2024

Super. I am still playing with Mal in a serious way. I appreciate the time you have taken to respond.

from mal.

kanaka avatar kanaka commented on August 25, 2024

This should be resolved now.

from mal.

igravious avatar igravious commented on August 25, 2024

Super. Mal has been a brilliant learning tool for me.

from mal.

Related Issues (20)

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.