Skip to content

Prefix unused bound variables with underscore #48

@oubiwann

Description

@oubiwann

Problem

In underack.cables:init/1, variables are bound but not used:

(defun init
  (((= \`#m(ets #m(name ,table-name opts ,table-opts)) state))
   (log-debug "Initialising ~s ..." \`(,(NAME)))
   (erlang:process_flag 'trap_exit 'true)
   \`#(ok ,state)))

table-name and table-opts are bound but never used in the function body.

Suggested Fix

Prefix with underscore to indicate intentionally unused:

(defun init
  (((= \`#m(ets #m(name ,_table-name opts ,_table-opts)) state))
   ...))

Or simplify the pattern if those bindings aren't needed:

(defun init
  ((state)
   ...))

Files

  • src/underack/cables.lfe
  • Review other files for similar issues

Priority

P1 - Code clarity and compiler warning avoidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions