libera/#commonlisp - IRC Chatlog
Search
6:56:19
jmes
I have a scenario where I need to return a function like so: (case (attribute thing) (a #'fn-1) (b #'fn-2)) I'm using sly stickers to determine that (attribute thing) is evaluating to A, yet the case statement is returning nil instead of #'fn-1
6:57:09
jmes
Oddly, when I put the same code into a REPL it correctly matches the case and returns the function
7:03:33
jmes
White_Flame: Hm, I'm trying to use literal symbols to match (attribute thing) to 'a. I thought that meant 'a is always 'a
7:10:12
jmes
White_Flame: It worked, thank goodness. I struggled for too long on that... I appreciate the help
7:32:37
lisp123
whats a nice way to sum across a list of objects (e.g. they have a slot POINTS and I want to sum all POINTS in a LIST of the object)
7:39:56
lisp123
if * = list of objects with a points slot that can be accessed via TRX-POINTS, would this be an elegant way:
7:46:38
lisp123
Nearly everything works naturally - from very rare name clashing to functionality for all sorts of things
7:48:25
beach
It's the result of decades of experience with other Lisp dialects by a group of very smart and very knowledgeable people.
7:50:56
lisp123
For example I'm not sure if they fully realised the value of macros when it was first introduced in Lisp in 1963
7:51:30
lisp123
Generic Functions on the other hand seem to have been very carefully thought through (as evidenced by the papers)
8:52:06
pjb
The problem is not the symbol - package relationship. It's that it's defined as a constant variable!
8:53:54
jackdaniel
oh, I had no idea that I could shadow-import a symbol and not use the CL package /s
9:04:38
pjb
The problem with cl:t is that you cannot use it as a local variable for time: (let ((t 0)) (incf t delta-t)) #| ERROR: While compiling an anonymous function : Can't bind or assign to constant t. |#
9:04:58
pjb
This doesn't come from the fact that T is interned in CL, but from it's definition: (defconstant t 't)
9:10:33
lisp123
A constant defined by defconstant can be redefined with defconstant. However, the consequences are undefined if an attempt is made to assign a value to the symbol using another operator, or to assign it to a different value using a subsequent defconstant.
9:11:12
specbot
Some Exceptions to Constraints on the COMMON-LISP Package for Conforming Programs: http://www.lispworks.com/reference/HyperSpec/Body/11_ababa.htm
9:12:15
Nilby
it's not that you can't use t as whatever given the packages pjb shows, but that you can't make other
9:20:44
mfiano
if you want to go with Unicode, you can prepend or append a zero-width space character to the T symbol for extra confusion :)
9:36:02
mfiano
For the ultimate code obfuscating, you could add package local nicknames using increasing numbers of ZWS nicknames.
9:42:36
Nilby
i suppose it's nice to read things in your 1st language, but unicode really seems to have opened a ā±Ćā±¤ā®ā³ā± ā®Ć ā±§Éāµāā§šæ for programming
9:45:07
mfiano
If you wanted to, you could do this easily without losing your mind, by using something like prettify-symbols-mode to show the parens locally correctly, along with a couple keybindings to insert what look like parens
13:24:44
Shinmera
somewhat confusingly, NIL is of type NULL, even though NIL is also a type (designating the empty type set).
14:14:50
jackdaniel
if T is a supersupertype, then it is only natural that nil is on the other end of the graph
14:19:04
Josh_2
All the lisp benchmarks are gone from https://programming-language-benchmarks.vercel.app/ :sob:
14:27:29
Josh_2
I dont think they are working on latest SBCL, the fella who has been writing the submissions has a few issues on the submissions repo
14:33:37
Guest7447
I'd try and argue you need to get people into the store before they buy, but then there'd be more questions of 'how do I make this work like x'
14:37:01
semz
Guest7447: Microbenchmarks like these would be false advertising under this analogy because they get gamed immediately. The Computer Language Benchmark Game is a great example: The top scoring submissions are usually written in inline assembly rather than the language in question.
14:37:04
Guest7447
it's marketing, good or bad.Ā it just seems whenever a person has 'heard lisp can be fast' they ask questions about how optimize things rather than how to write Lisp.
14:37:52
semz
The most egregious example is probably the Python regex benchmark (which gets place #2 or so by using the foreign function interface to use a completely different regex library instead)
14:38:57
Guest7447
though things like that still show a) what's possible b) how it's done.Ā I think it could be good marketing to show off simd use in lisp.
14:47:36
Josh_2
An excessive concern with "performance" is normally an indicator that this person has been consuming large quantities of soy
15:00:45
shka
one of problems with benchmark game was that java and C++ were putting out multi-thread programs
15:02:05
shka
and the only thing that you can get out of those is that there is a distinct performance tier for static typed compiled languages with a light to moderate optimizations employed
15:04:28
shka
anyway, rule of thumb, if you think that something can be done efficient enough in java, it can be done with SBCL as well
15:05:29
rotateq
trev: Ah okay, so you're experienced yet I guess. But I hope you don't think SICP is good for pure beginners.
15:05:38
trev
and looked for a LISP to use...started reading and comparing, then decided that CL is The One
15:06:42
rotateq
If you want to really use the code from newer version of SICP, this is good with Racket. But yeah, CL is the way.
15:06:51
trev
rotateq yeah, SICP is definitely not, but i am providing assistance. I think it does a decent job with foundational knowledge, moreso than the Python book she is reading
15:07:36
trev
rotateq, yeah exactly! i had her use Racket for the examples from the book. CL is my own interest
15:13:35
trev
Racket seemed interesting with the "language oriented programming", but i am not really sold on that paradigm
15:14:21
rotateq
Well we have that too, you have a programmable programming language and can fit it to the needs of a problem.