Skip to content

Can't use a built-in element such as "title" as argument in define-element #5

Description

@vindarel

Hello,

I tried Flute (which looks great and easy to use, thanks and well done) and I stumbled across a symbol conflict.

I wanted to define an element which takes "title" as argument, but it is not possible:

(define-element page (title)
  (h (html (h1 title))))

throws:

; in: DEFINE-ELEMENT PAGE
;     (FLUTE:DEFINE-ELEMENT TESTFLUTE::PAGE
;         (TESTFLUTE::TITLE)
;       (FLUTE:H
;         (TESTFLUTE::HTML (TESTFLUTE::H1 TESTFLUTE::TITLE))))
; --> LET LET PROGN DEFUN PROGN SB-IMPL::%DEFUN SB-INT:NAMED-LAMBDA 
; --> FUNCTION BLOCK MULTIPLE-VALUE-BIND MULTIPLE-VALUE-CALL FUNCTION 
; --> LET SETF LET* LAMBDA FUNCTION 
; ==>
;   (LET ((TESTFLUTE::TITLE
;          (FLUTE:ATTR FLUTE:ATTRS
;                      (ALEXANDRIA.0.DEV:MAKE-KEYWORD 'TESTFLUTE::TITLE))))
;     (PROGN
;      (FLUTE:H
;        (TESTFLUTE::HTML (TESTFLUTE::H1 TESTFLUTE::TITLE)))))
; 
; caught STYLE-WARNING:
;   The variable TITLE is defined but never used.

; file: /tmp/slimeY8QlRC
; in: DEFINE-ELEMENT PAGE
;     (FLUTE:H
;       (TESTFLUTE::HTML (TESTFLUTE::H1 TESTFLUTE::TITLE)))
; --> PROGN FLUTE:HTML 
; ==>
;   (FLUTE:H1 FLUTE:TITLE)
; 
; caught WARNING:
;   undefined variable: FLUTE:TITLE
; 
; compilation unit finished
;   Undefined variable:
;     FLUTE:TITLE
;   caught 1 WARNING condition
;   caught 1 STYLE-WARNING condition

Using img as argument gives the same error, using id is OK (it is not a builtin).

Not being able to use "title" is problematic, being such common :/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions