exercism / exercism/common-lisp-representer

Symbols in package export are not matched against symbols in defuns

Offen
#30 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
x:action/improve x:knowledge/none x:module/representer
Vorherrschende Sprache
Common Lisp
Sterne
2
Forks
7
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

For example as reported by exercism.lol the submission:

```lisp
(defpackage :socks-and-sexprs
(:use :cl)
(:export :lennys-favorite-food :lennys-secret-keyword
:is-an-atom-p :is-a-cons-p :first-thing :rest-of-it))

(in-package :socks-and-sexprs)

;; Evaluates to some symbol (not a keyword)
(defun lennys-favorite-food () 'wild)

;; Evaluates to some keyword
(defun lennys-secret-keyword () :stuff)

;; Evaluates to T if THING is an atom, NIL otherwise
(defun is-an-atom-p (thing) (atom thing))

;; Evaluates to T if THING is a cons, NIL otherwise
(defun is-a-cons-p (thing) (consp thing))

;; Evaluates to the first part of CONS
(defun first-thing (cons) (car cons))

;; Evaluates to the 'rest' of the CONS
(defun rest-of-it (cons) (cdr cons))
```

Is represented as:

```lisp
((DEFPACKAGE :SOCKS-AND-SEXPRS-0
(:EXPORT :SOCKS-AND-SEXPRS-1
:SOCKS-AND-SEXPRS-2
:SOCKS-AND-SEXPRS-3
:SOCKS-AND-SEXPRS-4
:SOCKS-AND-SEXPRS-5
:SOCKS-AND-SEXPRS-6)
(:USE :SOCKS-AND-SEXPRS-7))
(IN-PACKAGE :SOCKS-AND-SEXPRS-0)
(DEFUN :SOCKS-AND-SEXPRS-8
((:REQUIRED NIL) (:OPTIONAL NIL) (:REST NIL) (:KEYWORD NIL) (:AUX NIL)
(:ALLOW-OTHER-KEYS NIL))
(:DOCSTRING NIL)
(:DECLARE NIL)
('WILD))
(DEFUN :SOCKS-AND-SEXPRS-9
((:REQUIRED NIL) (:OPTIONAL NIL) (:REST NIL) (:KEYWORD NIL) (:AUX NIL)
(:ALLOW-OTHER-KEYS NIL))
(:DOCSTRING NIL)
(:DECLARE NIL)
(:STUFF))
(DEFUN :SOCKS-AND-SEXPRS-10
((:REQUIRED (:SOCKS-AND-SEXPRS-11)) (:OPTIONAL NIL) (:REST NIL)
(:KEYWORD NIL) (:AUX NIL) (:ALLOW-OTHER-KEYS NIL))
(:DOCSTRING NIL)
(:DECLARE NIL)
((ATOM :SOCKS-AND-SEXPRS-11)))
(DEFUN :SOCKS-AND-SEXPRS-12
((:REQUIRED (:SOCKS-AND-SEXPRS-11)) (:OPTIONAL NIL) (:REST NIL)
(:KEYWORD NIL) (:AUX NIL) (:ALLOW-OTHER-KEYS NIL))
(:DOCSTRING NIL)
(:DECLARE NIL)
((CONSP :SOCKS-AND-SEXPRS-11)))
(DEFUN :SOCKS-AND-SEXPRS-13
((:REQUIRED (:SOCKS-AND-SEXPRS-14)) (:OPTIONAL NIL) (:REST NIL)
(:KEYWORD NIL) (:AUX NIL) (:ALLOW-OTHER-KEYS NIL))
(:DOCSTRING NIL)
(:DECLARE NIL)
((CAR :SOCKS-AND-SEXPRS-14)))
(DEFUN :SOCKS-AND-SEXPRS-15
((:REQUIRED (:SOCKS-AND-SEXPRS-14)) (:OPTIONAL NIL) (:REST NIL)
(:KEYWORD NIL) (:AUX NIL) (:ALLOW-OTHER-KEYS NIL))
(:DOCSTRING NIL)
(:DECLARE NIL)
((CDR :SOCKS-AND-SEXPRS-14))))
```

Note the exported symbols in the DEFPACKAGE are not matching those in the DEFUNs below.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.