Skip to content

'entity symbol conflict when defcomponent in package

Hello, Thanks for this great library. I believe I found a bug

(ql:quickload :cl-fast-ecs)
(defpackage mygame (:use common-lisp cl-fast-ecs))
(in-package :mygame)
(ecs:defcomponent parent (entity -1 :type ecs:entity))
; in: DEFCOMPONENT PARENT
;     (SB-INT:NAMED-LAMBDA MYGAME::MAKE-PARENT
;         (CL-FAST-ECS:ENTITY &KEY (CL-FAST-ECS:ENTITY -1) &AUX)
;       "Add PARENT component with given values to an entity."
;       (DECLARE (TYPE CL-FAST-ECS:ENTITY CL-FAST-ECS:ENTITY))
;       (BLOCK MYGAME::MAKE-PARENT
;         (CL-FAST-ECS::WITH-STORAGE NIL
;           (CL-FAST-ECS::WITH-CHECKED-ENTITY CL-FAST-ECS:ENTITY
;             (LET* #
;               #
;               #)
;             NIL))))
; 
; caught ERROR:
;   The variable ENTITY occurs more than once in the lambda list.

This error only appear when :

  1. we are in-package
  2. the component name is "entity"
  3. the component type is ecs:entity
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information