Duplicate function names in FLET are accepted silently.

Bug #841246 reported by Jean-Philippe Paradis
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

Bug Description

What I do:
(flet ((foo () 1)
       (foo () 2))
  (foo))
=> 2

What happens:
No ERROR or WARNING of any kind is signaled.

What I expected to happen:
I expected to get at least a STYLE-WARNING.

Analysis:
I could not find anything in the CLHS regarding duplicate function names in a FLET, but here's a very similar form:
(let ((foo 1)
      (foo 2))
  foo)
error --> The variable FOO occurs more than once in the LET.

Given that LET and FLET work in exactly analogous ways as it relates to (parallel) binding of names (except they simply do so in different namespaces), I think duplicate binding names in FLET should be treated the same as duplicate binding names in LET.

SBCL version: 1.0.51
uname -a: Linux dynamorph 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686 GNU/Linux

*features*:
(:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF2 :ASDF :ASDF-UNIX :ANSI-CL
 :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE
 :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86 :UNIX :ELF :LINUX
 :SB-THREAD :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD
 :C-STACK-IS-CONTROL-STACK :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP
 :RAW-INSTANCE-INIT-VOPS :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
 :LINKAGE-TABLE :OS-PROVIDES-DLOPEN :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC
 :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL)

Changed in sbcl:
importance: Undecided → Wishlist
importance: Wishlist → Low
status: New → Triaged
Revision history for this message
Douglas Katzman (dougk) wrote :
Changed in sbcl:
status: Triaged → Fix Released
Revision history for this message
Jean-Philippe Paradis (hexstream) wrote : Re: [Bug 841246] Re: Duplicate function names in FLET are accepted silently.

Thank you, it's always fun to get nice surprise notifications like this! ;)

On Fri, Jan 21, 2022, 8:35 PM Douglas Katzman <email address hidden>
wrote:

> Fixed thusly- https://sourceforge.net/p/sbcl/sbcl/ci/bf0038ec
>
> ** Changed in: sbcl
> Status: Triaged => Fix Released
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/841246
>
> Title:
> Duplicate function names in FLET are accepted silently.
>
> Status in SBCL:
> Fix Released
>
> Bug description:
> What I do:
> (flet ((foo () 1)
> (foo () 2))
> (foo))
> => 2
>
> What happens:
> No ERROR or WARNING of any kind is signaled.
>
> What I expected to happen:
> I expected to get at least a STYLE-WARNING.
>
> Analysis:
> I could not find anything in the CLHS regarding duplicate function names
> in a FLET, but here's a very similar form:
> (let ((foo 1)
> (foo 2))
> foo)
> error --> The variable FOO occurs more than once in the LET.
>
> Given that LET and FLET work in exactly analogous ways as it relates
> to (parallel) binding of names (except they simply do so in different
> namespaces), I think duplicate binding names in FLET should be treated
> the same as duplicate binding names in LET.
>
> SBCL version: 1.0.51
> uname -a: Linux dynamorph 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29
> 21:08:37 UTC 2011 i686 GNU/Linux
>
> *features*:
> (:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF2 :ASDF :ASDF-UNIX
> :ANSI-CL
> :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS
> :SB-UNICODE
> :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86 :UNIX :ELF
> :LINUX
> :SB-THREAD :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD
> :C-STACK-IS-CONTROL-STACK :COMPARE-AND-SWAP-VOPS
> :UNWIND-TO-FRAME-AND-CALL-VOP
> :RAW-INSTANCE-INIT-VOPS :STACK-ALLOCATABLE-CLOSURES
> :STACK-ALLOCATABLE-VECTORS
> :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS
> :ALIEN-CALLBACKS
> :CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-BARRIER-VOPS
> :MULTIPLY-HIGH-VOPS
> :LINKAGE-TABLE :OS-PROVIDES-DLOPEN :OS-PROVIDES-DLADDR
> :OS-PROVIDES-PUTWC
> :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sbcl/+bug/841246/+subscriptions
>
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.