freenode/#lisp - IRC Chatlog
Search
6:38:29
no-defun-allowed
I've never really messed with specializers, but can I do (let ((x ...)) (defmethod foo ((bar (eql x))) ...))? CLHS on DEFMETHOD suggests I can.
6:38:38
beach
aeth: That's right, and I often repeat that fact. Affirmations like that, when examined, really turn out to mean only "every object is an object".
6:41:00
aeth
I can't deny that a comment is not an object. Does this mean that "everything is an object", which is very frequently published, is false?
6:41:49
MichaelRaskin
A comment doesn't even exist from code point of view, though. In the AST where comment is representable, the comment is typically represented by an object
6:43:05
beach
aeth: It is described by a type specifier, but that type specifier is not the type. But it doesn't matter. I have already found two counterexamples.
6:45:05
MichaelRaskin
It's arguable how different is from saying a physical neutron is not a Common Lisp object
6:45:58
beach
MichaelRaskin: "neutron" is not mentioned in the Common Lisp standard, or at least not in the normative part.
6:47:51
MichaelRaskin
I am pretty sure «everything is an object» is limited to «everything fully representable»
6:48:41
aeth
everything "first class", perhaps, but there might be some things that aren't "first class" that are objects
6:50:41
no-defun-allowed
What do you think of the return value of BYTE? That's an object, but one of implementation-dependent representation, which frequently borrows some other type.
6:52:27
no-defun-allowed
I guess I just stated that it's an object. Oh well. Would be nice if it wasn't frequently a cons or an integer or something that didn't really tell you if it is in fact a byte specifier.
6:56:48
ldbeth
you can try to describe everything as an abstract object specified by their behavior though
6:57:26
markasoftware
if i want to support declarations in the `body` of my macro, is there a better alternative to wrapping it in an unnecessary `(let () ,@body)` ?
6:57:45
markasoftware
if the immediately surrounding form otherwise is not one that supports declarations (in this case, progn)
7:03:16
MichaelRaskin
Everything assignable to a variable, sure, but _that_ clarification is _really_ not news to me
7:04:16
White_Flame
I think that places & types are probably the most interesting, directly representable, non-objects
7:05:16
MichaelRaskin
In-model and external-view notions being different is a distinction too trivial to discuss
7:05:20
White_Flame
right, there's a direct source code representation which implies the thing, but is not the thing
7:21:08
aeth
beach: should that be the concise response next time someone says "everything is an object"?
7:22:00
beach
I basically already responded that. From the vocabulary: "object n. 1. any Lisp datum.", so we have now reached "every object is an object".
7:24:14
MichaelRaskin
Note that «everything one can assign to a variable is an object in Common Lisp OOP system» is the same claim and holds even without lisp isolationism
8:22:53
no-defun-allowed
Today I was greeted by "The value #<unbound> is not of type FIXNUM" in my test suite.
9:06:02
edgar-rft
Re: CLHS Glossary "object n. 1. any Lisp datum." - The Oxford Dictionary defines "datum" as "fact or piece of information" what means that Lisp objects are not restricted to Lisp data types.
9:22:23
edgar-rft
Okay, I agree that for USAian education standards Wikipedia would be more appropriate.
9:48:32
theothornhill
What is a good way to use own tools in common lisp? Right now I just use save-lisp-and-die, then alias that executable.
9:53:46
theothornhill
Seems a little slow to run small utilities that just produce some info, say like some weather info from an api etc
9:53:59
no-defun-allowed
What do you mean by tools though? Would you have any reasonable interface that isn't the shell?
9:57:12
theothornhill
By tools I mean the unixy I/O style small apps. The ones where you don't need a living image, when it is "done"
10:22:58
edgar-rft
theothornhill: I usually use Emacs Lisp for small-n-dirty shell programming gimmicks, Common Lisp always inculudes the entire compiler and lots of other stuff in its executables.
10:26:56
jackdaniel
not /always/, i.e in ecl libcmp.fas is loaded only after the compiler is invoked for the first time
10:29:07
edgar-rft
thanks for the info, and please built lots of money into ecl to that I can load it as an option :-)
10:29:59
jackdaniel
I don't think that anyone would tell you *not* to use ecl for small-n-dirty shell programming gimmics, but I don't know what is a nature of your job
10:31:36
edgar-rft
I first wanted to suggest using C instead of Lisp but I hadn't thought aboout the option that ecl uses C under the hood
10:39:32
theothornhill
Yeah, I've used elisp and c for that previously (and still do). Perhaps its not the best fit for cl anyways
10:49:11
edgar-rft
theothornhill: One of the reasons why Unix and its "small and simple" philosophy was created was to overcome the "monolithity" of programming environments like Lisp (at that time). So it's not really a surprise that Common Lisp and the Unix shell are not best friends. But ecl shows that there *are* people who care about the interoperability between C (Unix) and Lisp.
10:57:31
edgar-rft
According to Dennis Ritchie C is the most inappropriate language to write big programs in :-)
13:03:47
grewal
fwiw, for small tools like that I've had luck using a long running lisp image in the background and writing a tiny script that passes command line args through a pipe
13:05:05
grewal
If you have enough tools, you can turn it into a busybox-like sort of thing where the image contains all the tools and it dispatches based on the name used to invoke it
13:29:57
MichaelRaskin
Me, I just have a prebuilt image with the tools I want to invoke, and pass it '--eval'. Start-up overhead is quite low
15:15:10
paines
I am fiddeling around with a smaller project which uses SDL2 and now I am wondering why I cannot call a function which seem to be there, sdl-set-hint\
16:50:44
jcowan
beach: I don't think it's correct to say Python is not a general-purpose programming language. "Scripting language" is basically a way of saying "language I don't like"
16:52:19
jcowan
Indeed, that is not strong enough: there are, it seems, many C interpreters, so C is indeed a scripting language.
16:56:42
scymtym
maybe saying /cpython/ is a scripting /environment/ would be more accurate since it ticks several of the boxes: cannot make (afaik) standalone binaries, does not compile to native code, is effectively single-threaded and arguably executes slower than "non-scripting languages". but i agree that "scripting language" is not a very useful way to categorize languages or even implementations
16:58:58
jcowan
There's a number of tools that let you create Python standalone files. The CPython interpreter is bundled in with necessary .pyc and .so/.dll files, and everything just gets set up.
17:01:41
jcowan
Compiling into native code has the problem that it is neither portable nor stable. Larceny Scheme compiles into 32-bit x86, for which you have to load special libraries on Linux, and I expect support for them to rot over time (already WSL1 does not have it). Fortunately it also compiles to C in a version known as Petit Larceny.
17:14:54
p_l
jcowan: it's possible to make a stable binary on linux - it's the Glibc that doesn't want to cooperate
17:15:29
p_l
(Go for example makes binaries that depend only on kernel being above certain version when you use certain command line flags)
17:34:27
White_Flame
"scripting" tends to indicate that its primary behavior is to invoke behavior of other things outside the script
17:34:51
White_Flame
while "programming" tends to indicate defining the primary behavior in the code itself
17:35:28
White_Flame
while those definitions still exist on a gradient, I think that's likely the common intention of those terms
17:36:42
White_Flame
if what you're doing is managing calls to external C libraries, then probably yeah
17:37:31
White_Flame
while Lisp is kinda weak at scripting, because of its strong focus on its own image
17:37:42
p_l
Well, anything else can quickly hit performance limits that result in red-eyed sysadmin going all BOFH on you
17:42:41
jcowan
The last few jobs have involved programming in Python and occasionally scripting in bash.
18:00:26
beach
I was under the impression that the term was used by the creator of a language to mean "I hav no intention, or not enough knowledge, to make it fast enough for general use."
18:33:15
jasom
I agree that scripting is primarily about automating external tools. The bourne shell is the clasic example of a scripting language. This actually gells with beach's definition because if you spend 90+% of your time in external tools then there really isn't a point in making the language fast enough for general use.