mstdn.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A general-purpose Mastodon server with a 500 character limit. All languages are welcome.

Administered by:

Server stats:

15K
active users

#clisp

0 posts0 participants0 posts today

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

CL packages are the wrong way to implement packages in Lisp. As I explained in a discussion two years ago, packages implemented using obarrays (or equivalent) don’t work reliably.

We have a much better basis for Lisp packages in the shorthands mechanism. It only needs to be completed.

Richard Stallman on CL packages landed
#clisp #emacs
andreyor.st/posts/2022-11-01-e

> The reason namespaces systems do not fit well into #Lisp is that they have to operate in ‘read’, in the choice of which symbol object you get.

Richard Stallman on Emacs Lisp's future

andreyor.st · Emacs Lisp shorthands as namespacing systemIn Emacs version 28 Emacs developers introduced so-called read symbol shorthands. If you’re interested in the rationale, feel free to search the Emacs developer mailing list for the discussion. However, it does seem that not everyone likes the idea of shorthands as a substitution for namespaces (or packages, if you’re coming from Common Lisp).
Replied in thread

@lxsameer that's cool! I *recently* started using #emacs because I found file navigation annoying in other IDEs. I know how to touch type, so now I literally just have to type in what I want (with all the autocompletion benefits just like a shell). Still learning the basics but finding even that awesome!

By the way, I've been programming a bit of #Clojure too, although right now I prefer the #clisp vibes :clojure: :lisp:

Interesting. Git head of #Lisp HTML-generating library CL-WHO running on #Clisp :

[1]> (in-package "CL-WHO")
#<PACKAGE CL-WHO>
WHO[2]> (with-html-output-to-string (out) (:a (+ 1 2)))
"<a></a>"
WHO[3]> (with-html-output (*standard-output*) (:a (+ 1 2)))
<a></a>
"</a>"

No content in the tag!

Documentation says that the result of (+ 1 2) should be sent to the stream as if by PRINC, thus <a>2</a>.

I don't see a test for this.

Doesn't work in the oldest available git commit from 2009, either.

What u will c is 21 languages ++ (mine) calc app srvs <=>stdinout. C,C++<=> sockets, 23 thin clients /w NO dep. besides C . 21 thin server in C,translate stdin/out to/from sockets in a language agnostic way. What you WON'T see are any (1000x footprint of my thin clients) or fonts, ask for computer clients youtube.com/watch?v=Esv6xHwZRY

An unfair line comparison of (straight and with junk DNA removed using C pre processor, ya I don't know rust well) the ada c and lisp can be used as guides for optimizing if you know any of these. I'm slowly going back through now that these all work for calc bitbucket.org/timcdoc/antibrow also note these all produce the same(mostly) tiny over the wire to thin client via stdin/out

This goes for the rest of you, if you can improve on the Rosetta stone 17 languages (and it won't be hard on most of them :-P ) feel free to send me a shorter/clearer version. bitbucket.org/timcdoc/antibrow then (others but these are the easiest to grok under those dirs are calc and some other apps depending. What language should I abuse next?

bitbucket.orgBitbucket

TIL: every run of #SBCL has the same initial `*random-state*`, so sequences of pseudo-random numbers are not so random. The solution is super simple: `(setf *random-state* (make-random-state t))`.
It makes sense considering what a #Lisp image is... but it's still pretty surprising compared to other programming languages. (And doesn't happen in #ECL or #clisp 😅)

Where are my peeps? I suspect most lisps can do these kinds of self surgery on themselves, hopefully close to just as easily as the lisps I've written? Not the right way to write factorial, but hints at ways to write self compilers etc. I never did add macros, but I've never needed them.

mostly working emulator runs 4K but sin() is broken, should fix it today. 5717 bytes of human readable over the wire to a 252K footprint thin client with no fluffy dependencies. and no 300M footprint browser. Shown are all the commands including 5 RLE HRBitmaps over the thin client on the other end of the cloud/network. code on bitbucket timcdoc antibrowser clisp altair

@WorkWithKirk oh, I wouldn't even know how to chatgpt. I do have some pretty crappy mix of first (or near first language gui cloud apps) and used all the time languages ++ (mine) and yes implementations of calc, some paint, altair emulators under bitbucket timcdoc antibrowser if you know any of these I could use some optimization help. You can see runs to NOTbrowsers thin clients in my "media"

I'm not saying this is the *right* way to write lisp code, but MY lisp handles this JUST fine, may or may not but you'd have to bend over backwards and disable the COBOL like anally retentive bumpers! 🤦 (Cackles maniacally, now I can haz nap!?) Why yes, this is like self brain surgery, hi, this is lisp! @bunnyhero @WorkWithKirk A good way to write factorial? maybe not, a good way to self optimize while running? ABSOLUTELY 😜🤜 @DRSpalding FYA

I was yesterday years old when I discovered modern lisps ( ) can't directly manipulate their own functions from within their functions (de foo (x y) 'thisgetswhacked (rplacd (caddr foo) 'thisiswhatgetssmashedinto)) or that scoping was so effed up it should be and is in my lisps if a variable is used, and it's not in the variable list going into the function you are in, then it's global, otherwise it's in the scope of the function you are in.