(setf lparen '#\( ) fails

Bug #1753341 reported by murray wolinsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

Type

(setf lparen '#\( )

in the repl. In clisp, this behaves as I expect it to. In sbcl, it fails.

Revision history for this message
Stas Boukarev (stassats) wrote :

Works as expected in SBCL.

Changed in sbcl:
status: New → Invalid
Revision history for this message
murray wolinsky (mbob) wrote : Re: [Bug 1753341] Re: (setf lparen '#\( ) fails

I don't understand. This is what I get:

 It fails in sbcl 1.3.18 and works properly in clisp 2.49.

Does this mean you expect it to fail in sbcl? Why?

18:13:57 ~ 501 > sbcl
This is SBCL 1.3.18, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (setf lparen '#\( )
; in: SETF LPAREN
; (SETF LPAREN '#\()
; ==>
; (SETQ LPAREN '#\()
;
; caught WARNING:
; undefined variable: LPAREN
;
; compilation unit finished
; Undefined variable:
; LPAREN
; caught 1 WARNING condition

#\(
* (quit)
18:14:05 ~ 502 > clisp
  i i i i i i i ooooo o ooooooo ooooo ooooo
  I I I I I I I 8 8 8 8 8 o 8 8
  I \ `+' / I 8 8 8 8 8 8
   \ `-+-' / 8 8 8 ooooo 8oooo
    `-__|__-' 8 8 8 8 8
        | 8 o 8 8 o 8 8
  ------+------ ooooo 8oooooo ooo8ooo ooooo 8

Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010

Type :h and hit Enter for context help.

;; Loading file /Users/murray/.clisprc.lisp ...
;; Loading file /Users/murray/quicklisp/setup.lisp ...
;; Loading file /Users/murray/quicklisp/ASDF.lisp ...
;; Loaded file /Users/murray/quicklisp/ASDF.lisp
;; Loaded file /Users/murray/quicklisp/setup.lisp
;; Loaded file /Users/murray/.clisprc.lisp
[1]> (setf lparen '#\( )
#\(
[2]>

On Sun, Mar 4, 2018 at 5:48 PM, Stas Boukarev <email address hidden> wrote:

> Works as expected in SBCL.
>
> ** Changed in: sbcl
> Status: New => Invalid
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1753341
>
> Title:
> (setf lparen '#\( ) fails
>
> Status in SBCL:
> Invalid
>
> Bug description:
> Type
>
> (setf lparen '#\( )
>
> in the repl. In clisp, this behaves as I expect it to. In sbcl, it
> fails.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sbcl/+bug/1753341/+subscriptions
>

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote :

murray wolinsky <email address hidden> writes:

> I don't understand. This is what I get:

In SBCL, you get some warnings, because what you're doing is assigning
to a variable with no binding. This is (strictly speaking) undefined
behaviour; SBCL does in fact set the SYMBOL-VALUE of LPAREN to what you
ask it to (so it doesn't "fail") but it also tells you that you
shouldn't do that.

To define a global variable, use DEFPARAMETER (and conventionally,
*earmuff* your variable).

Christophe

Revision history for this message
murray wolinsky (mbob) wrote :

Thank you!

I'm new at this -- and probably shouldn't have filed a bug report. I'll be
more careful.

Murray

On Mon, Mar 5, 2018 at 3:41 AM, Christophe Rhodes <
<email address hidden>> wrote:

> murray wolinsky <email address hidden> writes:
>
> > I don't understand. This is what I get:
>
> In SBCL, you get some warnings, because what you're doing is assigning
> to a variable with no binding. This is (strictly speaking) undefined
> behaviour; SBCL does in fact set the SYMBOL-VALUE of LPAREN to what you
> ask it to (so it doesn't "fail") but it also tells you that you
> shouldn't do that.
>
> To define a global variable, use DEFPARAMETER (and conventionally,
> *earmuff* your variable).
>
> Christophe
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1753341
>
> Title:
> (setf lparen '#\( ) fails
>
> Status in SBCL:
> Invalid
>
> Bug description:
> Type
>
> (setf lparen '#\( )
>
> in the repl. In clisp, this behaves as I expect it to. In sbcl, it
> fails.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sbcl/+bug/1753341/+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.