Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotable _ weirdness #60

Open
slyrus opened this issue Dec 31, 2020 · 3 comments
Open

dotable _ weirdness #60

slyrus opened this issue Dec 31, 2020 · 3 comments

Comments

@slyrus
Copy link

slyrus commented Dec 31, 2020

I haven't looked at the expanded code yet, but when I try to load hash-set.lisp I get warnings of the following sort:

; processing (DEFUN |INTER#| ...)

; file: /home/sly/quicklisp/dists/quicklisp/software/rutils-20201220-git/core/hash-set.lisp
; in: DEFUN |INTER#|
;     (RUTILS.HASH-TABLE:DOTABLE (RUTILS.HASH-SET::ITEM RUTILS.HASH-SET::_
;                                 RUTILS.HASH-SET::SET1)
;       (WHEN (GETHASH RUTILS.HASH-SET::ITEM RUTILS.HASH-SET::SET2)
;         (RUTILS.HASH-SET:|ADD#| RUTILS.HASH-SET::ITEM SET)))
; --> LET BLOCK ETYPECASE LET COND IF PROGN MAPHASH LET* 
; ==>
;   (SB-KERNEL:%COERCE-CALLABLE-TO-FUN
;    (LAMBDA (RUTILS.HASH-SET::ITEM RUTILS.HASH-SET::_)
;      (DECLARE (IGNORE RUTILS.BIND:_))
;      (WHEN (GETHASH RUTILS.HASH-SET::ITEM RUTILS.HASH-SET::SET2)
;        (RUTILS.HASH-SET:|ADD#| RUTILS.HASH-SET::ITEM SET))))
; 
; caught STYLE-WARNING:
;   IGNORE declaration for an unknown variable: _
; 
; caught STYLE-WARNING:
;   The variable _ is defined but never used.

This suggests that the scope of _ is somehow wrong.

@mirkov
Copy link

mirkov commented Jan 25, 2022

I have a similar issue. I use _ in bind and get the same warning. I imported _, and also used rutils:_, and none helped.

Macro-expanding, I don't see code dealing with _

I looked at the source code, and something like that should happen. If I have time, I will try to trace the issue. No promises.

Note that I have raised a related issue that was closed as resolved.

Right now I am drawing a blank on what I could be doing wrong again. Let me think a bit about this.

@jcguu95
Copy link

jcguu95 commented Apr 29, 2024

I can reproduce a similar issue on version 5.2.1 by

(let ((rez ()))
  (dotable (k _ #h(1 :foo 2 :bar) rez)
    (when (oddp k)
      (push _ rez))))

Notice that the issue would not happen if _ is replaced to v, vv, apple.

@jcguu95
Copy link

jcguu95 commented Apr 29, 2024

Ah, actually, this is a non-issue. The symbol _ is deliberately ignored (c.f. search for _ in the tutorial).

That means if you write (dotable (k _ #h(..).., you should not use _ later in the body.

I suggest to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants