ebzzry has quit [Read error: Connection reset by peer]
msk has quit [Ping timeout: 265 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
TruBlu has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
sugarwren has quit [Quit: Leaving]
madage has quit [Remote host closed the connection]
asdf_asdf_asdf has joined #lisp
madage has joined #lisp
space_otter has quit [Ping timeout: 265 seconds]
gko_ has joined #lisp
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
Guest19180 has joined #lisp
Guest19180 has quit [Ping timeout: 265 seconds]
ebzzry has joined #lisp
terpri has quit [Remote host closed the connection]
ebzzry has quit [Read error: Connection reset by peer]
terpri has joined #lisp
Oladon has quit [Quit: Leaving.]
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
slyrus has joined #lisp
slyrus_ has quit [Ping timeout: 240 seconds]
akoana has left #lisp ["Leaving"]
Kundry_Wag has quit [Remote host closed the connection]
ebzzry has joined #lisp
georgiePorgie has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
<asarch>
How could I get a random number (with limits)?
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
<ebrasca>
asarch: (random n) ?
<asarch>
Thank you!
<aeth>
asarch: random gives you 0 to below n (integer if integer, float if float... so for 5 you're getting 0, 1, 2, 3, or 4, but for 5.0f0 or 5.0d0 you could get something between 4.0 and 5.0)
<aeth>
Assuming you're on the same version (random 5) will always return the same thing in a fresh SBCL, which is 4, unless they change their algorithm a bit. It works on a very old version and on 2.0.0, though.
<aeth>
(let ((r (make-random-state t))) (random 5 r)) ; without the T, you'll still get 4
<aeth>
Other implementations may differ, of course.
<aeth>
But if it's required for some, you have to do it in all portable code.
<asarch>
Ok
<aeth>
Of course, you can also DEFPARAMETER it into a global if you want. Or you can set *random-state* which is what RANDOM uses without an argument
<aeth>
The API for using a specific seed number is implementation-specific, if the implementation supports it.
<aeth>
If you need it to be portably deterministic, you have to use a third party RNG
<asarch>
Is there a way to get the entropy from the system?
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<aeth>
asarch: Oh, and what I do is I write a trivial function that calls SB-EXT:SEED-RANDOM-STATE or other equivalent where available and (make-random-state t) where not available, which works if you want it to be manually seeded if possible, but don't care if the seeds do the same thing on different implementations.
<asdf_asdf_asdf>
((0 1) (0 2) (0 3) (0 4) (1 2) (1 3) (1 4) (2 3) (2 4) (3 4)) ; searching index, for (2 4) index is 8, because count from 0
<asarch>
I see
<aeth>
asarch: Then if there is a seeding functionality for the implementation, you can e.g. call /dev/urandom or whatever the current recommended thing is, once, to get the seed. Although maybe the implementation already does this.
<aeth>
Unfortunately, I haven't really formalized this enough into something usable in a library.
<aeth>
The other approach, of course, is to write your own RNG so (1) you can seed on every implementation and (2) the seed always does the same thing on every implementation.
<asarch>
A fellow from #mirbsd used to share entropy through an Irssi/hexchat plugin
Kundry_Wag has quit [Ping timeout: 268 seconds]
<aeth>
asdf_asdf_asdf: lower numbers are better for every single one of those lines (seconds, seconds, CPU, cycles, consing (i.e. heap allocations)), making the second TIME better.
<asdf_asdf_asdf>
aeth, so find-index is better algorithm than index-a?
<asdf_asdf_asdf>
Readability code is also better than index-a?
<aeth>
asdf_asdf_asdf: No, you're not comparing the two algorithms. The first one conses (i.e. allocates) a ton and the second one doesn't, so that's what you're actually benchmarking.
<aeth>
asdf_asdf_asdf: Rewrite index-a to take two arguments instead of a list of length two and then it's more comparable to find-index
<aeth>
(so 3 total arguments)
<aeth>
asdf_asdf_asdf: i.e. instead of "(defun index-a (entry-a max-a)" and then immediately turning entry-a into f-entry-a and s-entry-a, do "(defun index-a (f-entry-a s-entry-a max-a)" and now you won't have to allocate 100,000 lists.
<asdf_asdf_asdf>
What's mean here 100% CPU and 1,572,856 bytes consed?
<aeth>
asdf_asdf_asdf: the important part is that it's still allocating. Possibly allocating a rational. Is that what you really want with your algorithm or do you want FLOOR instead of / in the algorithm?
<aeth>
asdf_asdf_asdf: in CL (/ 3 4) = 3/4 but in many languages the division between integers behaves like (floor 3 4) or (truncate 3 4) and returns 0.
<aeth>
(or e.g. 1 in the case of 5 divided by 4 instead of 5/4)
<asdf_asdf_asdf>
Omitting this fact, which algorithm better and what above mean?
<aeth>
asdf_asdf_asdf: If you just want to know which *function* is better (a much weaker claim) it looks like the second one is, but you should probably have more test cases than just the one.
jprajzne has quit [Client Quit]
holycow has joined #lisp
<asdf_asdf_asdf>
OK, but what mean "100.00% CPU" for index-a?
<aeth>
asdf_asdf_asdf: that is probably the most useless measure. It just means it used 100% of your CPU at some point.
<aeth>
"to cons" is slang for "to allocate on the heap" so the consing measure is meaningful. And obviously the timimng measures are timing
Kundry_Wag has joined #lisp
<asdf_asdf_asdf>
Thank, so index-a takes 1.5 MB memory from heap.
<asdf_asdf_asdf>
I think, that find-index is better, because takes less cycles CPU than index-a about twice.
<aeth>
asdf_asdf_asdf: Yes, but it's possible that the first function could be written more efficiently, which is why the second *function* is better (in that one specific test case), not necessarily the second algorithm.
<aeth>
But you're probably overthinking things, and if both work and the 2nd works better for now, just go with it.
Kundry_Wag has quit [Ping timeout: 268 seconds]
sjl has quit [Quit: WeeChat 2.2-dev]
<aeth>
LdBeth: SBCL is a fork of CMUCL iirc, so it should use the same things as CMUCL except where it has been rewritten (over the past 20 years, though!)
rwcom6 has joined #lisp
rwcom has quit [Ping timeout: 265 seconds]
rwcom6 is now known as rwcom
jprajzne has joined #lisp
Guest19180 has quit [Ping timeout: 265 seconds]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
orivej has joined #lisp
Kundry_Wag has joined #lisp
Jeanne-Kamikaze has quit [Remote host closed the connection]
Kundry_Wag has quit [Ping timeout: 240 seconds]
holycow has quit [Quit: Lost terminal]
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Oladon has joined #lisp
georgiePorgie has joined #lisp
asdf_asdf_asdf has quit [Quit: asdf_asdf_asdf]
space_otter has joined #lisp
Kundry_Wag has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
ebzzry has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
ebzzry has quit [Ping timeout: 272 seconds]
ebzzry has joined #lisp
jprajzne has quit [Quit: jprajzne]
Kundry_Wag has quit [Ping timeout: 265 seconds]
jprajzne has joined #lisp
ebrasca has quit [Remote host closed the connection]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
oxum_ has joined #lisp
gravicappa has joined #lisp
oxum has quit [Ping timeout: 265 seconds]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
ebzzry has quit [Ping timeout: 260 seconds]
Oladon has quit [Quit: Leaving.]
milanj has quit [Quit: This computer has gone to sleep]
Kundry_Wag has joined #lisp
Nilby has joined #lisp
<beach>
Good morning everyone!
sjl has joined #lisp
<no-defun-allowed>
Good morning beach!
<beach>
Odin-: Sure, on a Unix-like system, but not on CLOSOS.
ebzzry has joined #lisp
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kundry_Wag has quit [Ping timeout: 260 seconds]
kmeow has joined #lisp
ggole has joined #lisp
torbo has joined #lisp
Bike has quit [Quit: Lost terminal]
illili has quit [Read error: Connection reset by peer]
z147 has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
<jonatack>
Morning beach!
Grauwolf has quit [Read error: Connection reset by peer]
Grauwolf has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
pfdietz has quit [Remote host closed the connection]
vlatkoB has joined #lisp
jprajzne has joined #lisp
kmeow has quit [Ping timeout: 265 seconds]
gko_ has quit [Ping timeout: 265 seconds]
narimiran has joined #lisp
z147x has joined #lisp
z147 has quit [Ping timeout: 240 seconds]
v88m has quit [Ping timeout: 265 seconds]
v88m has joined #lisp
Kundry_Wag has joined #lisp
shangul has joined #lisp
jprajzne has quit [Quit: jprajzne]
shrdlu68 has joined #lisp
jprajzne has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
beach has quit [Remote host closed the connection]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
beach has joined #lisp
kmeow has joined #lisp
<jeosol>
"ALEXANDRIA" is already a nickname for "ALEXANDRIA.0.DEV". [Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR]
<jeosol>
I recently updated ql and started getting that error. I am using SBCL. Anyone see that error before?
<jeosol>
I think it's related to some conflict with osicat(?) and alexandria systems. Each time, I am able to select options to resolve it though. Hoping, there is a better resolution
pvaneynd has joined #lisp
Kundry_Wag has joined #lisp
nckx has quit [Ping timeout: 268 seconds]
Kundry_Wag has quit [Ping timeout: 268 seconds]
pvaneynd_ has joined #lisp
pvaneynd has quit [Ping timeout: 265 seconds]
Guest19180 has joined #lisp
Guest19180 has quit [Ping timeout: 265 seconds]
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
asarch has quit [Quit: Leaving]
_whitelogger has joined #lisp
vlatkoB_ has joined #lisp
cods has quit [Remote host closed the connection]
jprajzne has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
vlatkoB has quit [Ping timeout: 268 seconds]
milanj has joined #lisp
Kundry_Wag has joined #lisp
cods has joined #lisp
Kundry_Wag has quit [Ping timeout: 268 seconds]
z147x has quit [Ping timeout: 240 seconds]
kmeow has quit [Ping timeout: 265 seconds]
torbo has quit [Remote host closed the connection]
frgo has quit []
ebzzry has joined #lisp
msk has joined #lisp
<beach>
Can someone with ECL installed confirm that the method combinations of two different generic functions created with the same (possibly implicit) :METHOD-COMBINATION option are not EQ?
<beach>
I would do it myself, but I can't seem to install ECL.
karlosz has quit [Quit: karlosz]
<no-defun-allowed>
Does `sudo apt install ecl` not work?
nckx has joined #lisp
<no-defun-allowed>
Mine doesn't appear to work either, sadly. When it tries to load quicklisp (so I can load closer-mop), I get the error "undefined symbol: ecl_make_constant_base_string".
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
<beach>
I was able to install ECL with apt-get.
<beach>
Now I need to figure out how to get to the method combination of a generic function.
<beach>
SLOT-VALUE ought to work.
<no-defun-allowed>
Excellent, the Arch Linux package for ECL can't load FASL files, and compiling ECL results in a program that prints out a backtrace and dies when started.
<beach>
:(
<beach>
Thanks, I figured it out.
cl-arthur has joined #lisp
drl has quit [Quit: Ex-Chat]
<no-defun-allowed>
Then after updating my copy of the source code, it cannot find the package SB-BSD-SOCKETS (ECL uses SBCL's socket library, from memory). Could have also been some problems with using parallel make; some programs are like that.
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
msk has quit [Remote host closed the connection]
msk has joined #lisp
v_m_v has quit [Remote host closed the connection]
kmeow has joined #lisp
Kundry_Wag has joined #lisp
frgo has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
jprajzne has quit [Quit: jprajzne]
<beach>
I think I found another minor bug in the Common Lisp HyperSpec. The description of DEFGENERIC has (:method-combination method-combination method-combination-argument*) as one possible option.
<beach>
But I think it should be (:method-combination method-combination-name method-combination-argument*) given the Arguments and Values description.
jprajzne has joined #lisp
v_m_v has joined #lisp
Guest19180 has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
Guest19180 has quit [Ping timeout: 265 seconds]
georgiePorgie has joined #lisp
narimiran has quit [Ping timeout: 265 seconds]
space_otter has quit [Remote host closed the connection]
random-nick has joined #lisp
<cl-arthur>
https://pastebin.com/gYUbM0bw :: I'm trying to make something using the MOP and have a metaclass (or class metaobject class, if you like) whose slots I want to have a slot to store a function. Instead of the desired function, though, I'm currently storing the symbol #'- . I have two questions: 1) What's the appropriate level to canonicalize the :subslot argument at? (Going by Closette in AMOP, it seems
<cl-arthur>
like the function make-direct-slot-definition would have been a good candidate, but it's not part of MOP proper.) 2) What's a good way to go from a symbol #'- to the "related" function? (Calling eval on it works, but seems dirty.)
<no-defun-allowed>
#'- would evaluate to a function. if you have a symbol, you can use SYMBOL-FUNCTION to get the function bound to it.
msk has quit [Remote host closed the connection]
msk has joined #lisp
<no-defun-allowed>
Oh, you have the form #'-. You should destructure it [#'foo is the same as (FUNCTION foo)] to get the symbol.
william1_ has joined #lisp
jprajzne has quit [Quit: jprajzne]
Kundry_Wag has joined #lisp
kmeow has quit [Ping timeout: 260 seconds]
<cl-arthur>
Oh, I do have a #'- form and not a #'- symbol as I thought. Hurr durr. Thanks, that nicely answers question 2 :)
jprajzne has joined #lisp
william1_ has quit [Quit: WeeChat 1.9.1]
waaron has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
rippa has joined #lisp
ebzzry has quit [Ping timeout: 265 seconds]
vap1 has quit [Ping timeout: 240 seconds]
vap1 has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jprajzne has quit [Client Quit]
rwcom6 has joined #lisp
georgiePorgie has joined #lisp
rwcom has quit [Ping timeout: 265 seconds]
rwcom6 is now known as rwcom
jprajzne has joined #lisp
v_m_v has quit [Remote host closed the connection]
msk has quit [Remote host closed the connection]
msk has joined #lisp
Achylles has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
<Achylles>
I don't know, but I got a little upset seeing this conference video. As far I understood, the guy says that lisp has no practical use in modern days and that he is interested in it just because it can make him a better programmer in other languages. Thoughts?
<beach>
Lots of people say stupid things all the time.
<beach>
You can't stop them.
<no-defun-allowed>
I can't take anyone who writes LISP upcased seriously; same with Hooktube but that's not a hill I'm interested in dying on tonight. It might be excusable if "it's 1959".
<cl-arthur>
Achylles: People like to pretend 'industry best practice' doesn't mean 'lowest common denominator' :)
<no-defun-allowed>
Interestingly, he mentions #f, #t and null? which are Scheme-isms and certainly weren't used in 1959.
<no-defun-allowed>
And at 33:40, his indentation of COND is way out (but no one would have indented anything in 1959 either).
<Achylles>
beach, this is an recent and important conference. How they choose such people to give a talk like this? Which are the criteria? Then you attend something like this and instead to be drawn to the language by curiosity, at least, you miss the whole interest before trying it...
<no-defun-allowed>
I didn't learn much about how he implemented any of that in his "original LISP interpreter in C", either.
<no-defun-allowed>
Achylles: It's a Linux conference. Why would they have good Lisp programmers?
<no-defun-allowed>
(And didn't Linus make fun of GNU Hurd for being written by "people who thought Lisp was a good idea" or something like that?)
<beach>
Achylles: I think you should drop it. It is not worth getting upset about.
<no-defun-allowed>
Basically that.
vap1 has quit [Ping timeout: 268 seconds]
wxie has joined #lisp
<cl-arthur>
Re. my earlier question about the appropriate point to canonicalize direct-slots: Seems to be in ensure-class-using-class.
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
kmeow has joined #lisp
jprajzne has quit [Quit: jprajzne]
orivej has quit [Ping timeout: 265 seconds]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
ebzzry has joined #lisp
msk has quit [Ping timeout: 240 seconds]
msk has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
<pjb>
LdBeth: This paper concentrates on the development of the basic ideas of LISP and distinguishes two periods - Summer 1956 through Summer 1958 when most of the key ideas were developed (some of which were implemented in the FORTRAN based FLPL), and Fall 1958 through 1962 when the programming language was implemented and applied to problems of artificial intelligence.
<pjb>
So back from 1956…
cl-arthur has quit [Read error: Connection reset by peer]
<LdBeth>
pjb: it's never the same lisp we use today
jprajzne has quit [Quit: jprajzne]
<pjb>
LdBeth: lisp is never the same, because you always write new operators to transform it.
jprajzne has joined #lisp
<p_l>
LdBeth: form 1959 the lisp used is similar enough to require only minimal work in order to compile on Common Lisp
<pjb>
LdBeth: basically, you could use a time machine, go back to 1962, and start writing lisp code for 58 years, and you could run this code on today CL implementations!
<pjb>
Imagine being able to implement a 58 man.year project in lisp!
dddddd has joined #lisp
<pjb>
or bring a friend, and implement a 116 man.year project in lisp!
scymtym has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
v_m_v has joined #lisp
<pjb>
LdBeth: Be sure to read the links I gave you. They're all very short!
<LdBeth>
I always want a lisp editor works like the one MTS LISP or InterLisp has
<LdBeth>
but modern CL no longer store programs in heap as lists
<LdBeth>
and they also lacked NLAMBDA & FLAMBDA
vaporatorius has quit [Ping timeout: 240 seconds]
hiroaki has joined #lisp
wxie has quit [Quit: wxie]
<LdBeth>
even CL cannot properly run older CL code written with obscure packages such as Flaovrs or ObjectLisp
<p_l>
LdBeth: CL still stores programs as lists, it's more an issue with nobody writing the right environment. Both Flavors and others can be reasonly reimplemented in CL without significant effort, the issue with Fexpr systems is more that you lose a lot of the compilation capability iirc
shifty has quit [Ping timeout: 265 seconds]
cl-arthur has joined #lisp
shifty has joined #lisp
vaporatorius has joined #lisp
kmeow has quit [Ping timeout: 260 seconds]
<LdBeth>
and imagine purposely writing CL code that looks close to ML (in NuPRL) or ALGOL (with Plisp developed in Apple), for all the absolute things they're only attractive/useful in that special context, no one would like writing lisp in the same fashion as people as old in 1959, given already exposed to some considerably modern programming languages
Kundry_Wag has joined #lisp
<Nilby>
Fexprs feel mostly clumsy compared to macros.
ebzzry has joined #lisp
<LdBeth>
in other words, you don't really needs to know how people use LISP in 1959 to be a good programmer :d
<LdBeth>
Nilby: actually, they provides very general and clean call-by-name semantics
cl-arthur has quit [Read error: Connection reset by peer]
<Bike>
fexprs make compilation very hard since any of their arguments need to remain unprocessed, and if they're invoked you need a reified environment. and you can't know if a given function call looking thing is a fexpr operation without type inference or something, which is in turn rendered difficult by the problems
<Bike>
it seems like wanting a fexpr that's not a macro would be rare, though
<Nilby>
I dunno. I worked on converting a huge program using fexprs, and they seemed cleaner as macros.
<Nilby>
I you want, you can have macros expand not at compile time too, but it's more rare.
<pjb>
LdBeth: or have a look at Hemlock.
cl-arthur has joined #lisp
<pjb>
LdBeth: it would be nice if you wrote less bullshit, and wrote more lisp code… If you want an image based development environment, spend your week-end writing it (it's simple), instead of writing non-sense on irc!
<LdBeth>
pjb: I've used the hemlock based editor shipped with CCL, not very powerful if compared to Symbolics Genera
<pjb>
LdBeth: you have to sources, make it more powerful!
<Nilby>
Also when I've used form based editors, I didn't like it. I may be stupid but I like the control of the textual form. With form editors you can even make the parens disappear, but I find it disconcerting. But a good lisp editor should have the structure too.
<LdBeth>
not worth it, many other interesting things includes CLWEB, Plisp, LCF ML, projection editor, they all adds extra burden to the development
<Nilby>
pjb: But nobody want to use the simple week-end editor. You, me, beach, and a lot of other people have written one, but we're still using poor old Richard's emacs.
<pjb>
Nilby: that's not the point. The point is less talking, more programming!
Inline has joined #lisp
sjl_ has joined #lisp
asdf_asdf_asdf has joined #lisp
<LdBeth>
the problem with sexp editor in CL, is that CL involves more class, objects, arrays than pure lists and symbols
brown121407 has quit [Read error: Connection reset by peer]
<LdBeth>
that's where the inspector comes
brown121407 has joined #lisp
stepnem_ has quit [Read error: Connection reset by peer]
brown121407 has quit [Remote host closed the connection]
cl-arthur has quit [Read error: Connection reset by peer]
stepnem has joined #lisp
brown121408 has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
vaporatorius has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest19180 has joined #lisp
jmercouris has joined #lisp
georgiePorgie has joined #lisp
ebzzry has quit [Ping timeout: 265 seconds]
jprajzne has quit [Quit: jprajzne]
Inline has quit [Quit: Leaving]
Guest19180 has quit [Ping timeout: 240 seconds]
Achylles has quit [Quit: Leaving]
EvW has joined #lisp
jprajzne has joined #lisp
cl-arthur has joined #lisp
ebzzry has joined #lisp
v_m_v has quit [Remote host closed the connection]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
narimiran has joined #lisp
asedeno has quit []
asedeno has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
shrdlu68 has quit [Quit: WeeChat 2.6]
jprajzne has quit [Client Quit]
ebrasca has joined #lisp
sjl_ has quit [Ping timeout: 268 seconds]
kmeow has joined #lisp
Inline has joined #lisp
ebrasca has quit [Remote host closed the connection]
ebzzry has quit [Read error: Connection reset by peer]
shifty has quit [Ping timeout: 268 seconds]
shifty has joined #lisp
gabiruh has quit [Ping timeout: 272 seconds]
ebzzry has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
rwcom4 has joined #lisp
jonatack has quit [Ping timeout: 245 seconds]
rwcom has quit [Ping timeout: 265 seconds]
rwcom4 is now known as rwcom
georgiePorgie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gabiruh has joined #lisp
jonatack has joined #lisp
Inline has quit [Ping timeout: 272 seconds]
<flip214>
If I've got a system loaded in my image, can I tell ASDF to reload a different version from another location?
<flip214>
my asdf:*central-registry* contains *default-pathname-default*, and I'm in the source path... but ASDF doesn't see this new path
<flip214>
even asdf:clear-system doesn't help
t58 has joined #lisp
<pjb>
Perhaps asdf/system:reset-system ?
<flip214>
I only have asdf/system::reset-system-class
<flip214>
asdf:find-system still gives the "old" path
<pjb>
There doesn't seem to be any function to delete a system. You should write one, I would say. Or check the user manual?
<pjb>
Or perhaps, you could write a method to change the path of the system in the system object?
Inline has joined #lisp
<pfdietz>
I am now tempted to write a deffexpr macro. It wouldn't be that hard. The arguments would be passed in as thunks. Lexical variables would be evaluated in the context of the caller, though.
<jmercouris>
pfdietz: what is a deffexpr macro do?
<minion>
jmercouris, memo from pjb: there's some emacs lisp compatibility code in Hemlock.
<minion>
jmercouris, memo from pjb: there's a CL implementation in emacs lisp: emacs-cl; but it has bitrotten, since it worked before the introduction of closures in emacs lisp.
<minion>
jmercouris, memo from pjb: my plan is to write a C compiler targetting CL, to specifically compile GNU emacs in a lisp image ;-)
<jmercouris>
oh I see, OK interesting
<pfdietz>
Well, I'd have to go over the details, but the idea would be (foo x) ==> (foo-internal (lambda () x)), and in foo-internal the arg would be funcalled to get its value.
<jmercouris>
pfdietz: what is the purpose of this macro?
<pfdietz>
Just for the hell of it?
<jmercouris>
I don't understand
<jmercouris>
when would one use this macro?
<jmercouris>
what would it make more convenient?
<jmercouris>
pjb: if you compiled Emacs intoa Lisp image, what power does that get you?
<beach>
jmercouris: You probably don't know about the FEXPRs in old Lisps
<jmercouris>
I know nothing of them no
<flip214>
pjb: that means I have to learn ASDFs internals... thanks anyway!
<jmercouris>
I've heard of mexpr
<pfdietz>
fexprs were being mentioned earlier in this channel, so it would be a demonstration you could have what amounts to them in CL. Useful? Not that I can tell, but maybe someone would want it.
<pjb>
pfdietz: how do you catch the lexical environment? IIRC, a fexpr returns a form like a macro. You will have to evaluate it, but eval doesn't take an environment (and neither compile).
Inline has quit [Read error: Connection reset by peer]
Inline has joined #lisp
<jmercouris>
a FEXPR returns a macro?
<jmercouris>
a meta macro?
<flip214>
pjb: ah, sorry. my bad.
<pjb>
jmercouris: then you can call CL functions from emacs lisp easily.
<jmercouris>
oh I see, but no interop the other way
<jmercouris>
or?
<flip214>
I was in the source directory, but the ASD hid in a subdir and so wasn't in *def-p-def* at all!
<pjb>
jmercouris: then you can write your extensions in CL, while letting GNU emacs maintainers continue using C to maintain GNU emacs, while letting the GNU emacs community continue using emacs lisp to implement third party emacs packages.
<pjb>
jmercouris: an alternative would be, nowdays, to put libecl in an emacs module.
<froggey>
pjb: I tried compiling Emacs with Iota recently. it almost worked, but started crashing halfway through loadup.el/bootstrapping
<jmercouris>
froggey: I tried mezzano today
<pjb>
jmercouris: of course, having a C->CL compiler will also let us compile device drivers from Linux for a lisp OS :-)
<jmercouris>
froggey: very fascinating, impressive
<froggey>
it also required running sbcl with a 16GB heap to load...
<froggey>
jmercouris: thanks
<pfdietz>
It is my understanding that fexprs are functions that do not evaluate their arguments at the call, but only as needed.
<pjb>
froggey: yes, not surprising. This bootstrapping (emacs image saving) might need to be patched.
<pjb>
pfdietz: what do they return?
<pfdietz>
They return ordinary values.
<pjb>
pfdietz: note that there was no closure when they were used.
<jmercouris>
am I understanding that a FEXPR return is not evaluated?
<pjb>
pfdietz: only dynamic bindings.
<pjb>
So it was easier to get "local" variables in the fexpr, since they were all dynamic bindings.
<pfdietz>
pjb: right. Today, in a lisp with lexical bindings, it would have to be done differently.
<pjb>
pfdietz: what are you missing in CL that fexpr would provide?
<jmercouris>
pfdietz: what is an "ordinary" value?
<pfdietz>
jmercouris: that was not my understanding
<pjb>
jmercouris: opposed to a "form" that would have to be evaluated.
<pfdietz>
ordinary value: not a "delayed" value, one that has to be poked somehow to actually compute it.
<jmercouris>
pjb: oh, I see
<pfdietz>
So, laziness in arguments, not in the return value.
<jmercouris>
OK, basically a value that cannot be further computed to get the final value
<pjb>
ok
<jmercouris>
not a representation of a final value, but *the* most computed form
ebrasca has joined #lisp
<jmercouris>
pfdietz: the reason I had this understanding is this statement on wikipedia: "In contrast, when an ordinary Lisp function is called, the operands are evaluated automatically, and only the results of these evaluations are provided to the function; and when a (traditional) Lisp macro is called, the operands are passed in unevaluated, but whatever result the macro function returns is automatically evaluated"
<jmercouris>
why the "but whatever result" if not comparing to FEXPR?
<jmercouris>
maybe the wording need be improved
<pfdietz>
The use case for fexprs was special forms like IF.
<pjb>
pfdietz: there's also the difficulty of the name. Do you want to be able to use (function ,fexpr-name) ?
<pjb>
pfdietz: because deffexpr will have to define a macro with that name.
<pjb>
pfdietz: so perhaps you can use (fexpr ,fexpr-name) instead of (function ,fexpr-name)?
<pfdietz>
That seems poorly phrased. The argument forms are passed into the macro function, which operates on the forms to make a new form. A fexpr, in contrast, looks more like an ordinary function.
<Nilby>
an fexpr is like doing a defmacro and but having a function you can call that applies the macro to the arguments
<pfdietz>
I would not allow #'fexpr-name. The fexpr would be implemented as a macro. It would have to be.
xuxuru has joined #lisp
Inline has quit [Read error: Connection reset by peer]
<jmercouris>
here is something interesting I've read "newLISP is a scripting language designed not to be compiled but to be fully dynamic and introspective."
Inline has joined #lisp
<jmercouris>
this sentence seems to imply that a compiled language is not dynamic nor introspective
<jmercouris>
that doesn't seem true to me
<jmercouris>
also, what *is* a scripting language?
<pfdietz>
I think there are very interesting questions on how to make a compiled language more fully dynamic. For example: how to compile a function so that it can be recompiled, even when calls to it are on the stack, so that returning through those calls things work properly.
Inline has quit [Remote host closed the connection]
<jmercouris>
I guess the stack would need to only contain references to function bodies, rather than the actualy instructions
<beach>
jmercouris: There is no such thing as a "compiled language" or an "interpreted language".
Inline has joined #lisp
<beach>
jmercouris: Those are characteristics of the implementation. Not of the language.
<jmercouris>
beach: that is true, I've come to realize that, but I am meaning that, can a compiled implementation not be dynamic and introspective?
<beach>
jmercouris: The term "scripting language" typically means "I don't know anything about compiler design, so I am going to make a really slow implementation".
<jmercouris>
lol :-D
<jmercouris>
I like it
kilimanjaro has quit []
kilimanjaro has joined #lisp
Inline has quit [Remote host closed the connection]
<pfdietz>
jmercouris: I further want things like references to class slots to be inlined, but the function to work if the class definition is changed while a call through the function is on the stack.
<pjb>
pfdietz: be sure to report whether this is useful!
<pfdietz>
pjb: what I was thinking of didn't involve the arguments remaining as source forms. So I don't think I was thinking of what was called fexprs. Call-by-name arguments, perhaps.
<pfdietz>
jmercouris: a compiler could compile a function in such a way that what's stored on the stack is valid regardless of whether calls were inlined. So, if things change during a call, just return to the non-inlined version of the function. The interesting problem here is code generation that generates this sort of "universal" stack layout.
<pjb>
pfdietz: so if it's a symbol, you pass the symbol, if it's another atom, or a list, evaluate it? What about symbol-macros?
<pfdietz>
pjb: I'm imagining passing thunks.
<pfdietz>
Not source forms (atoms or not).
<beach>
jmercouris: More seriously, there are two widely used meanings of "scripting language". One is a language used for system administration on a typical Unix-like system. The other one is a dynamic language used to make it possible to modify or add to the behavior of an application that is otherwise written in a static language.
<beach>
jmercouris: newLISP seems to be of the first kind.
<pjb>
beach: let's be more precise, on your second definition.
<beach>
pjb: Go ahead.
<pfdietz>
Although call-by-name and call-by-reference are different.
Guest19180 has joined #lisp
banjiewen has quit []
banjiewen has joined #lisp
<pjb>
beach: a script, is a program such as one toplevel form can change the environment in such a way that the semantics of the following forms can be changed at run-time. Compiled CL programs don't do that, at run-time. When you compile a CL program, the toplevel forms can change the environment for the compilation of the following forms. But the semantics are frozen at compilation-time, and cannot change (other than some controlle
<pjb>
ways, such as redefining functions) at run-time.
<Nilby>
So is CL all of a sudden a scripting language if I'm using it as a shell and writing shell scripts?
<pjb>
beach: therefore a CL script must not be compiled (with compile-file). It must be loaded. (or you must provide a different way to compile it).
<Bike>
yeah as i understand a fexpr is pretty simple (since it is after all old) - it's just like a function call except the arguments aren't evaluated. so you'd have like the "fexpr problem" which was (lambda (f x) (f x)), and the argument x is used normally if the f passed in is a function, but if the f passed in is a fexpr it receives the symbol X and the argument is ignored
<Bike>
which is like, pretty weird.
Inline has quit [Remote host closed the connection]
Inline has joined #lisp
<pjb>
beach: the conclusion is that things such as cl-launch that try to ql:quickload libraries and to compile your script before running it disable the scripting feature of CL. You get normal programs.
<beach>
Good to know. I had no idea that "script" had such a precise definition.
<pjb>
beach: (I converted all my lisp scripts into single-image lisp program dispatching according to the invoked program name).
<pjb>
beach: it's my definition.
Inline has quit [Remote host closed the connection]
Inline has joined #lisp
Guest19180 has quit [Ping timeout: 268 seconds]
<pjb>
It's still open to debate whether this scripting feature is something that is needed or that we can always do without. What does it help to solve. Well, in practice we often use it to solve the problem of adapting the script to variable environments (running the same shell script in sh, bash, ksh, on various POSIX systems with different set of available external commands).
<pjb>
In the case of lisp scripts, I've used it to adapt to the presence of not of some features such as the LINUX package in clisp, or the availability of FFI.
<pjb>
This can be also performed by way of compilation-time configuration, when you compile on the system you run. Which is the case with cl-launch, or (since I don't use cl-launch) when you agree to compile your program on the target system, which is often the case with lisp programs (we don't distribute binaries).
<pjb>
So, for now, I'm not sure scripting is really needed. Given the speed of our current computers, writing programs and configuring and compiling them is a satisfactory solution IMO.
<pjb>
Too bad for all those scripting languages invented those last 20 years (perl, python, ruby, etc), and the work on shell implementations…
pvaneynd_ has quit [Ping timeout: 248 seconds]
ebzzry has quit [Ping timeout: 260 seconds]
kajo has quit [Ping timeout: 246 seconds]
<_death>
suspect you mean 30 years ;)
<pjb>
Yes, time flies.
<asdf_asdf_asdf>
Hi. How do "static" variable in CL? I do (defun abc..., (let ((a 1)) ... (abc ...). After one recursion I got again 1, instead 2, 3, etc. I set a to other value (incf a), but (let ((a 1)) do again the same value.
lispyone_ has quit []
v_m_v has joined #lisp
<asdf_asdf_asdf>
I want without optional argument.
lispyone_ has joined #lisp
<_death>
you could (defvar *a* 1) (defun ... (incf *a*) ...), or (let ((a 1)) (defun abc ...)), or use load-time-value, or...
<_death>
since you mention recursion, maybe you want (defun abc ... (let ((a 1)) (labels ((inner ...)) (inner ...))))
<Nilby>
Tempus fugit, Lispus manebit.
davr0s has joined #lisp
<pjb>
asdf_asdf_asdf: CL doesn't provide local static variables. You can use a global dynamic variable (or a global symbol-macro which is lexical). BUT on the other hand, you can have some kind of "static" VALUE, using load-time-value.
<pjb>
asdf_asdf_asdf: of course, since we have solutions, now YOU can implement static variables by defining some macro that will hide those details.
msk has quit [Remote host closed the connection]
<asdf_asdf_asdf>
Thank. But I want this option. (let ((a 1)) (defun abc ...)). Not works.
msk has joined #lisp
<pjb>
asdf_asdf_asdf: it may work, but it has problems. LET doesn't preserve toplevelness (obviously). But it should work.
pjb has left #lisp ["ERC (IRC client for Emacs 26.1)"]
<asdf_asdf_asdf>
(defun aaa (n o) (let ((a 1)) (defun xxx () (incf a)) (if (< a n) (progn (princ a) (aaa n o)))))
<cl-arthur>
asdf_asdf_asdf: do you want a local function inside aaa? Have a look at flet and labels if so.
<asdf_asdf_asdf>
I want increment value a about 1, after recustion I got again 1 instead 2.
frodef has quit [Ping timeout: 265 seconds]
<cl-arthur>
Well, the first thing you do when entering aaa is to bind a to 1, after all. If you do Well, if you do (let ((a 1)) (defun counter () (incf a))), you can call counter any number of times and incf a each time. Why do you have a defun inside a defun?
<asdf_asdf_asdf>
I do recursion. a = 1; (incf a) a == 2 (aaa ...) a == 2; (incf a) a == 3, etc.
<asdf_asdf_asdf>
Now is. a = 1; (incf a) a == 2 (aaa ...) a == 1; (incf a) a == 2, etc.
xuxuru has quit [Quit: xuxuru]
EvW has quit [Ping timeout: 248 seconds]
kajo has joined #lisp
gko_ has quit [Ping timeout: 265 seconds]
<ebrasca>
How to get logs from log4cl ?
frodef` has joined #lisp
v_m_v has quit [Remote host closed the connection]
<beach>
asdf_asdf_asdf: Why don't you program in Common Lisp rather than just trying to use Common Lisp as you would use C?
clothespin has quit [Remote host closed the connection]
narimiran has joined #lisp
cl-arthur has joined #lisp
kmeow has quit [Ping timeout: 260 seconds]
brown121408 has joined #lisp
brown121407 has quit [Read error: Connection reset by peer]
Jeanne-Kamikaze has joined #lisp
v_m_v has joined #lisp
Guest19180 has joined #lisp
Guest19180 has quit [Ping timeout: 260 seconds]
tfb has quit []
tfb has joined #lisp
ggole has quit [Quit: Leaving]
Involuntary has joined #lisp
Jeanne-Kamikaze has quit [Ping timeout: 265 seconds]
Kundry_Wag has joined #lisp
scymtym has joined #lisp
refpga has joined #lisp
tankrim has joined #lisp
slyrus_ has joined #lisp
<ebrasca>
_death: Thanks!
slyrus has quit [Ping timeout: 260 seconds]
Kundry_Wag has quit [Remote host closed the connection]
slyrus__ has joined #lisp
Kundry_Wag has joined #lisp
asdf_asdf_asdf has joined #lisp
slyrus_ has quit [Ping timeout: 265 seconds]
cosimone has quit [Quit: Terminated!]
brown121408 has quit [Remote host closed the connection]
brown121407 has joined #lisp
shka_ has quit [Ping timeout: 265 seconds]
jerme_ has quit []
jerme_ has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
gabiruh has quit [Ping timeout: 240 seconds]
Kundry_Wag has joined #lisp
torbo has joined #lisp
jmercouris has quit [Ping timeout: 260 seconds]
Nilby has quit [Read error: No route to host]
MCP has joined #lisp
cl-arthur has quit [Quit: Lost terminal]
MCP is now known as Guest47586
gabiruh has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
xuxuru has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
v_m_v has quit [Remote host closed the connection]
elderK has joined #lisp
karlosz has joined #lisp
msk has quit [Remote host closed the connection]
msk has joined #lisp
<elderK>
Hey guys, I was wondering how to handle cyclic dependencies in ASDF and if there's an equivalent of a forward-declaration or prototype in Lisp.
<elderK>
I've seen that you can declare ftype, etc.
<elderK>
The reason I ask, is that I have some generic functions, and the specializations require say, the use of some other functions.
<elderK>
But those other functions need to call the generics, or create instances of the specialized types.
<asdf_asdf_asdf>
elderk: "A generic function can be used in the same ways that an ordinary function can be used; specifically, a generic function can be used as an argument to funcall and apply, and can be given a global or a local name."
z147 has joined #lisp
varjag has joined #lisp
<elderK>
asdf_asdf_asdf: Okay. So you're saying I can declare it ahead of time, just like a normal function?
<elderK>
I want to get rid of warnings from SBCL saying "Oh, you're using this before I know about it!"
<asdf_asdf_asdf>
elderK, You must put declaration before used. "Signature function" first. Next call function. At the end body function.
<elderK>
asdf_asdf_asdf: Would you mind providing a simple example?
<Bike>
there aren't really forward declarations. you shouldn't be getting actual errors unless the function is actually called before it's defined
<Bike>
are you getting forward warnings?
<_death>
elderK: you can specify the generic functions in one place (a bunch of defgeneric forms) and have the methods with their bodies in another place
pvaneynd has joined #lisp
frodef` has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<aeth>
I have never seen asdf answer a question with the correct answer.
refpga has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
frodef has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
Guest19180 has joined #lisp
pvaneynd has quit [Ping timeout: 265 seconds]
gravicappa has quit [Ping timeout: 260 seconds]
<elderK>
Thank you all :)
Guest19180 has quit [Ping timeout: 240 seconds]
slyrus has joined #lisp
slyrus__ has quit [Ping timeout: 268 seconds]
GuerrillaMonkey has joined #lisp
zooey has joined #lisp
francogrex has joined #lisp
zooey_ has quit [Ping timeout: 240 seconds]
<francogrex>
Hi any development in SICL? is an implementation ready yet?
<aeth>
asdf_asdf_asdf: that is not at all what elderK meant.
<aeth>
The library ASDF is pretty confusing in terms of when it evaluates things and that's the problem elderK is having. I've had that problem, too. I don't have a solution, though.
<aeth>
elderK: There is a UIOP:SYMBOL-FUNCALL, on the off chance that that's what you needed.
brettgilio has quit [Read error: Connection reset by peer]
<pfdietz>
That's more for when even the package is not available.
brettgilio has joined #lisp
analogue has joined #lisp
analogue has quit [Remote host closed the connection]
<pfdietz>
I've wanted an asdf/quicklisp extension that does the following: when systems S1 and S2 have both been loaded, automatically load system S3.
<pfdietz>
The idea would be that S1 might have some generic function, and for S2 to work properly with it, S2 must define some methods for it. But I don't want those methods defined unless both S1 and S2 are present.
pvaneynd has quit [Ping timeout: 265 seconds]
<_death>
there was asdf-system-connections
EvW1 has joined #lisp
pvaneynd has joined #lisp
vlatkoB_ has quit [Remote host closed the connection]
<pfdietz>
That looks appropriate.
francogrex has quit [Remote host closed the connection]
<asdf_asdf_asdf>
Sorry for misleading. In C is void abc(int, int); abc(2, 4); void abc(int a, int b) { return a+b; }.
v_m_v has joined #lisp
pvaneynd has quit [Ping timeout: 265 seconds]
stzsch has joined #lisp
Kundry_Wag has quit []
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mathrick has quit [Ping timeout: 268 seconds]
eschatologist is now known as lil_DASD
gabiruh has joined #lisp
kajo has quit [Ping timeout: 265 seconds]
Oladon has quit [Quit: Leaving.]
tankrim has quit [Remote host closed the connection]
kajo has joined #lisp
vaporatorius has quit [Quit: Leaving]
ljavorsk has joined #lisp
vsync has quit [Read error: Connection reset by peer]
vsync has joined #lisp
EvW1 has quit [Ping timeout: 265 seconds]
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
ljavorsk has quit [Ping timeout: 265 seconds]
GuerrillaMonkey has quit [Remote host closed the connection]
Guest19180 has joined #lisp
dale has joined #lisp
asarch has joined #lisp
CrazyPython has joined #lisp
<CrazyPython>
How do I make a CLisp macro that takes a number and a statement, and executes that statement that number of times? I've tried playing with "loop" and "defmacro," but no success.
<_death>
CrazyPython: can you write a form that executes (print 'hi) a number of times?
Guest19180 has quit [Ping timeout: 265 seconds]
<CrazyPython>
(loop repeat 5 collect (print 1))
<CrazyPython>
_death
<_death>
ok, this collects the result too, is it what you want?
<CrazyPython>
_death: I don't care if it collects the result or not
waaron has quit [Ping timeout: 268 seconds]
<no-defun-allowed>
Note that the language is called Common Lisp, and the thing you evaluate multiple times is a form.
<CrazyPython>
no-defun-allowed: thanks for the note
<_death>
CrazyPython: ok.. now suppose you already have the macro, how would you use it to do the same?
<CrazyPython>
(defmacro repeat (n f)
<CrazyPython>
(list
<CrazyPython>
'loop repeat n collect f)
<CrazyPython>
)
<CrazyPython>
doesn’t work
<CrazyPython>
(repeat 5 (print 1)) like that
<_death>
good, so you figured out the parameters the macro would take (although maybe you want it to take more than one form to repeat)
<_death>
CrazyPython: your need to build a list that looks like (loop repeat 5 collect (print 1))
<CrazyPython>
(defmacro repeat (n f)
<CrazyPython>
(list 'loop repeat n collect (f))
<CrazyPython>
)
<CrazyPython>
doesn’t work either, I’m doing something wrong
<Shinmera>
listen to what the compiler is telling you
<_death>
CrazyPython: do you know what the quote operator does?
<CrazyPython>
n..not really?
<CrazyPython>
I have no clue where I'd use it
<_death>
the quote (like in "'loop") is read by the reader and turned into the form (quote loop)
<_death>
the quote operator returns its argument without evaluating it
<_death>
so (quote loop) => loop
<_death>
now you have repeat there.. because it's not quoted, an attempt is made to evaluate it
<CrazyPython>
(defmacro repeat (n f)
<CrazyPython>
'(loop repeat n collect (f))
<CrazyPython>
)
<CrazyPython>
gets me “variable n is unbound”
Inline has left #lisp ["Leaving"]
<CrazyPython>
_death: go on
<_death>
(list 'loop) returns a list with the symbol loop: (loop)
<_death>
LIST is a function and its arguments are evaluated before it is called
<_death>
'LOOP evaluates to LOOP
<CrazyPython>
is LIST the same as () ?
<_death>
what does REPEAT evaluate to?
<CrazyPython>
_death: repeat evaluates to an unbound local variable
<_death>
right.. and you want to create a list where the second element is the REPEAT symbol itself
<CrazyPython>
yes
<CrazyPython>
I tried this
<CrazyPython>
(defmacro repeat (n f)
<CrazyPython>
(list 'loop 'repeat n 'collect (f))
<CrazyPython>
)
<Bike>
(list f)?
<CrazyPython>
'[..] invoked undefined function [..]'
<Bike>
yeah, it tries to call a function called f, at macroexpansion time.
<Bike>
in the same way (list 'loop ...) calls a function called list at macroexpansion time.
<_death>
that's progress, but what are you doing with that last arugment to LIST?
<CrazyPython>
_death: Bike says I'm evaluating f at macroexpansion time
<_death>
I mean, why did you write it like that?
<CrazyPython>
I suppose I could quote f and n too, but then how would SBCL know the difference between a literal word repeat and the expression "n"?
<_death>
you're right, you shouldn't quote them
<CrazyPython>
(defmacro repeat (n f)
<CrazyPython>
(list 'loop 'repeat n 'collect f)
<CrazyPython>
)
<CrazyPython>
works!
<_death>
in your macro, you can print the arguments before returning the list: (format t "N=~S and F=~S~%" n f)
<CrazyPython>
Thank you; onto the next part of my DSL
<_death>
yes
elderK has quit [Quit: WeeChat 1.9]
<_death>
maybe before you continue it's best to read about the fundamentals again
<_death>
like evaluation and how to print things so that you can debug them more easily
<CrazyPython>
I was trying to use the 'learn x in y minutes' tutorial, which didn't teach me fundamentals; is "Practical Common Lisp" a different good place to start?
<_death>
yes
JohnMS_WORK has joined #lisp
<CrazyPython>
I'm trying to create a macro "gen" that defines a global variable with a name and sets it to a random number from 1 to 100. I already wrote a function, randint, that does the random number part.
v_m_v has quit [Remote host closed the connection]
lil_DASD is now known as eschatologist
<no-defun-allowed>
Could you please use a paste site for anything longer than a couple of lines, and/or collect your dangling )s and deposit them at the end of the last line?
<CrazyPython>
I shall
<no-defun-allowed>
It might be less annoying to use quasiquotation when creating larger forms in macros, too.
<CrazyPython>
the "gen" expression should evaluate to the generated random number
<_death>
no-defun-allowed: before introducing backquote, may be more beneficial to get it right with plain code
<no-defun-allowed>
For example, the macro body would be `(let ((num (randint ,start ,finish))) (defparameter ,name num) num)
<no-defun-allowed>
I think it "looks" a lot more like the code you want to see, so it may or may not be easier to write.
<_death>
no-defun-allowed: for a person learning the basics of lisp, jumping to backquote before understanding evaluation is a misstep
<asarch>
Is there any debugger tool to check internally the memory, processes and so on?
<CrazyPython>
yay I got it to work
<no-defun-allowed>
_death: Yeah, fair enough.
sjl has quit [Quit: WeeChat 2.2-dev]
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<CrazyPython>
I have a file which defines the functions and macros for my DSL. I also have a file that is written in this DSL. Is there a standard operating procedure for running the file written in my DSL from the CLI?
<CrazyPython>
Right now I'm thinking function dsl() { sbcl <(cat generator.lisp "$1") }
<CrazyPython>
where "generator.lisp" is the header
stzsch has quit [Remote host closed the connection]
<CrazyPython>
my DSL is a simple thing for non-deterministically generating files witht numbers inside; I want to quickly save&run from CLI
<_death>
if you download portacle you get an environment with emacs and slime set up, then the Lisp read eval print loop can serve as the console
<mfiano>
With the MOP, is there a portable way to get the most applicable :AFTER method object of SHARED-INITIALIZE when called with a specific class? I was looking at COMPUTE-APPLICABLE-METHODS-USING-CLASSES, but that expects as its first argument a generic function and will work for REINITIALIZE-INSTANCE, but not SHARED-INITIALIZE because it takes 2 required arguments.
<_death>
mfiano: eh? why wouldn't it work?
<Bike>
the second argument will probably not be specialized on, and you can just pass (class-of t)