alex-gutev / generic-cl Goto Github PK
View Code? Open in Web Editor NEWGeneric function interface to standard Common Lisp functions
Home Page: https://alex-gutev.github.io/generic-cl/
License: MIT License
Generic function interface to standard Common Lisp functions
Home Page: https://alex-gutev.github.io/generic-cl/
License: MIT License
cl-arrows is abandoned and worse of all, has no license, which effectively makes all dependencies non-free software :(
https://gitlab.com/Harleqin/arrows.git can be used as a drop in replacement for static-dispatch dispatch at least, but there may be more work involved for generic-cl.
I'm trying to package generic-cl for Guix and tests fail with:
Running a test file '/gnu/store/rvs23hwr44n05am5bxlx8jiaxwx3bvbc-sbcl-generic-cl-0.7.1/share/common-lisp/sbcl/generic-cl/test/collector.lisp'
.
Did 1 checks. (planned NIL tests)
Pass: 0 ( 0%)
Fail: 0 ( 0%)
Running a test file '/gnu/store/rvs23hwr44n05am5bxlx8jiaxwx3bvbc-sbcl-generic-cl-0.7.1/share/common-lisp/sbcl/generic-cl/test/sequences.lisp'
Heap exhausted during garbage collection: 0 bytes available, 64 requested.
Gen Boxed Code Raw LgBox LgCode LgRaw Pin Alloc Waste Trig WP GCs Mem-age
1 5650 0 21429 0 0 0 13 886995104 329568 639307012 27079 1 1.6354
2 8976 2 23571 5124 0 0 62 1226622080 7846784 2000000 37673 0 0.2090
3 0 0 0 0 0 0 0 0 0 2000000 0 0 0.0000
4 0 0 0 0 0 0 0 0 0 2000000 0 0 0.0000
5 0 0 0 0 0 0 0 0 0 2000000 0 0 0.0000
6 494 2 222 55 0 10 0 24975664 681680 2000000 783 0 0.0000
Total bytes allocated = 2138592848
Dynamic-space-size bytes = 2147483648
GC control variables:
*GC-INHIBIT* = true
*GC-PENDING* = true
*STOP-FOR-GC-PENDING* = false
fatal error encountered in SBCL pid 27 tid 27:
Heap exhausted, game over.
0: SB-REGALLOC::GROW-SC, pc = 0x5241a218, fp = 0x7ffff79755f0
1: SB-REGALLOC::PACK-TN, pc = 0x52106d6c, fp = 0x7ffff79756a0
2: (FLET SB-REGALLOC::PACK-TNS :IN SB-REGALLOC::PACK), pc = 0x52107233, fp = 0x7ffff7975750
3: SB-REGALLOC::PACK, pc = 0x521061c6, fp = 0x7ffff7975800
4: SB-C::%COMPILE-COMPONENT, pc = 0x5221e8b8, fp = 0x7ffff7975888
5: SB-C::COMPILE-COMPONENT, pc = 0x5212ed31, fp = 0x7ffff79758f0
6: SB-C::%COMPILE, pc = 0x52220a53, fp = 0x7ffff7975960
7: (FLET "LAMBDA49431" :IN "SYS:SRC;COMPILER;TARGET-MAIN.LISP"), pc = 0x520feb9b, fp = 0x7ffff7975a38
8: (FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT), pc = 0x5217b125, fp = 0x7ffff7975ae0
9: SB-C::COMPILE-IN-LEXENV, pc = 0x520ff6d8, fp = 0x7ffff7975c10
10: SB-IMPL::%SIMPLE-EVAL, pc = 0x5242d31d, fp = 0x7ffff7975c60
11: SB-INT::SIMPLE-EVAL-IN-LEXENV, pc = 0x521415bb, fp = 0x7ffff7975d30
12: SB-INT::SIMPLE-EVAL-IN-LEXENV, pc = 0x52140d16, fp = 0x7ffff7975df8
13: SB-EXT::EVAL-TLF, pc = 0x52267b73, fp = 0x7ffff7975e20
14: (LABELS SB-FASL::EVAL-FORM :IN SB-INT::LOAD-AS-SOURCE), pc = 0x521aa168, fp = 0x7ffff7976050
15: (LAMBDA (SB-KERNEL::FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT::LOAD-AS-SOURCE), pc = 0x521a99f7, fp = 0x7ffff79761a0
16: SB-C::%DO-FORMS-FROM-INFO, pc = 0x5217ba17, fp = 0x7ffff7976260
17: SB-INT::LOAD-AS-SOURCE, pc = 0x521a9552, fp = 0x7ffff7976420
18: (FLET SB-FASL::THUNK :IN LOAD), pc = 0x520e5068, fp = 0x7ffff7976528
19: SB-FASL::CALL-WITH-LOAD-BINDINGS, pc = 0x5228e1b8, fp = 0x7ffff79765b0
20: (FLET SB-FASL::LOAD-STREAM :IN LOAD), pc = 0x520e5225, fp = 0x7ffff79766b8
21: LOAD, pc = 0x520e4b1d, fp = 0x7ffff79767a0
22: UIOP/UTILITY::CALL-WITH-MUFFLED-CONDITIONS, pc = 0x52a86b37, fp = 0x7ffff7976828
23: (SB-PCL::EMF ASDF/ACTION::PERFORM), pc = 0x52b133c4, fp = 0x7ffff7976870
24: (LAMBDA () :IN ASDF/ACTION::CALL-WHILE-VISITING-ACTION), pc = 0x52ad0883, fp = 0x7ffff79768f0
25: PROVE.ASDF::RUN-TEST-SYSTEM, pc = 0x52d060a1, fp = 0x7ffff7976ab0
26: PROVE.ASDF::RUN, pc = 0x52d06c5e, fp = 0x7ffff7976bc0
27: (SB-PCL::EMF ASDF/ACTION::PERFORM), pc = 0x52b13468, fp = 0x7ffff7976c10
28: (LAMBDA () :IN ASDF/ACTION::CALL-WHILE-VISITING-ACTION), pc = 0x52ad0883, fp = 0x7ffff7976c90
29: (SB-PCL::FAST-METHOD ASDF/ACTION::PERFORM-WITH-RESTARTS :AROUND (T T)), pc = 0x52ad7cb1, fp = 0x7ffff7976e00
30: (SB-PCL::FAST-METHOD ASDF/PLAN::PERFORM-PLAN (T)), pc = 0x52aea1c5, fp = 0x7ffff7976e40
31: (FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT), pc = 0x5217af5f, fp = 0x7ffff7976f20
32: (SB-PCL::FAST-METHOD ASDF/PLAN::PERFORM-PLAN :AROUND (T)), pc = 0x52ae9dd8, fp = 0x7ffff7976f90
33: (SB-PCL::FAST-METHOD ASDF/OPERATE::OPERATE (ASDF/OPERATION::OPERATION ASDF/COMPONENT::COMPONENT)), pc = 0x52aec1f9, fp = 0x7ffff7976fe0
34: (SB-PCL::EMF ASDF/OPERATE::OPERATE), pc = 0x52b10463, fp = 0x7ffff7977040
35: (LAMBDA () :IN ASDF/OPERATE::OPERATE), pc = 0x52aeb8c1, fp = 0x7ffff7977108
36: (SB-PCL::FAST-METHOD ASDF/OPERATE::OPERATE :AROUND (T T)), pc = 0x52aeb141, fp = 0x7ffff79771d0
37: (SB-PCL::EMF ASDF/OPERATE::OPERATE), pc = 0x52b10463, fp = 0x7ffff7977230
38: (LAMBDA () :IN ASDF/OPERATE::OPERATE), pc = 0x52aeb8c1, fp = 0x7ffff79772f8
39: (SB-PCL::FAST-METHOD ASDF/OPERATE::OPERATE :AROUND (T T)), pc = 0x52aeb141, fp = 0x7ffff79773c0
40: ASDF/SESSION::CALL-WITH-ASDF-SESSION, pc = 0x52ac428b, fp = 0x7ffff79775b8
41: (LAMBDA () :IN ASDF/OPERATE::OPERATE), pc = 0x52aeba92, fp = 0x7ffff7977680
42: ASDF/SESSION::CALL-WITH-ASDF-SESSION, pc = 0x52ac428b, fp = 0x7ffff7977880
43: (SB-PCL::FAST-METHOD ASDF/OPERATE::OPERATE :AROUND (T T)), pc = 0x52aeb141, fp = 0x7ffff7977948
44: ASDF/OPERATE::TEST-SYSTEM, pc = 0x52aedf03, fp = 0x7ffff7977980
45: SB-INT::SIMPLE-EVAL-IN-LEXENV, pc = 0x52140de6, fp = 0x7ffff7977a48
46: EVAL, pc = 0x5203cae3, fp = 0x7ffff7977a60
47: SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS, pc = 0x52205c5c, fp = 0x7ffff7977c10
48: SB-IMPL::TOPLEVEL-INIT, pc = 0x5216ebee, fp = 0x7ffff7977dd8
49: (FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP), pc = 0x5252b105, fp = 0x7ffff7977e70
50: (FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-IMPL::START-LISP), pc = 0x5252aed6, fp = 0x7ffff7977f30
51: SB-IMPL::START-LISP, pc = 0x5252acf9, fp = 0x7ffff7977fc8
command "/gnu/store/grbddz6cbdsn3cmh3ywvkm29wdh28j97-sbcl-2.0.10/bin/sbcl" "--non-interactive" "--eval" "(require :asdf)" "--eval" "(asdf:load-asd (truename \"/gnu/store/rvs23hwr44n05am5bxlx8jiaxwx3bvbc-sbcl-generic-cl-0.7.1/share/common-lisp/sbcl/generic-cl/generic-cl.asd\"))" "--eval" "(asdf:load-asd (truename \"/gnu/store/rvs23hwr44n05am5bxlx8jiaxwx3bvbc-sbcl-generic-cl-0.7.1/share/common-lisp/sbcl/generic-cl/generic-cl.util.asd\"))" "--eval" "(when (uiop:file-exists-p \"generic-cl-tests.asd\") (asdf:load-asd (truename \"generic-cl-tests.asd\")))" "--eval" "(when (uiop:file-exists-p \"generic-cl-test.asd\") (asdf:load-asd (truename \"generic-cl-test.asd\")))" "--eval" "(when (uiop:file-exists-p \"tests.asd\") (asdf:load-asd (truename \"tests.asd\")))" "--eval" "(when (uiop:file-exists-p \"test.asd\") (asdf:load-asd (truename \"test.asd\")))" "--eval" "(asdf:test-system \"generic-cl\")" failed with status 1
Running the tests I get these issues:
In test "elt" in "test/sequences.lisp" there is a loop with a DO clause preceding WITH clauses. That is illegal, because WITH is a variable-clause, while DO is a main-clause, and all main-clauses have to be after all variable-clauses, because LOOP syntax is defined as
loop [name-clause] {variable-clause}* {main-clause}* => result*
in: http://www.lispworks.com/documentation/HyperSpec/Body/m_loop.htm
That gives an error on LispWorks.
Moving the DO clause after the WITH clause makes it work.
The test "doseq!-hash-table" in "test/iterator.lisp" fails because the NEW-MAP has the original values from MAP, rather than the updated values (X1 and X2). That happens because (setf at)
on HASH-TABLE-ITERATOR in "src/map/hash-tables.lisp" sets the value in the hash-table, but does not affect the list inside the iterator itself (in the CONS slot). So when it sets the value in NEW-MAP by (setf (get key new-map) (cdr item))
, the (cdr item)
sees the old value even though it just did a setf to a new value (because AT itself is the one for LIST-ITERATOR that reads from the CONS list). It seems that either the (setf at)
method has to set the value in the CONS too, or there need to be an AT method that does a gethash.
the test "do-sequences!" in "test/iterator.lisp" also fails on the hash-map, I think the same issue as in (2).
Are there any reasons for not defining get
and corresponding setf
expanders for other objects? Arrays are the omission I miss most, but it might make sense to provide implementations for lists (treating the key as an integer index) and maybe even slots (like access does).
I can work on this if we're open to it.
I get the following error
Lock on package COMMON-LISP violated when setting the compiler-macro-function of MAKE-LOAD-FORM while in package GENERIC-CL.IMPL.
when running (ql:quickload :generic-cl)
with versions of generic-cl 0.2 or higher.
Steps to reproduce:
The problem can be resolved by selecting a restart, but the consequences are undefined according to the standard. Is this intentional behavior, and if so, which restart do you recommend be used?
Still packaging generic-cl in Guix, it turns out that :serial t
is not properly set: it must be set for the "src" module instead of the generic-cl system (which has only 1 component).
cl-environments suffers from the same issue.
Funny thing is, it only fails when building the package for Guix. It works when I compile the generic-cl system locally with SBCL. Any clue why? ASDF 3.3.3 is used in both cases.
cl-arrows does not have a license file which makes it proprietary software.
Consider switching to another arrow macro library, such as arrows, arrow-macros, or (shameless plug) binding-arrows.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.