GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Karsten Johansson (ksaj@infosec.exchange)'s status on Thursday, 03-Apr-2025 17:27:06 JST Karsten Johansson Karsten Johansson
    • screwlisp
    • Alfred M. Szmidt

    Lisp sucks. Tell me what's wrong here:

    (DEFVAR x 0) ; GLOBAL BADNESS STAYS

    (DEFUN dO-StuFf (NUMBer)
    (LET ((rEsUlT 1))
    (DECLARE (SPECIAL X)) ; THIS IS LEGAL HERE
    (SETQ X NUMBER)
    (TAGBODY
    StaRT
    (IF (< X 1) (GO ENDz))
    (SETQ rEsUlT (* rEsUlT X))
    (SETQ x (- x 1)) ; NOTE: STILL USING GLOBAL x INSTEAD OF LOCAL X
    (GO StARt)
    ENDz)
    (pRiNt (lIsT 'FACtoRiAl-oF NUMBER 'iS rEsUlT))))

    (DEFUN nOW-dO-AlL ()
    (LET ((I 0))
    (LOOP
    (WHEN (> i 5) (RETURN))
    (Do-sTUFF i)
    (SETQ i (+ i 1)))))

    (nOW-dO-AlL)

    #commonlisp #lisp #sbcl #clisp @amszmidt @screwtape

    In conversation about 3 months ago from infosec.exchange permalink
    • Embed this notice
      Alfred M. Szmidt (amszmidt@mastodon.social)'s status on Thursday, 03-Apr-2025 17:27:06 JST Alfred M. Szmidt Alfred M. Szmidt
      in reply to
      • screwlisp

      @ksaj Works for me!

      @screwtape

      In conversation about 3 months ago permalink

      Attachments


      1. https://files.mastodon.social/media_attachments/files/114/273/076/953/864/375/original/0ae70ef3f90d24b3.png
    • Embed this notice
      Karsten Johansson (ksaj@infosec.exchange)'s status on Thursday, 03-Apr-2025 17:31:45 JST Karsten Johansson Karsten Johansson
      in reply to
      • screwlisp
      • Alfred M. Szmidt

      @amszmidt @screwtape Oh it works. It just breaks all the "rules"

      In conversation about 3 months ago permalink
    • Embed this notice
      Alfred M. Szmidt (amszmidt@mastodon.social)'s status on Thursday, 03-Apr-2025 17:31:45 JST Alfred M. Szmidt Alfred M. Szmidt
      in reply to
      • screwlisp

      @ksaj I mean .. it does StUfF ... 😜

      @screwtape

      In conversation about 3 months ago permalink
    • Embed this notice
      Alfred M. Szmidt (amszmidt@mastodon.social)'s status on Thursday, 03-Apr-2025 17:59:10 JST Alfred M. Szmidt Alfred M. Szmidt
      in reply to
      • screwlisp
      • Khleedril

      @ksaj -modern is quite a dumb switch, and it was only added in 2002.

      @khleedril @screwtape

      In conversation about 3 months ago permalink
    • Embed this notice
      Karsten Johansson (ksaj@infosec.exchange)'s status on Thursday, 03-Apr-2025 17:59:11 JST Karsten Johansson Karsten Johansson
      in reply to
      • screwlisp
      • Alfred M. Szmidt
      • Khleedril

      @khleedril @amszmidt @screwtape lol it's legit common lisp as long as you don't use clisp -modern.

      In conversation about 3 months ago permalink
    • Embed this notice
      Khleedril (khleedril@cyberplace.social)'s status on Thursday, 03-Apr-2025 17:59:12 JST Khleedril Khleedril
      in reply to
      • screwlisp
      • Alfred M. Szmidt

      @ksaj @amszmidt @screwtape You've obfuscated it, that's what's wrong.

      In conversation about 3 months ago permalink
    • Embed this notice
      Alfred M. Szmidt (amszmidt@mastodon.social)'s status on Thursday, 03-Apr-2025 18:04:31 JST Alfred M. Szmidt Alfred M. Szmidt
      in reply to
      • screwlisp
      • Khleedril

      @ksaj Seems it is some silly thing from Allegro CL...

      https://commonlisp.com/support/tutorials/casemode-tutorial.htm

      @khleedril @screwtape

      In conversation about 3 months ago permalink
    • Embed this notice
      screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 03-Apr-2025 20:48:18 JST screwlisp screwlisp
      in reply to
      • Alfred M. Szmidt
      • Khleedril

      @ksaj
      Eh, I didn't get it, but I'm on my way to sleep. This just looks normal to me:
      (defun fact (n)
      (prog
      ((x n) (result 1))
      start
      (when (< x 1) (return result))
      (setq result (* result x) x (1- x))
      (go start)))
      I thought you would be doing -modern for something like my redacted snippet, but I don't think so.
      @khleedril @amszmidt

      In conversation about 3 months ago permalink
    • Embed this notice
      Alfred M. Szmidt (amszmidt@mastodon.social)'s status on Thursday, 03-Apr-2025 20:48:18 JST Alfred M. Szmidt Alfred M. Szmidt
      in reply to
      • screwlisp
      • Khleedril

      @screwtape I was thinking if there is some mechanical way one could check the scope of variables.

      @ksaj @khleedril

      In conversation about 3 months ago permalink
    • Embed this notice
      screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 03-Apr-2025 20:48:19 JST screwlisp screwlisp
      in reply to
      • Alfred M. Szmidt
      • Khleedril

      @ksaj
      It hadn't occurred to me that we could separate local and special references to one variable by declarations about different cases of that variable (which will be upcased for the purposes of finding the value later)
      @khleedril @amszmidt

      In conversation about 3 months ago permalink
    • Embed this notice
      Karsten Johansson (ksaj@infosec.exchange)'s status on Thursday, 03-Apr-2025 20:48:19 JST Karsten Johansson Karsten Johansson
      in reply to
      • screwlisp
      • Alfred M. Szmidt
      • Khleedril

      @screwtape @khleedril @amszmidt Would be, it could be. But really shouldn't be. 😉

      In conversation about 3 months ago permalink
    • Embed this notice
      Karsten Johansson (ksaj@infosec.exchange)'s status on Thursday, 03-Apr-2025 20:48:20 JST Karsten Johansson Karsten Johansson
      in reply to
      • screwlisp
      • Alfred M. Szmidt
      • Khleedril

      @screwtape @khleedril @amszmidt I'm definitely doing something annoying. Quite a few annoying things. The code works, but only by the grace of God. I commented the less obvious things, but this code would or should get you banished from the Lisp kingdom.

      In conversation about 3 months ago permalink
    • Embed this notice
      screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 03-Apr-2025 20:48:20 JST screwlisp screwlisp
      in reply to
      • Alfred M. Szmidt
      • Khleedril

      @ksaj
      in the spirit of obliquely addressing your cleverness, I wrote this version of the same point:

      <ignore the fact that the code in this toot worked in some contexts>
      @khleedril @amszmidt

      In conversation about 3 months ago permalink
    • Embed this notice
      screwlisp (screwtape@mastodon.sdf.org)'s status on Thursday, 03-Apr-2025 20:48:21 JST screwlisp screwlisp
      in reply to
      • Alfred M. Szmidt
      • Khleedril

      @ksaj My first guess is that you're doing something annoying like this ->
      CL-USER> (defun bar (&aux (y 1))
      (+ y (locally (declare (special y)) y)))
      BAR
      CL-USER> (defparameter y -1)
      Y
      CL-USER> (bar)
      0
      CL-USER> (defun bar (&aux (y 1))
      (+ y (locally (declare (special y)) y)))
      WARNING: redefining COMMON-LISP-USER::BAR in DEFUN
      BAR
      CL-USER> (bar)
      2
      I can never get special variables straight.
      I'll think tomorrow
      @khleedril @amszmidt

      In conversation about 3 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.