Giter Site home page Giter Site logo

arc-compat's Introduction

arc-compat

Arc compatible package for CL


Licence: Perl Foundations’s Artistic License 2.0.


Example:

(in-package :arc-user)
(named-readtables:in-readtable :arc)


(map [car cdr._] '((1 2) (1 2) (1 2) (1 2) (1 2)))
;=>  (2 2 2 2 2)


(map #'list:car:cdr '((1 2) (1 2) (1 2) (1 2) (1 2)))
;=>  ((2) (2) (2) (2) (2))


(accum acc
  (each e (range 0 10)
    (when odd.e acc.e)))
;=>  (1 3 5 7 9)

arc-compat's People

Contributors

g000001 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

nyuichi

arc-compat's Issues

The test for SINCE can fail sometimes.

The current test for since currently does;
(== 1 (let t0 (seconds) (sleep 1) (since t0))
which may fail if the first seconds happens just before the switch to returning the next second, and the sleep
plus the rest of processing takes a little more a second. It fails to me once in several tens runs of the test-suite.
I suggest change it like this:

 (tst since
    (== t (let t0 (seconds) (sleep 0.99)
            (cl:let ((s1 (since t0)))
              (or (cl:= s1 1)
                  (and (cl:= s1 0)
                       (progn  (sleep 0.1)
                         (cl:= (since t0) 1))))))))

The tests effectively assume ordering of items in hash-tables

Both the test OBJ in table.lisp and the test DEDUP in list.lisp (last check with the result of calling obj) effectively assume specific order of items inside a hash-table, because they generate a list by mapping over a hash table and compare the result to a list with a specific order. That cause these tests to fail unpredictably.

They may be other tests with the same issue, I didn't check systemetically.

WITH-OPEN-STREAM may be used incorrectly in call-w/stdin and call-w/stdout

in file ac.lisp, the functions arc:call-w/stdin and arc:call-w/stdout both use with-open-stream, which closes the stream on exit. That is probably not the intention.

It specifically goes wrong when arc:call-w/stdout is called to output into a string stream and then getting the string of the stream, because calling get-output-stream-string on a closed stream gives "unspecifed results" (see entry for CLOSE in the ANSI standard). The test (tst call-w/stdout .. ) in test-after.lisp fails because of that on LispWorks.

If the closing of the stream intentional, then the test needs to be changed such that the call to get-output-stream-string (arc:inside, which is fbound to #'get-output-stream-string) needs to be inside the with-open-stream, so the call happens before the stream is closed.

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.