nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #lisp
patlv has quit [Ping timeout: 268 seconds]
pjb has quit [Read error: Connection reset by peer]
pjb has joined #lisp
rumbler31 has quit [Remote host closed the connection]
robotoad has quit [Quit: robotoad]
fikka has joined #lisp
nowhere_man has quit [Ping timeout: 256 seconds]
nowhere_man has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
edgar-rft has quit [Quit: Leaving]
edgar-rft has joined #lisp
iridioid has joined #lisp
pjb has quit [Remote host closed the connection]
robotoad has joined #lisp
pjb has joined #lisp
v0|d has joined #lisp
equwal has joined #lisp
charh has quit [Quit: quit]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
payphone has joined #lisp
rozenglass has joined #lisp
matzy_ has joined #lisp
<matzy_>
for someone who knows how to program, what's the best site for just googling how to do common things in CL? I'm writing my first script in it. Stuff like (when) clauses that scheme has
<matzy_>
and yes, by google, i just meant searching
<matzy_>
*googling
Demosthenex has quit [Ping timeout: 264 seconds]
<aeth>
I do duckduckgo searches prefixed in "!l1sp"
<antoszka>
matzy_: A single place with recipes doesn't really come to mind – though when you google "common lisp <foo bar>", you'll usually get results from http://cl-cookbook.sourceforge.net/index.html
<antoszka>
matzy_: or get pointed to the semi-official Common Lisp HyperSpec
beach has joined #lisp
<beach>
Good morning everyone!
kenster has quit [Ping timeout: 265 seconds]
<no-defun-allowed>
hi beach
<beach>
matzy_: [I am reading the logs] can you give some example of "common things" to do in programming? Most common things would be done the same in Common Lisp as in other languages I would think. Except that the syntax and the conventions are different of course.
kuwze has quit [Ping timeout: 252 seconds]
patlv has joined #lisp
pjb has quit [Remote host closed the connection]
<v0|d>
beach: which lisp is your daily driver?
<beach>
Do you mean which implementation of Common Lisp do I use for my daily work?
<beach>
If so, SBCL.
<v0|d>
See.
pjb has joined #lisp
Kundry_Wag has joined #lisp
<matzy_>
ok, thanks for the info everyone
<beach>
v0|d: Why do you ask?
<LdBeth>
hello
<v0|d>
beach: it is interesting to see how SBCL dominates atm.
<matzy_>
beach: here's an example - i'm trying to traverse directories of files and add text before certain functions, do this all automatically of course with CL
<matzy_>
certain functions need a prefix but we have hundreds at this point so doing it manually would be a massive pain. there's an example
<beach>
matzy_: I see.
<matzy_>
unfortunately the documention for cl is a bit...scattered it seems
<beach>
Oh?
patlv has quit [Ping timeout: 240 seconds]
<LdBeth>
matzy_: it's a matter of using pattern matching
<matzy_>
scheme has (when) clauses, but it was hard to google and see if that exists in CL
<beach>
matzy_: I don't recommend using a search engine for that.
<beach>
matzy_: I recommend using the Common Lisp HyperSpec.
<beach>
matzy_: You look in the symbol index, under `w', and you will see WHEN.
<matzy_>
well emacs autocomplete told me when is a macro, which...is that different than just a function? i've gone through simple macro exercises
<matzy_>
but i would expect when to just be like it is in scheme, i wouldn't expect it to be a macro
<beach>
matzy_: It seems you need to learn more about the basics by reading some book, rather than using a search engine.
<beach>
And, yes, a macro is different from a function.
<beach>
Why would you expect Common Lisp to be like Scheme?
<matzy_>
yeah, probably, i started learning racket but decided cl was probably more useful, have something i need to do and want to do it in CL so am trying to learn on the fly
Bike has quit [Quit: Lost terminal]
<matzy_>
i can get around fine in racket
<beach>
matzy_: The two are very different.
<v0|d>
matzy_: paip has a one-liner solution to your problem.
<matzy_>
is that a package>
<matzy_>
paip?
<v0|d>
a book.
<beach>
matzy_: I think your basic assumption is wrong, i.e. that there are only minor differences between Scheme and Common Lisp, and that you can just figure out those differences as you go.
Arcaelyx has quit [Read error: Connection reset by peer]
<matzy_>
yeah i'm big on emacs and learned about how awesome slime and the emacs env was with cl so wanted to switch over
<matzy_>
maybe i'll just write this in racket
<beach>
That might be easier.
<beach>
If what you want is for things to be "easy".
<matzy_>
i mean i'm fine spending some time learning
<matzy_>
i really want to, seems like a good opportunity
<beach>
matzy_: It works here. It prints the single directory that you gave the name of.
<LdBeth>
matzy_: because PRINT does not print file
<beach>
matzy_: Perhaps you assume that DIRECTORY returns a list of files in that directory?
Arcaelyx has joined #lisp
<beach>
matzy_: What did you expect would happen with your example?
fikka has quit [Ping timeout: 248 seconds]
<beach>
... and why did you expect that?
<matzy_>
beach: you're right. i thought it would print each file in the dir
<matzy_>
but i think i see why
<beach>
So in cases like this, the right thing is to go read the Common Lisp HyperSpec entry for DIRECTORY.
<matzy_>
beach: i did but honestly it's kind of confusing
<matzy_>
i wish they just had an example
<beach>
I think you will find plenty of examples in the books we recommended.
<beach>
The Common Lisp HyperSpec is for the exact definition of what things do.
<matzy_>
like how do i use the key with the pathnames, cant you just put a variable as the third arg or do you need a random key in front of it?
omilu has joined #lisp
<beach>
Oh, for that, you need to know more about the fundamentals of Common Lisp. Keyword arguments may not exist in the other languages you have used.
<beach>
Though the Common Lisp HyperSpec entry says precisely what you should expect.
lagagain has quit [Quit: Connection closed for inactivity]
Kundry_Wag has quit [Remote host closed the connection]
<beach>
I.e. it says you have to go to the manual of your Common Lisp implementation to find out what keyword arguments your implementation-specific version of DIRECTORY accepts.
<matzy_>
ahhh ok i see what that means now
<matzy_>
i didnt get that before
Kundry_Wag has joined #lisp
<matzy_>
im on sbcls now and it helps a lot more
<LdBeth>
I think CL's filename wildcard is quite weird bacause it works totally different from how unix shell deals with file
<beach>
matzy_: I can see why you are frustrated. You oscillate between wanting to just know the delta between what you already know and how to do it in Common Lisp. But then you lack some very fundamental concepts of Common Lisp, so you are not able to read the Common Lisp HyperSpec entries.
<LdBeth>
so, (directory #P"~/Desktop/*.*") matchs all files on $HOME/Desktop even include dirs and files without a extension name.
pjb has quit [Remote host closed the connection]
<equwal>
Personally it took me a long time to understand the hyperspec. I wouldn't recommend using it as a primary reference until you already have lots of experience using the language. A beginners book like PCL is much more helpful.
rumbler31 has joined #lisp
<aeth>
l1sp gives both HyperSpec and PCL results
matzy_ has quit [Ping timeout: 240 seconds]
<equwal>
Until then, it can be good to look at the hyperspec to remember how functions you already know work, and that experience will acclimate you to what they mean.
<equwal>
(what the hyperspec means with its somewhat confusing specificity)
rumbler31 has quit [Ping timeout: 264 seconds]
Kevslinger has quit [Quit: Connection closed for inactivity]
elfmacs has quit [Ping timeout: 268 seconds]
rozenglass has quit [Ping timeout: 244 seconds]
Copenhagen_Bram has quit [Read error: Connection reset by peer]
quipa has quit [Ping timeout: 244 seconds]
Copenhagen_Bram has joined #lisp
Fare has quit [Ping timeout: 260 seconds]
light2yellow has joined #lisp
meepdeew has joined #lisp
kozy_ has joined #lisp
kozy has quit [Read error: Connection reset by peer]
iridioid has quit [Ping timeout: 240 seconds]
Khisanth has quit [Ping timeout: 240 seconds]
Inline has quit [Remote host closed the connection]
otwieracz has quit [Quit: leaving]
igemnace has joined #lisp
sauvin has joined #lisp
Khisanth has joined #lisp
asarch has quit [Quit: Leaving]
fikka has joined #lisp
otwieracz has joined #lisp
phoe has joined #lisp
otwieracz has quit [Client Quit]
meepdeew has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 264 seconds]
otwieracz has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
mathZ has joined #lisp
uint_ is now known as uint
mathZ has quit [Remote host closed the connection]
JuanDaugherty has quit [Quit: Exeunt]
fikka has joined #lisp
danielxvu has joined #lisp
danielxvu has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zigpaw>
I think somewhere on hackernews discussion I have read that even if it is named like so it is far from the original and because some of the technical decisions made it would be hard to extend it even near the CLOS functionality. Haven't tried it myself though.
cross has quit [Quit: Lost terminal]
danielxvu has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jackdaniel>
that's what I've meant by saying "second slide tells it all", he says that term is taken from "The art of meta-object protocol" but he never actually read this book
<beach>
How do you know that?
danielxvu has joined #lisp
<jackdaniel>
beach: see the second slide, he mentions amop and second book, and the second book has a remark, that this one he actually read
housel has joined #lisp
<jackdaniel>
natural conclusion is that he didn't read the first one
<beach>
Oh!
<beach>
Right you are.
<beach>
Heh!
danielxvu has quit [Client Quit]
<beach>
What a joke.
<jackdaniel>
indeed, not very funny though
<beach>
Yeah, not that kind of joke.
<beach>
So soon Python programmers will believe they have a MOP just like C++ programmers believe they have garbage collection.
fikka has quit [Ping timeout: 240 seconds]
danielxvu has joined #lisp
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has joined #lisp
<zigpaw>
C++ got something that can be named GC? (haven't use C++ for quite few years now so that's something new to me)
orivej has joined #lisp
<Shinmera>
reference counting \o/
<jackdaniel>
beach: are you referring smart pointers?
<beach>
jackdaniel: Yes, but I recall there is more now as well.
drewes has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
jack_rabbit has joined #lisp
<beach>
I don't remember the details, but I think it was someone in Clasp who said with a "straight face" that C++ has garbage collection, "so why don't you just use it for Clasp instead of MPS or Boehm".
<jackdaniel>
so we'll take type system from javascript, garbage collection from c++ and metaobject protocol from python and we are good, CL-2.0 :-)
drewes has quit [Client Quit]
Guest5800_ has quit [Quit: Connection closed for inactivity]
terpri has quit [Remote host closed the connection]
beach has quit [Disconnected by services]
beach has joined #lisp
fikka has joined #lisp
drewes has joined #lisp
<beach>
Yes, good plan! :)
<no-defun-allowed>
reference counting is GC like....erm.....street food has good souvlakis
akkad has joined #lisp
<jackdaniel>
it has some nice characteristics though (given I've understood my recent read) - amount of work is proportional to the program flow
<beach>
Yes, but you can still have unbounded pauses.
<jackdaniel>
so while you have worse overall gc performance you may have some time guarantees and no pauses
<jackdaniel>
or, pauses which count as part of dereferencing operations
<beach>
And those pauses can be arbitrarily long.
<jackdaniel>
why wouldn't you be able to put an upper bound on these pauses? I must miss some crucial detail with that regard
<beach>
You can have an arbitrarily large data structure with a single root.
<beach>
When you lose the last reference to the root, you have to recursively free every object in the data structure.
<jackdaniel>
ah, that's what you mean. I see now
shrdlu68 has joined #lisp
<jackdaniel>
thanks
<beach>
Sure.
<beach>
Plus, the overhead of managing the reference counter, and the overhead of the malloc/free style allocation is much grater than the overhead of a modern tracing garbage collector.
<beach>
So in summary, C++ programmers think they have a "fast language" with garbage collection that has real-time behavior. In reality they have reference counters that slow things down, that can't handle cycles, and that are still not real-time.
rumbler31 has joined #lisp
lnostdal has quit [Ping timeout: 264 seconds]
<beach>
Just to manage the reference counter takes two memory accesses and a test/branch for each assignment. With RAM being considerably slower than registers it is going to slow things down a lot.
<LdBeth>
Ada use the idea of memory pool to help free large chunck of data
<beach>
Yeah, good luck with that.
<beach>
It breaks every abstraction barrier in the book.
<beach>
As I recall, GCC recently moved away from obstack-style allocation.
<beach>
My guess is that it was unmanageable. Now they are using some GC, maybe Boehm.
<jackdaniel>
they do use libgc (boehm) indeed
<beach>
Why someone like RMS would implement a C compiler in C is very hard for me to understand. Maybe it's just that he didn't have a decent Lisp system available at the time.
<beach>
I should ask him at some point.
rumbler31 has quit [Ping timeout: 256 seconds]
<LdBeth>
he doesn't even have an OS avaliavle
lnostdal has joined #lisp
<beach>
I can see where this argument is going and I don't like it.
<akkad>
R "Hey!, wait up guys!" MS
<jackdaniel>
isn't that at that time Lisp didn't have decent compilers for personal computers? also being able to bootstrap compiler from the same language you compile is something many people strive for (you included, you want to bootstrap CL from CL)
<loke>
jackdaniel: this is the era of ITS. You can connect to an open ITS system today and try out Maclisp if you want.
<loke>
It works great, but not good for low-level stuff
<beach>
jackdaniel: I think your first argument is correct. All he had was Franz Lisp aand Emacs Lisp and both those were probably unacceptable.
<beach>
jackdaniel: But I don't believe for a second that RMS had the ambition to bootstrap from the same language. He is a smart guy and I am sure he knew that it would be much easier to implement it in Lisp. I mean, look at RTL. It is definitely Lisp inspired.
<loke>
beach: Emacs Lisp didn't exist when rms started the GNU project, no? didn't he start GNU Emacs around the same time as GCC?
<LdBeth>
Emacs is later
<LdBeth>
I mean GNU/Emacs
<beach>
loke: I think GNU Emacs came first. 1984 as I recall.
<beach>
I still remember the Email from RMS. I know where I was.
<loke>
Just looked it up
<jackdaniel>
implementing thing is one thing, maintaining it is another. you can't benefit from your own optimizations, many people wouldn't know Lisp, and if they knew they wouldn't use C (smaller contributor base) etc
<jackdaniel>
but I may be wrong of course
<jackdaniel>
I wasn't born back then :-)
<loke>
GNU Started in 1984, Emacs in was rleased in 1985. First release of gcc was 87
<LdBeth>
ok, then
<loke>
jackdaniel: You're a kid :-)
shrdlu68 has quit [Ping timeout: 260 seconds]
<akkad>
the best lisp was the non-free ones right?
<beach>
jackdaniel: Yes, that could be an issue. The reason Unix was chosen was for that reason. And that was strategically correct, and a very admirable decision. I would have made the wrong one.
<loke>
akkad: That dpeends on when... Maclisp was very good
<loke>
akkad: Then there was Interlisp which was a weird beast
shrdlu68 has joined #lisp
* akkad
waits for mezanno become self hosting
<jackdaniel>
loke: I prefer the term "fresh blood" ;-) also, being older isn't something to brag about if you think about it
<loke>
jackdaniel: It's all I have to show :-(
<beach>
Aww.
<jackdaniel>
I had a guest yesterday and I was bragging about things I posses
<jackdaniel>
I've shown him my PAIP book, my Lisp in Small Pieces book, CL recipes book
<loke>
jackdaniel: Such as? Intelligence? Good looks? Bulging biceps?
<jackdaniel>
and my recent thing I bought: "the garbage collection handbook"
<beach>
Congratulations!
<LdBeth>
GG
<loke>
jackdaniel: If you're not into CS, I imagine that book title would seem very strange. :-)
<jackdaniel>
well, having books on a shelf isn't something to brag about either until you read them :p
<beach>
jackdaniel: Awful writing, but contains all the information. If there is something you don't understand, don't think it's your fault necessarily.
<jackdaniel>
well, he is into CS (he is a professional C# programmer with mathematics background)
<loke>
The best computing book I read recently was “The Apollo Guidance Computer - Design and Operation”
shrdlu68 has quit [Client Quit]
<loke>
That one describes both the hardware ans fotware on a ridiculopusly low level. After reading that book you'll be able to read and understand and AGC source code:
<beach>
Now, if we could only get Steven Pinker to write about garbage collection...
<jackdaniel>
show me your bookshelf and I'll tell you who you are ;)
<LdBeth>
I'm looking Design by Contract and static analysis
<beach>
jackdaniel: Bah, too easy in my case. :)
<beach>
jackdaniel: Try the bookshelf of my (admittedly small) family and you will have a much harder time.
<jackdaniel>
well, I have quite chaotic bookshelf, I'm just not bragging about non-CL related books here
<jackdaniel>
and this gets into offtopic regions, so I apologise for leading that way
<LdBeth>
GG (again
shrdlu68 has joined #lisp
hvxgr_ has quit [Ping timeout: 244 seconds]
<shrdlu68>
He hoped to avoid having to write a compiler from scratch.
kerrhau has joined #lisp
<LdBeth>
I believe it's not hard to translate Pascal to lisp
<beach>
What makes you believe that?
<beach>
... and why is it relevant?
<akkad>
LdBeth is bringing it back in a retro sort of hipster way
<LdBeth>
GCC was first translated from a Pascal compiler
<shrdlu68>
He might be referring to the fact that GCC was adapted from the Pastel compiler.
<beach>
So how is that relevant to Lisp?
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jackdaniel>
he medidates about the possibility of writing GCC in Lisp (something you have suggested earlier)
<aeth>
LdBeth: The problem with translating from languages that aren't expression-oriented into Lisp is that lots of basic idioms change. Like instead of doing "foo;" and then having a big set of if/then/else statements that set the foo to different values, you use cond to return a value into foo. And lots of language idioms are just working around not having true multiple return values.
<aeth>
There's lots of little things that makes it not trivial
<shrdlu68>
But those were the early efforts. That didn't work out, so eventually he had to write GCC from scratch. At this point he could've used Lisp.
drewes has joined #lisp
<LdBeth>
shrdlu68: Probably due to a LICENSEE issue.
<beach>
LdBeth: No. Read up on your history.
<loke>
beach: He might be thinking of that Pascal compiler which was written in Pascal, which was bootstrapped by manually compiling the pascal compiler to machine code.
<loke>
By hand
CrazyEddy has joined #lisp
<shrdlu68>
LdBeth: the issue appears to have been wholly technical.
<jackdaniel>
history-ecolisp-v011.tgz and history-ecolisp-v012.tgz
<jackdaniel>
probably I should create tarballs of older ECL releases too
<shrdlu68>
One would presumably have to find the gcc from that era.
<shrdlu68>
If it compiled to ANSI C, it should work, right?
<jackdaniel>
shrdlu68: it's not only that. some kcl parts were opencoded in assembly to speed thigns up, so there were some conditionalization for instance for VAX etc
<aeth>
Will it still run on a VAX?
<jackdaniel>
but I believe it would be possible to make it compile with some effort
<jackdaniel>
aeth: kcl? maybe, if you find right compiler and machine to run it on; ecl? no, support has been removed long ago
<aeth>
jackdaniel: What I mean is that it might be easier to run KCL on a VAX emulator
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shrdlu68>
I remember reading somwhere that guys on the Western sphere hadn't considered a compile-to-c CL compiler before KCL.
beach has quit [Remote host closed the connection]
<jackdaniel>
according to what I have read /somehwere/ they were definetely impressed that KCL was written completely from scratch and based on a standard draft (not evolved from a previous lisp)
<aeth>
VAX emulators definitely exist. If one comes with a compiler, it might be easier to compile KCL with that than trying to get it to run on x86 with a modern Linux. e.g. https://en.wikipedia.org/wiki/SIMH
<jackdaniel>
(standard used was CLtL1)
<shrdlu68>
They couldn't wait for ANSI.
fiddlerwoaroof has quit [Read error: Connection reset by peer]
<jackdaniel>
well, it was like 9 years before ansi when KCL was published
kozy_ has quit [Remote host closed the connection]
kozy has joined #lisp
beach has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
beach has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
Lycurgus has joined #lisp
Jesin has quit [Ping timeout: 265 seconds]
Bronsa has joined #lisp
<flip214>
sjl: check my vlime master branch if you find some time; feedback would be welcome.
hvxgr has joined #lisp
froggey has quit [Ping timeout: 240 seconds]
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
froggey has joined #lisp
beach has joined #lisp
kerrhau has quit [Ping timeout: 265 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
danielxvu has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
flazh has joined #lisp
psfm has joined #lisp
lel has quit [Ping timeout: 244 seconds]
lel has joined #lisp
psfm has left #lisp ["Leaving"]
light2yellow has quit [Quit: light2yellow]
danielxvu has joined #lisp
danielxvu has quit [Client Quit]
nullniverse has quit [Remote host closed the connection]
nullniverse has joined #lisp
nullniverse has quit [Client Quit]
schjetne has joined #lisp
<phoe>
minion: memo for stylewarning: Hey - please poke me when you have a free while, I'd like to discuss a thing with you
<minion>
Remembered. I'll tell stylewarning when he/she/it next speaks.
rozenglass has quit [Remote host closed the connection]
Kaisyu has quit [Quit: Connection closed for inactivity]
elfmacs has quit [Ping timeout: 240 seconds]
<flip214>
I've got a (DOTIMES (i 10) (foo)). Thinking that as I don't use variable i I should do (DECLARE (IGNORE i)) is exactly the wrong thing...
<flip214>
" I is being set even though it was declared to be ignored." and "reading an ignored variable: I"
random-nick has joined #lisp
<no-defun-allowed>
no, dotimes changes i so you shouldn't ignore it
<phoe>
flip214: look at the macroexpansion of DOTIMES to see what's going on
drewes has joined #lisp
<beach>
flip214: It is better to do (loop repeat 10 do (foo))
<phoe>
beach: what are the reasons for that?
<phoe>
I can see that personal preference plays a role, but I'm curious for other ones.
m00natic has joined #lisp
<shrdlu68>
Because there's nothing to ignore? In the sense that it is a more concise and straightforward way to merely repeat something 10 times.
<phoe>
I see. Yep, there's one unused variable less.
<beach>
Yes, you don't have to introduce a variable. It is going to be a GENSYM in general.
<beach>
So the intention is more clear.
<phoe>
Yep, I see.
<flip214>
I would've guessed that DOTIMES uses a GENSYM internally, and just does (LET ((,var ,gensym)) ,@ body) to protect it -- and then the IGNORE would've made sense.
<flip214>
ah, but CLHS says
<flip214>
> The body of the loop is an implicit tagbody
<flip214>
doesn't that contradict
<flip214>
> It is implementation-dependent whether dotimes establishes a new binding of var on each iteration or whether it establishes a binding for var once at the beginning and then assigns it on any subsequent iterations.
<flip214>
if the BODY is a TAGBODY, there wouldn't be a new binding?!
<trittweiler>
flip214, it could use PROG
<beach>
Either way, the intentions are more clear if you use a construct that does not force you to invent a variable that you do not intend to use.
<flip214>
beach: true. but DOTIMES is shorter and captures the intent nicely, too!
<trittweiler>
flip214, The paragraph you quoted is actually important. It means you need to be careful when you create a closure over the iteration variable
<trittweiler>
(let ((thunks '())) (dotimes (i 10) (push (lambda () i) thunks)) (mapcar #'funcall thunks)) might evaluate to (list 0 1 2 ...) or (list 9 9 9 ...)
<flip214>
trittweiler: yeah, exactly. same problem as when eg. creating a thread.
eschatologist has quit [Ping timeout: 244 seconds]
fikka has joined #lisp
quipa has joined #lisp
eschatologist has joined #lisp
elfmacs has joined #lisp
fluke` has quit [Read error: Connection reset by peer]
markoong has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Jesin has joined #lisp
MrSleepy has joined #lisp
fikka has joined #lisp
Bronsa has quit [Ping timeout: 268 seconds]
fikka has quit [Ping timeout: 244 seconds]
pjb has joined #lisp
dddddd has joined #lisp
rozenglass has joined #lisp
fikka has joined #lisp
nowhere_man has quit [Read error: Connection reset by peer]
fikka has quit [Ping timeout: 256 seconds]
nowhere_man has joined #lisp
MoziM has joined #lisp
Bronsa has joined #lisp
fikka has joined #lisp
adlai has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
eminhi has joined #lisp
stux|RC has quit [Ping timeout: 245 seconds]
LiamH has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
magicGNUPONUT[m] is now known as Gnuxie[m]
Lycurgus has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
josemanuel has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
Fare has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
rumbler31 has joined #lisp
fikka has joined #lisp
zfree has quit [Quit: zfree]
Bike has joined #lisp
X-Scale has joined #lisp
patlv has joined #lisp
ofi has quit [Remote host closed the connection]
Guest5800_ has joined #lisp
Cymew has quit [Remote host closed the connection]
igemnace has quit [Read error: Connection reset by peer]
eddof13 has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
nanthil has joined #lisp
<nanthil>
hello all. I have a question. about how to do something in common lisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nanthil>
https://www.reddit.com/r/learnlisp/comments/941f7v/paul_graham_lisp_or_avoiding_the_clos/ I wrote this yesterday, and I'm not really interested in paul graham specifically, I'm interested in if there are any LISP capabilities that can accomplish polymorphism without use of the CLOS. Not because I feel one way or another about it, but I'm wondering how something like a LISP 1, a "pure" (in quotes) LISP with only functions would accompl
<dlowe>
nanthil: what's your question?
<nanthil>
a giant switch/cond expression
<dlowe>
there's always the option of having a giant cond expression
FreeBirdLjj has quit [Remote host closed the connection]
<nanthil>
yes I know that, but in UNIX, with C, STDIN was polymorphic and they didn't add a giant switch statement based on every possible keyboard input device available
<beach>
nanthil: You can't not use CLOS. It's part of the language. Do you mean avoiding generic functions? Why would you do that?
<dlowe>
sure, they used function pointers to dispatch between keyboard drivers
<nanthil>
its a thought experiment
<nanthil>
how would you a chieve functional polymorphism without a giant cond expression
<beach>
nanthil: When you write LISP, we think of a language from the 1970s or so.
<dlowe>
you can use lisp functions in a similar way, with a hashtable associating types and functions
<Shinmera>
I don't know if I remember correctly, but wasn't CLOS or Flavours built as a Library on top of existing Lisp systems at the time?
<dlowe>
or by storing function dispatches in a table
<schweers>
nanthil: I’m not entirely sure where you’re going with your thought experiment, but you /can/ of course roll your polymorphism. Using vtables is the classing single minded^Wdispatch way to go. But then again: why would you?
<dlowe>
the advantage of using CLOS is that your implementation can provide optimizations that aren't easily available otherwise
<beach>
Shinmera: Sure, PCL was a library meant to turn a CLtL1 into one with CLOS in it.
<nanthil>
because I'm trying to grok the idea that there's polymorphism outside of object orientation
<nanthil>
and how you would accomplish that functionally
<Shinmera>
beach: Ah, right.
<nanthil>
like what does that look like
<schweers>
nanthil: well, haskell has static polymorphism without being object oriented. The compiler can dispatch on the type of the arguments.
<nanthil>
so lisp doesn't have a typed dispatch model?
<beach>
nanthil: First you need to decide what you mean by "polymorphism". Some people think it is a compile-time feature and that nothing happens at run-time.
<Shinmera>
beach: and also what he means by "object orientation"
<beach>
That too.
<nanthil>
no beach: i mean simply that a call to a method will call the correct method
<nanthil>
i mean
<LdBeth>
In pure funcational one can not even write a Tetris
igemnace has joined #lisp
<nanthil>
can we stop being pedantic.
<beach>
nanthil: It is important to know precisely what you try to accomplish.
<dlowe>
it's really hard to both not be pedantic and to be sufficiently understood
<Shinmera>
nanthil: No, because we don't understand what you want us to tell you.
<LdBeth>
so the answer is simply NO
<dlowe>
because a lot can hinge on slight variations
<nanthil>
OOP as in the industry nonsensical bastardized common usage Java C# and C++ style of class based langauges attempting the 4 so-called pillars of OOP
<nanthil>
what I'm trying to accomplish can be found in explicit detail in my link
<dlowe>
the usual advice is to kick pg to the curb and pick up a more reputable lisp source
<nanthil>
how would you call a "sublcass.attack()" and "subclass2.attack()" when both subclasses implement a common interface
<nanthil>
in lisp (attack player enemy) and (attack enemy player) will call the same attack method unless there's some kind of dispatch model
<beach>
nanthil: Given that you don't use static typing, you need run-time dispatch. And that is exactly what generic functions do.
<Xach>
free help is usually provided in the form the helper wants, and if the helpee is lucky, it will align with what they want too.
xrash has joined #lisp
<nanthil>
beach: I'm not asking how to do it in the CLOS, I'm asking how would it be done without cond using native LISP constructs
<schweers>
nanthil: Paul Graham talked about having closures in hashtables, if I recall correctly. Maybe this is what you’re asking about? That way you can have a hashtable instead of an object and put functions (“methods”) into the table. This way you don’t call the same function every time, but the one provided by the object.
<beach>
nanthil: CLOS is native Common Lisp.
<nanthil>
schweer: where could I read about that?
<schweers>
This gives you a sort of polymorphism, but no inheritance (unless I’m missing something)
<schweers>
uhh .. dunno
<nanthil>
beach: you're not hearing me. there is a core of lisp upon which CL is defined
<nanthil>
inside that core, how would you accomplish polymorphism
<beach>
nanthil: Yes, I consider that core to be CLOS.
<nanthil>
well you would be wrong
<nanthil>
historically and currently
<schweers>
nanthil: beach is right. CLOS is part of the ANSI standard
<dlowe>
that and a dollar will get you a cup of coffee
<nanthil>
because I am not well versed in the lambda calculus and I got to thinking how would one accomplish that with the basic universal lisp features
<dlowe>
I bet if you wrote some lisp programs it would become much more clear
<nanthil>
i'm in the middle of writing one and I was reading into the CLOS, and read something about how it was implemented. it got me thinking, and that's what brought me here
<schweers>
nanthil: I guess you might just read the second chapter of the book. It’s even available online. But take the whole book with a grain of salt
<nanthil>
schweers: what flavor of salt should I take it with?
<dlowe>
nanthil: you won't be able to understand it without the previous chapters
<nanthil>
ok
<nanthil>
I'll give it my best swing
<nanthil>
thanks all
<schweers>
nanthil: before you go
<nanthil>
yes
<nanthil>
i'll be here
<dlowe>
nanthil: what kind of program are you writing?
<nanthil>
you can get a sense for what I'm going for here
<nanthil>
it's a small program that I use to help me learn how to GSD with a language I'm learning
<nanthil>
it's surprisingly effective
<schweers>
in your TL;DR section you asked about multiple dispatch without CLOS. I guess you can implement it yourself using a mix of functions and macros, but beware that this is exactly what we have defgeneric for
<nanthil>
but not specifically multiple dispatch, so much as that's the best way I can articulate the core of the idea that I'm trying to get it
<nanthil>
it seems to me that the article before I added that statement was perfectly intelligible, but people still weren't getting at what I was trying to ask
<beach>
nanthil: In your code you have some undefined behavior it seems.
<nanthil>
I'm a total novice
<nanthil>
I'm open to input
elfmacs has quit [Quit: WeeChat 2.2]
<schweers>
TIL that defining new method combinations is part of the CL standard (i.e. without MOP).
<beach>
(setf action-names (get-keys actions)) Where is action-names defined?
<beach>
The code is also incorrectly indented. May be because you have TAB characters in the code, though.
<nanthil>
with setf
<nanthil>
I was using setf to define it in place
Lycurgus has joined #lisp
<beach>
That is not what SETF does.
<beach>
The variable has to be defined first.
<beach>
clhs setf
<pjb>
nanthil: objects are equivalent to closures. Closures are just mere functions. polymorphism is natural since it's just a matter of passing different arguments to different closures.
<beach>
nanthil: Since when is a language defined by the behavior of a single implementation?
<nanthil>
i'm not arguing
<beach>
nanthil: When I said "undefined" I meant it.
<schweers>
you can probably run it with several implementations. SBCL gives me a warning when I try this sort of thing.
<nanthil>
I'm trying to point at the fact that saying its wrong isn't revealing the correct way to me
cpape has joined #lisp
<pjb>
nanthil: so basically, you're asking "if I inflate my pulmons, will I breath?
<nanthil>
so if you would do that I would join you in understanding :)
<pjb>
"
<pjb>
s/pulmons/lungs/
<dlowe>
nanthil: define your variable ahead of time with DEFVAR
<nanthil>
:pjb: idk what you're trying to say beach: it would be nice if you told me how I'm supposed to do it
<beach>
nanthil: I have my doubts, but hey. DEFVAR, DEFPARAMETER define variables. SETF can be used to assign to an already defined variable.
<nanthil>
but defvar kept defining things globablly
<dlowe>
nanthil: feel free to join #clschool
<nanthil>
and I don't want that
<beach>
nanthil: If you want locally, you use LET or LET*
<nanthil>
so setf is only mutation?
<beach>
nanthil: You will be very surprised if you think your SETF creates a fresh lexical variable.
<nanthil>
I am surprised
<nanthil>
color me surprised
<nanthil>
but that's what I'm trying to do. this is my first LISP program
<nanthil>
so
<nanthil>
I'm open to direction
<nanthil>
because I want to know the right way so I can skip all the wrong ways as quickly as possible
<beach>
I am not so sure about ath.
<beach>
that
<Bike>
setf is not like a c declaration or whatever. it only mutates bindings.
<Bike>
if you want to define a local variable, you use let or let*.
<schweers>
on which you can use SETF if you like
<beach>
nanthil: So it's more than just a thought experiment. You are writing real code with it.
<nanthil>
i mean
<nanthil>
the code isn't real
<nanthil>
it's a toy learning program
FreeBirdLjj has joined #lisp
<beach>
And what is it that you are trying to learn?
<nanthil>
functional polymorphism
<nanthil>
as I've said
<beach>
Certainly not Common Lisp, which is what this channel is dedicated to.
<nanthil>
and common lisp
<nanthil>
jesus
<nanthil>
i'm in the midst of learning common lisp and came to the question of polymorphism and in reading the CLOS I had this question
<nanthil>
c'mon man. how many ways and times can I say it
<nanthil>
oops I made a mistake using setf in my _first lisp program_ don't shoot me over it
<Bike>
from pure lambda calculus, you can construct objects that respond to a query for their type, and then you can do different behavior based on that type.
<Bike>
it's a pretty academic exercise, of course.
<nanthil>
bike: of course, learning lambda calculus is an ongoing endeavor for me
<beach>
nanthil: Look, you admit to be a newbie. Yet you question the wisdom of practically everyone here, and you tell people flat out that they are wrong about factual things like what this channel is about.
<nanthil>
i'm not questioning any wisdom
<beach>
nanthil: That's very impolite in my book.
<nanthil>
i'm questioning
<zianic>
I think you should try the recomended CLOS polymorphism then move to trying to figure out how to implement it differently. It seems to me that you're trying to learn several different things at once. Which just makes it harder than it needs to be.
<nanthil>
i'm interrogating to find answers and knowledge
<nanthil>
that's what you do
<pjb>
nanthil: so you see, you can send the inc or get messages to different objects, and obtain different processings and results. Plain lisp function (closure) -based polymorphism.
<nanthil>
zianic: i am certainly trying to learn multiple things at once. the lambda calculus for one, functional programming in LISP as opposed to OOP in lisp
<beach>
nanthil: Your program does not use a functional style at all. There are plenty of imperative constructs in it.
<pjb>
nanthil: note, that o1 and o2, are FUNCTIONs!
<nanthil>
beach: yes thanks
<Bike>
paul graham's opinions on writing lisp are not popular here, or as far as i know really anywhere.
<dlowe>
hacker news :)
<dlowe>
not an unbiased sample
<Bike>
if for some reason you want to avoid generic functions, you would still use defclass or defstruct to define your own record types, and then dispatch on types using typecase or something.
<jgkamat>
what was the problem again, mac os crashed and I lost history -_-
<Bike>
or you could go the totally artificial route as pjb has shown.
<nanthil>
bike: as I mentioned in the question, I'm not super concerned with him or his thoughts, but that in googling polymorphism I found that response on a forum, so it lead me to asking the question
<pjb>
it's only that apart form the ITA team, who else than Paul Graham sold his lisp program for hundreds of millions?
<nanthil>
bike: of how would you do it another way
<schweers>
I find that Graham has something interesting to say, although I may not always agree. I don’t remember exactly what he said about CLOS, but it seemed weird to me.
<Bike>
you have two other ways now.
<nanthil>
yes
<beach>
nanthil: But what you seem to want to do is completely artificial and it is very hard to understand the reason for wanting what you seem to want.
<nanthil>
I'm simply narrating the story, not reiterating the question
<beach>
nanthil: You want to accomplish polymorphism without using the mechanism that was designed for precisely that purpose.
robotoad has joined #lisp
<nanthil>
beach: I've explained the reason several times now. I wasn't expecting you to agree with the method, or condone it, but simply help me to understand it. as the others seem perfectly willing to do
<beach>
OK, good luck then.
<schweers>
reminds me of the time that I tried to do “object orientation” in C, just to understand it better.
<schweers>
also known as design patterns, i.e. being a human compiler ;)
<beach>
schweers: I have a colleague who did implement a (near) complete OO layer on top of C.
<schweers>
beach: for the fun of it, or because he
<Bike>
it's usually more interesting to ask "how is X implemented" than "how can i do what X is for without using X", which is pretty artificial.
<schweers>
beach: for the fun of it, or because he/she needed it?
<beach>
schweers: He is convinced that C is the best thing since sliced bread, so he wants to use it for everything.
<schweers>
oh dear. I guess the two of you get along really well! ;)
<p_l>
beach: I guess it wasn't COS?
<beach>
minion: What does COS stand for?
<minion>
Carucated Ophidologist Sloppage
<schweers>
speaking of C, I read that article mentioned here the other day about C not being a low-level language. Very interesting
<beach>
schweers: For kicks I tried to implement Common Lisp-style signals in C. Turns out to be quite difficult because of some weird semantic restrictions in C.
<p_l>
beach: C Object System, a "port" of CLOS to C
<beach>
Ah, no, home brew.
<p_l>
COS was quite interesting
<beach>
I can imagine.
<schweers>
I think I don’t fully(!) understand how signals work in lisp, but I would have thought that some emulation of special variables should suffice.
<p_l>
I don't think it works without compling a slightly different language to C
<Bike>
Oh. Yeah. Not used to it as a noun
<beach>
Oh, sorry.
<beach>
Sure.
<beach>
Signaling.
<p_l>
if you get something generating a CPS-form program, you can always do as Chicken Scheme does :)
<beach>
schweers: Signaling is actually quite simple in Common Lisp, compared to other languages like Java and C++.
<schweers>
given lexical closures and special variables and non-local exists, shouldn’t it be possible to implement the signalling mechanism using macros?
<beach>
The key is that signaling does not unwind the stack.
<beach>
You don't even need non-local exists. That's an orthogonal mechanism.
<schweers>
I know. I remember reading the chapter on conditions and restarts in PCL and almost wept. I always thought that I didn’t understand how to properly use exceptions in C++/Java/Blub properly.
<schweers>
beach: you need it for INVOKE-RESTART, right?
<beach>
I don't think so?
<p_l>
beach: what about some POSIX extensions like makecontext/swapcontext?
<schweers>
that’s what I meant by not fully understanding it ;)
<beach>
Heh.
<beach>
p_l: Haven't looked at those. What about them?
<p_l>
let's you swap process context around
<beach>
Sounds bad.
<p_l>
a bit of a more extended setjmp() and longjmp()
<beach>
Oh!
<p_l>
not sure if it would be enough, though
<beach>
Enough for what?
<beach>
For a complete condition system?
<p_l>
for at least usable one :)
<beach>
A long time ago now, I stopped asking myself what to do if I didn't have Common Lisp. I do.
<p_l>
:)
<beach>
But yeah, it used to be interesting to contemplate such things.
<p_l>
I find that question mostly interesting in terms of "here's computer manual and assembler, bring up a system on it"
<beach>
Ah, yes, I see.
<p_l>
I'd rather, if anything, write compiler in CL that generates an inferior language to operate where I can't put CL in
rumbler31 has joined #lisp
<beach>
Yeah, we had that discussion recently. GCC would have been simpler if written in Common Lisp.
<schweers>
beach: wouldn’t any sufficiently non-trivial program be simpler if written in lisp?
<schweers>
well, almost any
<random-nick>
I think you need non-local exits for INVOKE-RESTART in order to be able to unwind the stack to a selected clause in RESTART-CASE
<beach>
Indeed.
<beach>
random-nick: You think so?
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<schweers>
doesn’t invoking a restart unwind back to where the restart was defined?
<schweers>
oh dear, I may really be showing my ignorance here
<Bike>
in implementations i've seen it's usually backwards- you don't do any unwinding until you hit a handler case or something
<beach>
Yes, restarts kind of sit on the top of the stack.
<beach>
The topmost function asks one further down what to do.
drewes has joined #lisp
kuwze has joined #lisp
rumbler31 has quit [Ping timeout: 265 seconds]
<beach>
But, yes, I guess there is some unwinding involved.
<schweers>
huh. in sbcl it seems that the stack is first unwound to where the restart is defined, then the restart is invoked
orivej has quit [Ping timeout: 265 seconds]
<beach>
Yes, you are right.
<schweers>
I was about to post a test case ;)
Josh_2 has joined #lisp
<beach>
But what accomplishes the unwinding?
vibs29 has quit [Ping timeout: 245 seconds]
iridioid has joined #lisp
<Bike>
restart-case uses a block and tagbody. restart-bind just dynamically binds a function.
eddof13 has joined #lisp
vibs29 has joined #lisp
<beach>
Right, so condition system is still orthogonal to the non-local exit mechanism.
<beach>
But the condition system uses it.
<Bike>
yes.
<Bike>
in clisp handler-bind is special operator enough to have its own bytecode instructions. seems weird
<beach>
Anyway, I think this orthogonality is exactly the right thing to do which is why I am convinced that Common Lisp has the most elegant condition system around. Inspired by Multics PL/I, sure. But that one is not so active anymore.
<housel>
Well, there's also Dylan, which has pretty much exactly the Common Lisp condition system
<beach>
Ah, forgot about that one. Also didn't know about the condition system.
<beach>
Perhaps a bit more active than Multics PL/I?
<housel>
Indeed
<kuwze>
I believe R also has an exception system inspired by Common Lisp
<kuwze>
sorry if those links had already been posted; I just joined 30 minutes ago
<beach>
Good to know.
Copenhagen_Bram has quit [Read error: Connection reset by peer]
rozenglass has quit [Remote host closed the connection]
Copenhagen_Bram has joined #lisp
schweers has quit [Ping timeout: 240 seconds]
shrdlu68 has quit [Quit: WeeChat 2.0.1]
fikka has joined #lisp
Lycurgus has quit [Quit: Exeunt]
Josh_2 has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 240 seconds]
mathrick has joined #lisp
karswell has joined #lisp
beach has quit [Ping timeout: 245 seconds]
Jesin has quit [Remote host closed the connection]
Jesin has joined #lisp
vaporatorius has quit [Remote host closed the connection]
quipa_ has joined #lisp
karswell has quit [Remote host closed the connection]
Kevslinger has joined #lisp
rozenglass has joined #lisp
patlv has joined #lisp
fikka has joined #lisp
fikka has quit [Read error: Connection reset by peer]
nowhere_man has quit [Remote host closed the connection]
<eminhi>
c
m00natic has quit [Remote host closed the connection]
eminhi has quit [Quit: leaving]
nowhere_man has joined #lisp
quipa has quit [Quit: Leaving]
quipa_ is now known as quipa
patlv has quit [Ping timeout: 268 seconds]
skidd0 has joined #lisp
<skidd0>
when defining lambda functions, are the parameters kept in the functions lexical scope?
<skidd0>
I think i'm asking this right
<dlowe>
yes
<skidd0>
basically, if i do #'(lambda (X) ..) does that X clobber up any other X?
<dlowe>
skidd0: you too might be interested in the #clschool channel
<dlowe>
skidd0: it does not
<Bike>
it's a lexical binding unless you specifically declare it otherwise.
patlv has joined #lisp
<skidd0>
Bike: so i can choose to make it use an existing X if wanted
<skidd0>
but that has to be explicit?
<Bike>
You can choose to make the binding special, if that's what you mean.
<Bike>
Dynamic.
<phoe>
dlowe: we've moved to #clschool?
<Shinmera>
phoe: No ops on #clnoobs
<dlowe>
and we suddenly needed ops
<dlowe>
due to spammers
<phoe>
yes, I see
<skidd0>
gross
<edgar-rft>
let's setup #clops with everybody being an op
<foom2>
dlowe: probably you could get freenode to fix that for you?
<phoe>
foom2: #clnoobs is... not a registered channel.
<dlowe>
foom2: they would if I changed it to ##clnoobs
<dlowe>
man, I have explained this a bunch of times now
<foom2>
nevermind
fikka has joined #lisp
<dlowe>
:)
cage_ has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
<kuwze>
maybe someone can help me... I have trouble understanding basic heap/stack semantics in programming languages in general. Since lexical scoping causes variables to automatically be reclaimed, is a GC only needed for heap-based allocations?
orivej has joined #lisp
fikka has quit [Ping timeout: 244 seconds]
<kuwze>
I guess for cl in particular; is a GC only needed for dynamically scoped variables?
<kuwze>
sorry meant to use : not ;
<jasom>
kuwze: in general GCs are only needed for non-dynamic-extent variables
<jasom>
dynamic extent and dynamic scope are orthogonal concepts
<jasom>
correction: GCs are only needed for non-dynamic-extent *data*
<jasom>
data are distinct from variables as well
<kuwze>
jasom: what's the best resource to learn more about this?
fikka has joined #lisp
<jasom>
kuwze: hmm, if you wan't I can give you the basics maybe in #clschool if it's not OT there?
<Bike>
you can assign one variable to have the value of another variable.
<Bike>
(let ((x nil)) ...complicated stuff... (let ((y some-value)) (setf x y) ...) ...), now if you delete some-value at the end of the inner let problems happen.
zianic has quit [Ping timeout: 255 seconds]
fikka has quit [Ping timeout: 260 seconds]
<jasom>
consider (let ((foo (make-some-value)) (bar foo)) <-- we have no idea what bar does with the value held by foo. Even though foo the variable goes away after the let expression is exited, that says nothing about the value we initially bound to it
<jasom>
this is true whether foo is a dynamic or lexical variable
<jasom>
here's an example where the value obviously survives the scope of the variable (let ((h (make-hash-table))) (let ((foo (make-some-value))) (setf (gethash 'foo h) foo)) ...)
<jasom>
here's an example where the value obviously survives the scope of the variable (let ((h (make-hash-table))) (let ((foo (make-some-value))) (setf (gethash 'bar h) foo)) ...)
<jasom>
(the second example is the same as the first, but I changed the name of the hash key so as not to confuse things)
fikka has joined #lisp
<kuwze>
well that's way more complicated than I thought... I guess I have to put more time into becoming familiar with cl and the standard in general
<jasom>
kuwze: this is true for all languagues in eneral, not just lisp
papachan has quit [Ping timeout: 240 seconds]
<jasom>
kuwze: not all languages have separate concepts for dynamic and lexical bindings, but the concept of values being distinct from variables is true in nearly all languages.
<kuwze>
jasom: what do you mean "values are distinct from variables"?
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kuwze>
err I got to go but I'll login later... thanks again for answering my questions.
fikka has quit [Ping timeout: 240 seconds]
kuwze has quit [Quit: Page closed]
<jasom>
If I could add one concept to CS 101 it would be "values are distinct from variables" it's so fundamental and not learning it makes programming much harder. No struggling CS student who asked me for help in college ever grasped it, and once they did about 75% of their problems went away.
milanj has quit [Quit: This computer has gone to sleep]
fikka has joined #lisp
fikka has quit [Read error: Connection reset by peer]
<skidd0>
meaning values like 11 are not the same as the variables that hold that value?
<skidd0>
because the variable is an address to data, not the data itself
<skidd0>
?
patlv_ has joined #lisp
patlv has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has quit [Ping timeout: 240 seconds]
jxy has quit [Remote host closed the connection]
makomo has joined #lisp
patlv_ has quit [Ping timeout: 240 seconds]
<jasom>
skidd0: variables are abstract concepts, not necessarily addresses to data
drewes has joined #lisp
<jasom>
e.g. (let ((x 3)) (+ x 1)) ; <-- that might just compile down to "4"
fikka has joined #lisp
<jasom>
references *are* addresses to data, and they are an extra layer of confusion, at least when the data is mutable.
<skidd0>
damn pointers
<jasom>
e.g. (let ((x 3)) (foo x) x) will awyas evaluate to 3.
<jasom>
(let ((x (cons 3 4))) (foo x) (car x)) may evaluate to pretty much anything
<skidd0>
hmm okay
<jasom>
a variable is bound to a particular value in some context. When the value is mutable, then things get even more confusing.
<skidd0>
so why can the let cons example evaluate to anything?
<jasom>
because a CONS is mutable, but an integer is not.
<skidd0>
but then can't the same be said of foo in the first?
<skidd0>
oh duh
v0|d has quit [Read error: Connection reset by peer]
<skidd0>
can't a (def foo (x) (setf x 2))?
<skidd0>
can't I*
<jasom>
yes, but that changes the value bound by the variable x inside this particular call of foo.
<jasom>
it doesn't change the value "3" to be "2"
<skidd0>
OH
fikka has quit [Ping timeout: 264 seconds]
<skidd0>
then in the LET, x is still 3
<jasom>
if you do (setf x 2) as your foo for the cons example, the cons example still returns 3, because you never mutated the cons cell.
<skidd0>
ah
<jasom>
(def foo (x) (setf (car x) 2)) <-- note we do *not* setf X here, we setf (car x)
<jasom>
e.g. (let* ((x (cons 1 2)) (y x)) (setf (car x 2)) (eq y x)) ; -> T
<jasom>
we didn't change x, so y and x are still the same
<jasom>
e.g. (let* ((x (cons 1 2)) (y x)) (setf x 2) (eq y x)) ; -> NIL
<dlowe>
Scalar data is data where the value is the identity, and those cannot be mutated.
<dlowe>
except in those few languages where you can literally set the value of 3
<dlowe>
nonscalar data has an identity with potentially different values, so where the data is bound is important
fikka has joined #lisp
<jasom>
and practical implementations of nonscalar data on real hardware usually use memory and addresses; which is why "because the variable is an address to data, not the data itself" is an imprecise way of talking about mutability.
<jasom>
If all values were immutable, then the only reason we would care about whether it's a reference or not would be identity testing (e.g. EQ in lisp).
<jasom>
an example of that in lisp would be a bignum (technically fixnums are allowed to behave this way too, most implementations EQ works on fixnums)
<skidd0>
oh this is the difference between EQ and EQUAL right?
<jasom>
1234567890123456789012345678901234567890 will never be mutated, so (foo x) will not change it. however you might have two different copies of those values that are not EQ
<jasom>
skidd0: it's *a* difference
<jasom>
eq and eql is the one where that's the main difference
<skidd0>
err: variable *a* not defined before use
<jasom>
I *think* there are no immutable values in lisp that are different under EQL when they are otherwise equal.
<jasom>
skidd0: eql is what you usually want for efficient identity testing. For "this is the *same* thing" compared to "these things are equivalent"
<skidd0>
so eql is the *same* test, right?
<skidd0>
and eq is the equivalency
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
meepdeew has joined #lisp
<jasom>
right. One good mnemonic is that the longer the name, the broader the equality test; eq is a subset of eql is a subset of equal is a subset of equalp
fiddlerwoaroof has quit [Ping timeout: 264 seconds]
<skidd0>
I see
<skidd0>
good mnemonic
<jasom>
and some standards mandate that you never use eq, since there are no portable differences between eq and eql.
NoNumber has joined #lisp
<jasom>
i.e. a conforming standard could have the two behave the same.
varjag has joined #lisp
<jasom>
s/standard/implementation/
patlv_ has joined #lisp
<skidd0>
ah
<jasom>
some of the functions in the standard work the way they do simply to prevent breaking existing code.
<gendl>
Hi, I have a big .fasl file, made by asdf's monolithic-compile-bundle facility, and somehow it got polluted with a symbol from the ASDF package --
<gendl>
I think some new Quicklisp library I'm using must be less than hygienic as far as ending up with stuff from asdf when it gets built into fasls..
<gendl>
How can I inspect the (binary) .fasl file to find what symbol is causing this mischief?
<gendl>
Well, I just opened the fasl in emacs, from the looks of things cl-markdown is the culprit, and indeed I just added that recently to my soup
<gendl>
Hmm I was hoping to start using cl-markdown to help with authoring content for my website and web applications... trying to track down where it's getting polluted with stuff from asdf... (because in general I build runtimes sans asdf - I just use asdf to make the monolithic fasls, then load them into a clean image at build time).
<gendl>
Hrmph, cl-markdown looks to be from January of 2010 -- I guess it's quite "stable" ;)
papachan has joined #lisp
kerrhau has joined #lisp
asarch has joined #lisp
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iskander has quit [Ping timeout: 260 seconds]
patlv_ has quit [Ping timeout: 240 seconds]
v0|d has joined #lisp
Arcaelyx has joined #lisp
light2yellow has quit [Quit: light2yellow]
Jesin has quit [Remote host closed the connection]
<gendl>
Whelp, both cl-markdown and metatilities are polluted.
<skidd0>
does anyone have an example of setting the cors header of hunchentoot?
Jesin has joined #lisp
<Bike>
clhs allow-other-keys
<specbot>
Couldn't find anything for allow-other-keys.
<Xach>
gendl: using asdf:whatever in system sources? like asdf:system-relative-pathname and such?
<gendl>
metatilities (:imports ..) then (:exports ..) three or so ASDF utilities in its package.lisp,
<Xach>
ah
<gendl>
and cl-markdown has (:use .... :asdf) in a package definition in its cl-markdown.asd,
<gendl>
so it can then call some asdf stuff in its testing methods, which apparently get called automatically upon compile/loading or so.
<gendl>
(those actions are defined further down in the defsystem of cl-markdown.asdf)
Copenhagen_Bram has quit [Read error: Connection reset by peer]
<gendl>
:use'ing :asdf in the cl-markdown-system package in cl-markdown.asdf also eliminates the need to say asdf:defsystem so it just says defsystem.
<gendl>
I fixed everything locally just by commenting out all the offending stuff.
<gendl>
I'll send email to the author alerting him to these issues. I'm not sure how to fix it while keeping all the functionality and test automation which is apparently in there now though. None of that stuff is needed for production runtime deployment though, so I'd think there should be a way to switch it off short of commenting out code locally.
Copenhagen_Bram has joined #lisp
drewes has joined #lisp
vlatkoB has quit [Remote host closed the connection]
figurelisp has joined #lisp
<gendl>
By the way, for people who are nervous about exposing a Lisp website to the wild (which I've been doing constantly since about 1997), one trivial way to mitigate that appears to be to sign up for a free Cloudflare account, and send everything through there.
rpg has joined #lisp
<gendl>
I accidentally stumbled upon Cloudflare the other day when I started getting spam where someone was trying to use one of my genworks email addresses for a Cloudflare account and registering a bunch of bogus websites. So I took control of the account and as an experiment set up genworks.com to go through Cloudflare.
angavrilov has quit [Remote host closed the connection]
<gendl>
Seems legit. It does caching, protects from attacks, and redirects everything to https: with the flip of a switch.
<gendl>
but, ssh stops working. You have to set up a different subdomain for that and not have it go through the cloudflare IP address.
<gendl>
Feedback welcome. Some parts of it are a bit ranty.
<gendl>
and of course it needs a ton of fleshing out. But I was getting sick of our 1990s looking site.
<gendl>
So now we have a 2013 looking site.
<Shinmera>
Looks modern enough, aside from the graphic which still looks very 90s.
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gendl>
The graphic was made by someone in about 2008.
<gendl>
Can't be bothered to update it at this juncture.
<Shinmera>
Protip: Don't use gradients or 3D effects and it'll look much more modern almost instantaneously :)
<gendl>
I'll see if the guy still has the source file in whatever he used to do it.
<gendl>
Meantime I'll start filling in the rest of the site with some GDL-generated geometry graphics.
<Shinmera>
gendl: By the by, I remember you filed some issues on some of my projects some time ago but never got back to my responses
<gendl>
You did respond, and you recently closed the issue. I was proposing modern-mode support and you rejected it on principle.
<Shinmera>
Ah, right. There was something else though. I think something on Portacle?
<gendl>
Oh yes, I was just wondering why it wasn't a normal .dmg.
skidd0 has quit [Quit: \0]
<gendl>
We do distribute Gendl including a pre-configured Emacs as a normal .dmg
<gendl>
so you just drag-to-install and click the icon, and emacs comes up with a Gendl repl, ready to go.
<Shinmera>
Yeah, I have different constraints that make that unfavourable.
igemnace has quit [Quit: WeeChat 2.2]
Jesin has quit [Remote host closed the connection]
<gendl>
regarding the modern-mode thing, is that a hard principle of yours? I understand the desire to avoid drifting away from ANSI standards. But in my experience it's not hard to write code which is still totally ANSI compliant but will also work in modern-mode.
<gendl>
We do have some modern-mode deployments (for better or for worse) which we do have to support for the time being. So if we ever were to use any of the very awesome-looking Shinmera libraries, we'd have to create and maintain our own forks, which doesn't appear so awesome...
<Shinmera>
Which library was the modern mode thing on again?
<Shinmera>
I try to code most things to not be readtable case dependant, but in general it's a huge headache that I don't want to think about hence the rejection.
FreeBirdLjj has quit [Remote host closed the connection]
<phoe>
Hmm. Mezzano runs in VirtualBox.
<Shinmera>
GitHub search is worthless
<phoe>
Has anyone tried using it to run some production code, just to check if it's capable of it?
<gendl>
Shinmera: the gtk thing or one of its dependencies.
<Shinmera>
I don't have any gtk things
<aeth>
Iirc, the way I handle readtable case issues is #.(symbol-name '#:foo) but it doesn't appear to be that common
<gendl>
I'm getting the wrong UI acronym.
<Shinmera>
Qt?
<gendl>
must be Qt, yes.
<gendl>
the desktop UI.
<aeth>
(Even I don't handle readtable case issues everywhere because of just how rare of an issue it is. Compare this to floating point where I always make sure to end floats in "f0")
<Shinmera>
Ah, the use of NIL and T as uppercase. Right, now I remember.
<Shinmera>
That's one I will not change due to stylistic consistency reasons.
<gendl>
Currently we don't support any desktop UIs at all. We try to force everything to be web-based. Sometimes we probably lose potential sales because of that.
<gendl>
But i'm very much allergic to diving into any platform-specific UI development.
<aeth>
gendl: Ime, people will comment and not understand the purpose of #.(symbol-name '#:foo) if you use it to avoid modern mode issues since literally no one (including me, so I haven't even tested this workaround) uses it
<gendl>
yes, using NIL and T as uppercase in source code will break modern-mode quite directly.
<Shinmera>
I wonder if there's a way to hack support in by doing reader trickery.
<Shinmera>
Probably not.
figurelisp has quit [Ping timeout: 256 seconds]
iridioid has quit [Ping timeout: 260 seconds]
NoNumber has left #lisp ["Gone."]
<Shinmera>
Re-reading my response I was being oddly obscure. I consistently upcase constants in my code, which I deem important for readability.
<phoe>
what's modern-mode?
<Shinmera>
And I'd rather not go through all of my projects and change that style just to address what is, in my view, a bad idea.
fikka has joined #lisp
<phoe>
ooh. I see.
<gendl>
Well I'm certainly in no position to question your sensibilities there.
<gendl>
So I'll resign myself to maintaining forks if I ever endeavor to use that stuff.
<gendl>
Once the initial fork is done it shouldn't be too hard to keep merging in your latest.
<Shinmera>
Right. If there's a hack available that I can #+allegro, I'd consider it though.
<gendl>
I'll keep that in mind. But I don't suppose you would want to see #+allegro nil #-allegro NIL
<gendl>
lol
<Shinmera>
Haha, no
<trittweiler>
(defconstant NIL nil) and (deconstant T t) will perhaps work
<foom2>
You could just set the case mode to case-insensitive-lower before loading the library
<foom2>
(as the modern mode docs recommend)
<Shinmera>
trittweiler: Nope
<gendl>
trittweiler - Yeap, i was just thinking somethning like that.
<gendl>
Shinmera: Figured there would be some catch, though.
<Shinmera>
NIL and T are used in lots of places that are not evaluated, so symbol macros won't work.
<Shinmera>
And constants, for that matter.
<Shinmera>
You'd have to hack INTERN.
<gendl>
foom2: oh, interesting. I haven't looked at those docs in ages.
<gendl>
phoe: you know what modern-mode is, now? It's slightly tweaked alternative images provided by Franz (and Scieneer too, last I looked) which have the reader case set to case-preserving instead of upcasing everything, and which have all the standard CL symbols in lowercase instead of uppercase.
<foom2>
someone should add that feature to sbcl too. :)
<Shinmera>
almost as weird as :invert case
<foom2>
Nah, it's _way_ less weird than any of the ansi standard case modes.
<gendl>
I'm not schooled enough on the standard to know how egregious of a violation this is.
<Shinmera>
I like being screamed at while I work. It's only fair for how much I scream at my computer.
<gendl>
I think what's violating ANSI in a modern-mode is the fact that the built-in symbols are shipped in lowercase, right?
<gendl>
a conforming program is allowed to switch the reader-case to be case-preserving, right?
<Shinmera>
Yes, yes.
kajo has joined #lisp
<gendl>
Who was the SBCL guy several years ago? Nikolas Siiva (sp?)
<aeth>
I :downcase my *print-case* mainly because it downcases the output of macroexpand-1 (and, in SBCL, disassemble)
<aeth>
gendl: A proper case sensitive CL would have to support car and CAR even if it made it case sensitive everywhere else, I guess.
<aeth>
(Supporting CaR, cAr, etc., might not be necessary, though.)
<Shinmera>
Yeah a useful modern mode would need at least both upcase and downcase variants.
<foom2>
Is it acceptable to export additional symbols from the CL package w.r.t. the standard?
<Shinmera>
foom2: No
<foom2>
It'd still be a violation, then, so what's the point. :)
<Shinmera>
But neither is changing the case of the standard package's symbols
<Shinmera>
So if you're gonna violate, at least violate usefully
<Shinmera>
That sounds really bad out of context.
<foom2>
Sure it is, because approx everyone writes their code in lowercase, except where they accidentally don't.
Jesin has joined #lisp
<foom2>
(Obviously, there are some notable exceptions in this conversation, but I still contend that's true)
<aeth>
What you would probably want to do is extend defpackage (including the definition of CL) to handle the case of exported symbols in a certain way. i.e. If case sensitive, make CAR an alias to car (or the other way around) if the defpackage allows it.
<aeth>
If implementation-specific extensions to defpackage are even allowed.
<gendl>
Nikodemus Siivola
<gendl>
Nikodemus mentioned to me that one can essentially achieve most of what modern-mode does by simply running an ANSI image with case-mode set to :invert.
<foom2>
Kinda. you get some very odd results then
patlv_ has quit [Remote host closed the connection]
<gendl>
At the time, I "got" what he was saying, but now I don't so much remember my epiphany.
patlv_ has joined #lisp
<aeth>
foom2: The problem is most people use string literals when writing macros that deal with symbols, e.g. searching for symbols with the prefix "FOO-". In most, but not all, of my code, I handle that with #.(symbol-name '#:foo-) which should work for a "modern mode" but probably wouldn't work if the reader case changes over time for some reason
<aeth>
Most code would probably just hardcode "FOO-" though
<gendl>
Because yeah, if your source is in lowercase (as is usual) then you'll still see everything screaming at you in uppercase after it gets read and inverted.
<foom2>
aeth: yea, don't change the reader case within one build, that's just asking for trouble. =)
<Shinmera>
Just use print-case :downcase if the screaming is all that's bothering you.
<gendl>
So there might have been some other trick he mentioned too.
<gendl>
Right.
<Shinmera>
Or :invert if you use :invert read case.
<gendl>
Shinmera -- that was probably the trick.
<gendl>
Invert on the way in, and on the way out.
mindCrime has quit [Ping timeout: 268 seconds]
<aeth>
gendl: I might do that for cl-scheme
figurelisp has joined #lisp
jxy has joined #lisp
Jesin has quit [Remote host closed the connection]
Jesin has joined #lisp
<aeth>
(invert both ways so a case-sensitive language can interop with a language that upcases everything)
<figurelisp>
use of clschool channel?
<figurelisp>
should i as a newbie lurk on it?
<Bike>
that seems to be the intent.
libre-man has quit [Ping timeout: 260 seconds]
<figurelisp>
Bike: what about clnoobs
trittweiler has quit [Ping timeout: 256 seconds]
figurelisp has quit [Remote host closed the connection]
LiamH has quit [Quit: Leaving.]
josemanuel has quit [Quit: leaving]
libre-man has joined #lisp
pierpa has joined #lisp
Denommus has quit [Remote host closed the connection]
<pjb>
aeth: what about Car and Multiple-Value-Bind or MultipleValueBind?
<aeth>
Does someone actually use Multiple-Value-Bind?
<pjb>
There are random capitalization sometimes.
<pjb>
The point is that it's case insensitive.
<aeth>
Just because the language itself will tolerate Multiple-Value-Bind doesn't mean that any human reader of CL will
markong has joined #lisp
markoong has quit [Ping timeout: 240 seconds]
spm_ has joined #lisp
Bike has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #lisp
acolarh has quit [Ping timeout: 264 seconds]
acolarh has joined #lisp
<varjag>
people were banned for less
FreeBirdLjj has quit [Ping timeout: 248 seconds]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
patlv_ has quit [Ping timeout: 248 seconds]
pierpal has quit [Ping timeout: 268 seconds]
crsc has quit [Ping timeout: 264 seconds]
crsc has joined #lisp
markong has quit [Quit: Konversation terminated!]
fikka has quit [Read error: Connection reset by peer]
xrash has quit [Remote host closed the connection]
fikka has joined #lisp
kajo has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
fikka has quit [Ping timeout: 260 seconds]
skapata has joined #lisp
fikka has joined #lisp
kajo has quit [Ping timeout: 265 seconds]
kajo has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
robotoad has quit [Quit: robotoad]
varjag has quit [Ping timeout: 240 seconds]
varjag has joined #lisp
fikka has joined #lisp
tessier has quit [Remote host closed the connection]
Cthulhux has quit [Ping timeout: 256 seconds]
<jasom>
This case sensitivity thing is yet another issue that could be done in a library if there were a callback invoked for processing a token.
fikka has quit [Ping timeout: 268 seconds]
meepdeew has quit [Remote host closed the connection]
varjag has quit [Ping timeout: 256 seconds]
kerrhau has quit [Read error: Connection reset by peer]
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
patlv_ has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
Bike has joined #lisp
fikka has joined #lisp
random-nick has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 240 seconds]
patlv_ has quit [Remote host closed the connection]