Xach changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/>
random-nick has quit [Ping timeout: 258 seconds]
asarch has joined #lisp
baby_yoda_squadr has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 258 seconds]
varjag has quit [Read error: Connection reset by peer]
orivej has joined #lisp
karlosz has joined #lisp
illili has joined #lisp
clothespin__ has joined #lisp
hiroaki has joined #lisp
clothespin_ has quit [Ping timeout: 258 seconds]
quazimodo has quit [Ping timeout: 265 seconds]
quazimodo has joined #lisp
clothespin__ has quit [Ping timeout: 265 seconds]
mange has joined #lisp
clothespin has joined #lisp
quazimodo has quit [Ping timeout: 240 seconds]
luna_is_here_ has quit [Ping timeout: 268 seconds]
isBEKaml has joined #lisp
baby_yoda_squadr has joined #lisp
baby_yoda_squadr has quit [Ping timeout: 240 seconds]
lxpnh98 has joined #lisp
lxpnh98 has quit [Client Quit]
monokrom has joined #lisp
smokeink has joined #lisp
karlosz has quit [Quit: karlosz]
asarch has quit [Quit: Leaving]
karlosz has joined #lisp
khisanth_ has quit [Ping timeout: 240 seconds]
ahungry has joined #lisp
khisanth_ has joined #lisp
bitmapper has quit [Ping timeout: 258 seconds]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<jcowan> galdor: I am not a lawyer and this is not legal advice, but I predict:
<jcowan> 1) that if you do this, the case will never come to court;
<jcowan> 2) if it does, Lispworks will have a hard time proving that what they have added to the public-domain content is sufficient to establish copyright
<jcowan> 3) if they do, the judge will not care if you have changed the HTML or just distributed a script to do so: attempts to evade infringement in this fashion just annoy judges.
shifty has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 260 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
EvW has quit [Ping timeout: 248 seconds]
prumnopytis has quit [Ping timeout: 265 seconds]
isBEKaml has quit [Quit: leaving]
slyrus_ has quit [Read error: Connection reset by peer]
slyrus has joined #lisp
akoana has joined #lisp
ahungry` has joined #lisp
ahungry` has quit [Remote host closed the connection]
ahungry has quit [Ping timeout: 268 seconds]
ahungry` has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 240 seconds]
quazimodo has joined #lisp
quazimodo has quit [Ping timeout: 260 seconds]
Kundry_Wag has joined #lisp
prumnopytis has joined #lisp
SaganMan has joined #lisp
ahungry` has quit [Ping timeout: 268 seconds]
ahungry` has joined #lisp
ahungry` has quit [Ping timeout: 265 seconds]
<beach> Good morning everyone!
<markasoftware> Is use of `macroexpand` usually a code smell?
<drmeister> Hi beach.
<beach> markasoftware: Not necessarily. The implementation of some standard macros requires it, or at least macroexpand-1.
<markasoftware> i want the expansion of a macro to be passed to another macro
<beach> markasoftware: I don't know how experienced you are, but a much more common mistake is the overuse of macros in the first place.
<markasoftware> i mean, i could always take a function as an argument instead of &body...
<markasoftware> but where's the fun in that?
<beach> markasoftware: It is impossible to tell whether what you do is the right thing, from your skimpy description of what you want to accomplish.
<no-defun-allowed> Sadly, other developers prefer to have less "fun" in their interfaces to your code.
ahungry has joined #lisp
atgreen has quit [Ping timeout: 260 seconds]
atgreen has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
Kundry_Wag has joined #lisp
SaganMan is now known as nekosagan
quazimodo has joined #lisp
mange has quit [Quit: Sleep.]
shangul has joined #lisp
gravicappa has joined #lisp
dddddd has quit [Remote host closed the connection]
oni-on-ion has quit [Ping timeout: 248 seconds]
karlosz has quit [Quit: karlosz]
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<LdBeth> It sounds like you want a compiler for your DSL
johnjay has quit [Ping timeout: 265 seconds]
Kundry_Wag has quit [Ping timeout: 260 seconds]
johnjay has joined #lisp
raghavgururajan has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
isBEKaml has joined #lisp
atgreen has quit [Remote host closed the connection]
atgreen has joined #lisp
nekosagan has quit [Read error: Connection reset by peer]
visage_ has joined #lisp
fortitude has quit [Ping timeout: 260 seconds]
atgreen has quit [Remote host closed the connection]
visage_ has quit [Quit: visage_]
akoana has left #lisp ["Leaving"]
sauvin has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
Josh_2 has quit [Ping timeout: 260 seconds]
shangul has quit [Ping timeout: 260 seconds]
ebrasca has joined #lisp
zclark` has joined #lisp
vms14 has joined #lisp
<vms14> why this function isn't working?
<vms14> I'm trying to count chars by using recursion, but it never ends
<vms14> (count-char 0 0 "oh my cat is very nice" #\a)
smokeink has quit [Remote host closed the connection]
<beach> Why are you using POSITION?
<vms14> because I was reading the ansi common lisp book and saw the position function, so I wanted to practice with that
<vms14> position should return nil if there is no such item
<no-defun-allowed> Why recursion?
<beach> OK, but you realize this is not a good way of doing it.
<vms14> beach: you mean in performance terms?
<no-defun-allowed> The first thing that comes to mind is that you haven't written when to stop.
<beach> vms14: Yes.
<vms14> no-defun-allowed: I want to learn recursion
<beach> vms14: Also, you probably need to do (1+ <the position>) to avoid counting the same char over and over.
<vms14> no-defun-allowed: it should stop, since position should return nil
<vms14> oh, then that was
<vms14> ty beach, that was the problem
vlatkoB has joined #lisp
<beach> ywlcm.
<no-defun-allowed> If the last character is the character you are searching for, I think the position will be incremented past the last index of the string.
<beach> That should still work though.
<beach> ... as I recall.
<vms14> (count-char 0 0 "oh my cat is very nice" #\e) works
<ebrasca> vms14: I think loop is better for this situation.
<beach> vms14: The fact that it works in one particular implementation does not mean it is conforming.
<vms14> ebrasca: yes, I also need to learn about the loop macro
<beach> ebrasca: Not if you want to learn about recursion and POSITION at the same time.
<beach> ebrasca: Which is what the requirement was.
<vms14> it's a shame I don't know a lot of basic lisp stuff
<ebrasca> vms14: What about using lists for recursion?
<White_Flame> clhs count
<beach> ebrasca: And, no, the good solution would be to just use COUNT.
<vms14> I tend to use dolist and dotimes
<no-defun-allowed> The CLHS calls START and END "bounding index designators", which suggests they have to be less than the length of the sequence.
<vms14> no-defun-allowed: yes, if I put a bigger index in position fails
<beach> no-defun-allowed: Look in the glossary.
<vms14> but idk why the function works
<ebrasca> beach: I din't know #'count
<beach> vms14: The fact that it works in one particular implementation does not mean it is conforming.
<no-defun-allowed> beach: That leads to "bounding index", which states that (<= 0 start end (length sequence)) must hold.
<beach> Yes, so the length of the sequence is a valid index.
<beach> Which is 1 beyond the end.
<no-defun-allowed> Good point.
<vms14> beach: works in ecl and sbcl, I'll try in clisp
<beach> vms14: The fact that it works in one particular implementation does not mean it is conforming.
<vms14> anyway, it was only a test, that function has not use
<vms14> no*
<beach> vms14: You need to learn to read the Common Lisp HyperSpec.
<vms14> right, I need to get used to hyperspec
<no-defun-allowed> vms14: The right thing to do would be to check what the HyperSpec states the language features you use states they should do.
<vms14> still, we should create man pages
<beach> vms14: You can test it in all the implementations accessible to you, it still doesn't make it conforming.
<beach> clhs position
<beach> vms14: There you go ^
<beach> vms14: You are allowed to download the Common Lisp HyperSpec and use it locally.
<vms14> hmm
<no-defun-allowed> I wouldn't bother making man pages. The HyperSpec is (surprisingly) technically superior with its use of hyperlinks, which I don't think are possible to create in man pages.
<vms14> I was thinking in crawl that site to automate some man pages creation
<vms14> using perldoc
<vms14> perl can create man pages
<beach> Whatever.
<vms14> I miss a lot to use man for lisp stuff
<no-defun-allowed> It would be more polite to download the files instead of crawling the LispWorks server, and to use a less line-noise-y language.
<vms14> no-defun-allowed: yes, and faster, my network isn't good
<beach> vms14: You are allowed to download the Common Lisp HyperSpec and use it locally.
<no-defun-allowed> Provided your implementation has good documentation strings, you can check those in SLIME using C-c C-d.
<vms14> then it should be easier to make a command that looks for those files
<beach> no-defun-allowed: That's not the same thing though. A documentation string should mention what the implementation does, and that might include defining behavior that is undefined by the Common Lisp HyperSpec.
<vms14> no-defun-allowed: wasn't that keybind opening a browser?
<no-defun-allowed> beach: Good point. I think there is also a chord for checking the HyperSpec from SLIME too...
isBEKaml has quit [Quit: leaving]
<vms14> no-defun-allowed: you're sure it was C-c C-d?
<vms14> oh, it works if I press C-c C-d C-g
<no-defun-allowed> C-c C-d ~ opens the entry for a FORMAT directive, C-c C-d g for a glossary term, and C-c C-d # for a reader macro.
<vms14> but expects lynx I guess
<beach> C-c C-d h for the Common Lisp HyperSpec.
<no-defun-allowed> There it is.
<vms14> I have troubles with the lan wire, so my network is slow, and I'll die using that
<beach> vms14: You are allowed to download the Common Lisp HyperSpec and use it locally.
<vms14> but I'll try to download the hyperspec and make some keybind/script to read that
<beach> I think it's a simple Emacs configuration to make it use the local version.
<vms14> I'll try to fix that shitty network
<no-defun-allowed> The documentation for common-lisp-hyperspec states "If you copy the HyperSpec to another location, customize the variable `common-lisp-hyperspec-root' to point to that location."
<beach> My SLIME uses my local version, so it must be easy to configure it.
<beach> There you go.
<vms14> ty
mathrick has joined #lisp
<beach> vms14: I recommend you do M-x define-global-abbrev<RET>ty<RET>thank you<RET>
<vms14> meh
<vms14> I've made the date function to annotate comments
<vms14> ; Saturday, December 28, 2019
<vms14> (require 'calendar) (defun date () (interactive) (insert "; " (calendar-date-string (calendar-current-date))))
<vms14>
<beach> vms14: Great! Next try to use the ISO8601 format.
<vms14> idk what calendar provides
<vms14> but I prefer to use calendar than the time command
<beach> vms14: I recommend you do M-x define-global-abbrev<RET>idk<RET>I don't know<RET>
<vms14> date*
<vms14> beach: why you recommend such things?
<vms14> we're in irc
<beach> That's no excuse for exposing stupid abbreviations to other members. You are showing that you don't master your tools.
<vms14> beach: :O
<vms14> but you're right that I should do this stuff, I should learn to use emacs much better
<beach> Exactly my point.
Necktwi has quit [Read error: Connection reset by peer]
<fiddlerwoaroof_> CLHS is also available in info format, which is a lot nicer to use from emacs
<vms14> oh, I've used it, Thank you :D beach
<vms14> Thank you :D I don't know
<beach> Heh! Excellent.
<beach> vms14: I think you have great potential for mastering stuff. With the right attitude, you could do it.
<vms14> I have great google skills
jfb4_ has joined #lisp
<vms14> but also great skill to absorb knowledge
<vms14> the only problem is I'm not very constant
jfb4 has quit [Ping timeout: 258 seconds]
<vms14> this is why all my stuff are only tests or little scripts
<prumnopytis> If you were constant you probably couldn't absorb knowledge
<vms14> prumnopytis: what you mean?
<ahungry> lol
<ahungry> constants can't change (in programming)
<vms14> XD
<ahungry> s/constant/consistent ^^
<prumnopytis> Yeah I then realised that constants of integration absorb lots ;p
raghavgururajan has quit [Remote host closed the connection]
ahungry has quit [Remote host closed the connection]
ebzzry has quit [Read error: Connection reset by peer]
ealfonso has joined #lisp
vms14 has quit [Remote host closed the connection]
bb-yoda has joined #lisp
vms14 has joined #lisp
<vms14> beach: now it's better (insert "; " (format-time-string "%d-%m-%Y %H:%m"))
<vms14> ; 28-12-2019 08:12
<vms14> oh, the year should be first
<vms14> done
<vms14> (format-time-string "%Y-%m-%d %H:%m")
<vms14> xD no
bb-yoda has quit [Ping timeout: 268 seconds]
<vms14> (format-time-string "%Y-%m-%d %H:%M") *
<beach> Great work!
<beach> Again, with this attitude, you can go far.
<vms14> Thank you :D
<beach> Heh, sure!
shangul has joined #lisp
narimiran has joined #lisp
vms14 has quit [Remote host closed the connection]
jkvl has joined #lisp
prumnopytis has quit [Ping timeout: 258 seconds]
clothespin has quit [Ping timeout: 248 seconds]
jkvl has quit [Ping timeout: 268 seconds]
slyrus has quit [Read error: Connection reset by peer]
rippa has joined #lisp
slyrus has joined #lisp
Inline__ has joined #lisp
fortitude has joined #lisp
smokeink has joined #lisp
zclark` has left #lisp ["ERC (IRC client for Emacs 26.3)"]
Inline has quit [Ping timeout: 245 seconds]
fortitude has quit [Ping timeout: 258 seconds]
SaganMan has joined #lisp
SaganMan is now known as nekosagan
nowhere_man has quit [Remote host closed the connection]
heisig has joined #lisp
brown121408 has quit [Ping timeout: 258 seconds]
william1 has joined #lisp
brown121407 has joined #lisp
william1 has quit [Remote host closed the connection]
jkvl has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
__vlgvrs has joined #lisp
_paul0 has quit [Ping timeout: 252 seconds]
<[df]> does anyone use slime with use-package? having trouble setting it up so that slime-contribs is set at the right point in the load/setup sequence (specifically, I want a repl to open when I run slime or slime-connect)
Inline__ has quit [Quit: Leaving]
Inline has joined #lisp
<beach> [df]: Where are you attempting to put your USE-PACKAGE?
<beach> [df]: The REPL should get created automatically when you run M-x slime<RET>.
<[df]> it's in a file that is loaded via .emacs
<beach> Does Emacs Lisp even have packages?
<[df]> it does now
<[df]> oh, they're not like CL packages
<[df]> and use-package is a 3rd-party add-on
<beach> If you do (slime-setup '(slime-fancy slime-tramp slime-asdf slime-indentation)) in your .emacs, you should be in business.
<beach> I think slime-fancy implies the REPL.
<beach> But all that is from (a very bad) memory.
<[df]> yes I believe so too (in fact I think it implies most things)
<[df]> the problem is I want slime to load lazily
<[df]> but it seems like when that happens the first thing it does is reset slime-contrib to nil
jkvl has quit [Ping timeout: 260 seconds]
<[df]> should probably have clarified that this was more of an emacs question than a cl question but I figured this would be the place to come for slime expertise
jonatack has quit [Ping timeout: 260 seconds]
oni-on-ion has joined #lisp
amerlyq has joined #lisp
ealfonso has quit [Ping timeout: 260 seconds]
Oladon has quit [Quit: Leaving.]
dnaeon has joined #lisp
jonatack has joined #lisp
oni-on-ion has quit [Quit: Quit]
fookara has joined #lisp
isBEKaml has joined #lisp
luna_is_here_ has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 258 seconds]
slyrus_ has joined #lisp
clothespin has joined #lisp
slyrus has quit [Ping timeout: 240 seconds]
jkvl has joined #lisp
random-nick has joined #lisp
cosimone has joined #lisp
rozenglass has joined #lisp
dnaeon has quit [Ping timeout: 260 seconds]
noobineer1 has joined #lisp
noobineer has quit [Ping timeout: 258 seconds]
<ebrasca> [df]: I use emacs use-package
<ebrasca> [df]: Here my slime config with emacs use-package : http://ix.io/25H5/lisp
<ebrasca> [df]: Does it help you?
ebzzry has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
ebzzry has quit [Ping timeout: 260 seconds]
ebzzry has joined #lisp
cosimone_ has joined #lisp
cosimone has quit [Ping timeout: 248 seconds]
fookara has quit [Remote host closed the connection]
jonatack has quit [Ping timeout: 265 seconds]
cosimone_ has quit [Remote host closed the connection]
cosimone_ has joined #lisp
vms14 has joined #lisp
ggole has joined #lisp
FreeBirdLjj has joined #lisp
wxie has joined #lisp
wxie has quit [Client Quit]
FreeBirdLjj has quit [Ping timeout: 248 seconds]
wxie has joined #lisp
bb-yoda has joined #lisp
bb-yoda has quit [Read error: Connection reset by peer]
bb-yoda has joined #lisp
bb-yoda has quit [Read error: Connection reset by peer]
bb-yoda has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
amerlyq has quit [Quit: amerlyq]
vms14 has quit [Remote host closed the connection]
quakenet has joined #lisp
<quakenet> !help
<quakenet> .help
<ebrasca> .help
<ebrasca> quakenet: /help
bb-yoda has quit [Quit: Leaving]
<quakenet> .ping *
<ebrasca> quakenet: .pong *
<quakenet> !scan ebrasca vergin
<quakenet> .ping *
<ebrasca> quakenet: It is with / ...
dddddd has joined #lisp
cosimone_ has quit [Remote host closed the connection]
ebrasca has quit [Remote host closed the connection]
varjag has joined #lisp
quakenet has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
brown121407 has quit [Read error: Connection reset by peer]
brown121408 has joined #lisp
jkvl has quit [Ping timeout: 265 seconds]
vidak` has joined #lisp
jkvl has joined #lisp
Kundry_Wag has joined #lisp
cosimone has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
ebzzry has joined #lisp
Kundry_Wag has quit [Ping timeout: 260 seconds]
<mfiano> How can I check if an arbitrary symbol denotes a known type or not, suitable for use as the second argument of TYPEP?
<beach> You can't, at least not in a portable way.
<mfiano> Thanks
smokeink has quit [Ping timeout: 265 seconds]
jkvl has quit [Ping timeout: 260 seconds]
Bourne has quit [Ping timeout: 268 seconds]
pnp has joined #lisp
vidak` has quit [Ping timeout: 260 seconds]
Kundry_Wag has joined #lisp
<Shinmera> mfiano: (definitions:definition-p symbol 'definitions:type)
<Shinmera> Colleen: tell mfiano look up definitions definition-p
<Colleen> mfiano: "definition-p" not found in DEFINITIONS.
<Shinmera> ech
<Shinmera> Colleen: tell mfiano look up definitions
rozengla` has joined #lisp
rozengla` has quit [Client Quit]
rozenglass has quit [Ping timeout: 258 seconds]
jonatack has joined #lisp
bitmapper has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life_ is now known as Lord_of_Life
shifty has quit [Ping timeout: 240 seconds]
jonatack has quit [Read error: Connection reset by peer]
<pjb> mfiano: moreover, for some implementations, such sbcl, all symbols denote a type (possibly not yet known)/
isBEKaml has quit [Quit: leaving]
sammich has joined #lisp
libertyprime has joined #lisp
okflo has joined #lisp
okflo has left #lisp [#lisp]
orivej has quit [Ping timeout: 258 seconds]
nika has joined #lisp
<boeg> Other than p/-p for predicate, are there any other such conventions one should be aware of?
<beach> boeg: f
<beach> boeg: remf, setf,
<boeg> beach: what is that ... called?
<beach> Not sure there is a name for it. It is used for functions that modify some place.
<beach> Er, operators, not functions.
<boeg> alright, so modify instead of returning, then use the f convention?
<beach> Not quite. It is more complicated than that.
<boeg> alright
<beach> I am afraid I have no pre-cooked definition.
<boeg> sure
<boeg> no problem
<beach> Others may be able to help.
<boeg> now i'm at least aware of it, that is good, thanks
<beach> Sure.
<boeg> is there also a convention with ! ?
<boeg> as in "bang"/"!"?
<boeg> I overheard that in a podcast, but with no example
<boeg> cant find anything about it
<beach> That's a Scheme convention.
<boeg> oh, okay, think it was said it was a "lisp" convention
<boeg> but okay
<beach> I don't think they mean the same anyway.
<beach> The "f" convention seems to be used with macros and special operators that take a "place".
<boeg> what do you mean with "take a place"?
<beach> Whereas the Scheme convention is used for functions that alter data.
<beach> I mean that one argument is a place, so it is not evaluated.
<beach> See "place" in the glossary.
<galdor> '!' is for mutating functions in Scheme
<boeg> ah
<boeg> galdor: yes that is what I heard, though with "lisp" not "scheme" specifically
<boeg> beach: makes sense, thanks
<beach> Sure.
<galdor> some CL functions use a 'n' prefix for functions which destruct some arguments (NREVERSE, etc)
<beach> Ah, yes, forgot about that one.
<boeg> ah, thats right
<beach> Also the distinction between "remove" and "delete".
<beach> The latter being destructive.
<galdor> I'd love to know why there's DELETE and not NREMOVE
<boeg> ah
<beach> Hysterical reasons. :)
<galdor> I guess some lisp dialects at the time had DELETE
<beach> You can check the Maclisp manual. My recollection is that it wasn't particularly regular in its naming conventions.
pnp has left #lisp [#lisp]
<galdor> too bad the standard never evolved
<beach> Aww, not again!
<galdor> the argument still works ^^
<_death> there are more conventions.. e.g., using full words, do-/with-/def/define-/make-/<type>-<op/prop>, earmuffs, etc.
<beach> Indeed.
Achylles has joined #lisp
mathrick has quit [Ping timeout: 260 seconds]
jonatack has joined #lisp
whiteline has quit [Remote host closed the connection]
whiteline has joined #lisp
mangul has joined #lisp
shangul has quit [Ping timeout: 260 seconds]
mangul is now known as shangul
varjag has quit [Ping timeout: 258 seconds]
illili has quit [Ping timeout: 240 seconds]
illili has joined #lisp
jmercouris has joined #lisp
jmercouris has quit [Remote host closed the connection]
freedom has joined #lisp
slyrus has joined #lisp
freedom is now known as gnufr33d0m
slyrus_ has quit [Ping timeout: 260 seconds]
anewuser has joined #lisp
nekosagan has quit [Read error: Connection reset by peer]
EvW1 has joined #lisp
wsinatra has joined #lisp
wsinatra has quit [Client Quit]
wsinatra has joined #lisp
wsinatra has quit [Quit: WeeChat 2.7]
gravicappa has quit [Ping timeout: 258 seconds]
grobe0ba has quit [Ping timeout: 260 seconds]
grobe0ba has joined #lisp
Oladon has joined #lisp
cantstanya has quit [Remote host closed the connection]
illili has quit [Ping timeout: 265 seconds]
cantstanya has joined #lisp
brown121408 has quit [Ping timeout: 260 seconds]
brown121408 has joined #lisp
illili has joined #lisp
clothespin has quit [Ping timeout: 265 seconds]
slyrus has quit [Ping timeout: 240 seconds]
izh_ has joined #lisp
Lycurgus has joined #lisp
slyrus has joined #lisp
slyrus_ has joined #lisp
clothespin has joined #lisp
slyrus has quit [Ping timeout: 260 seconds]
prumnopytis has joined #lisp
igemnace has joined #lisp
EvW1 has quit [Ping timeout: 260 seconds]
whartung has quit [Ping timeout: 250 seconds]
<markasoftware> My code loads fine but will not compile. I've been playing around with eval-when but can't get things to quite work. Are there any good guides for how to work with lisp compilers apart from CLHS?
<antoszka> markasoftware: would probably be easier if you actually pasted code and error plus told us which Lisp you're running it on.
fortitude has joined #lisp
<markasoftware> ok, i'll try to make a minimal example
fyrkrans has joined #lisp
<antoszka> Great. Agree the load-time/compile-time subtleties are a little tricky and their behaviour can vary across implementations.
<markasoftware> fails in SBCL and clisp
<markasoftware> *shadow-these* is apparently not defined/bound. I need it both at compile time and runtime
<markasoftware> (I use it for more than just (export) in my real code)
<antoszka> lookin
<markasoftware> well, actually this example fails at load time as well, not just compile. But it works at load time if you remove the eval-when
je4i has joined #lisp
shangul has quit [Ping timeout: 240 seconds]
brettgilio has quit [Ping timeout: 260 seconds]
brown121408 has quit [Read error: Connection reset by peer]
brown121407 has joined #lisp
<antoszka> markasoftware: ok, so when you create *shadow-these*, you change to :my-pkg
<antoszka> markasoftware: then you're back in :cl, so you don't see *shadow-these*
<markasoftware> oh crap, the in-package only applies within the eval-when?
<antoszka> oh, sorry, I think I misread the code
<antoszka> let me think a bit more ;)
<markasoftware> that actually makes sense
<markasoftware> i think that's right
<antoszka> but it could be the problem
<antoszka> not sure how the reader behaves
<antoszka> but it's surely a wrong-package issue
clothespin has quit [Ping timeout: 252 seconds]
<markasoftware> hmm, so if I add (in-package :my-pkg) after the eval-when, it compiles, but won't run
anewuser has quit [Ping timeout: 258 seconds]
<antoszka> TBH, I don't think I'm getting the eval-when block to do anything in my little test-case
EvW has joined #lisp
Necktwi has joined #lisp
<antoszka> markasoftware: ok, another problem is that shadow shadows the *shadow-these* symbol itself
<_death> markasoftware: first, the whole eval-when form is READ by the reader.. this means *shadow-these* is interned in the current package (the value of *package*)
<antoszka> markasoftware: it's not "unfolded"
igemnace has quit [Quit: WeeChat 2.7]
<antoszka> markasoftware: btw, it might not be immediately relevant, but a lot of reader/package gotchas are excellently eplained in this document: http://www.flownet.com/gat/packages.pdf
<antoszka> highly recommended reading (must re-read this myself)
<_death> markasoftware: why do you wrap things in eval-when and not just have a defpackage
clothespin has joined #lisp
<markasoftware> _death: *shadow-these* should be in the my-pkg package, which I can't do if I put it before defpackage
<markasoftware> but if i put it after defpackage i can't use it inside of defpackage
<_death> markasoftware: let's rewind a bit.. why do you need *shadow-these*
<markasoftware> in my real code I use the list *shadow-these* quite a lot (and it's not named shadow-these). They are symbols that I treat in a special way when passed in the argument to a certain macro.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<markasoftware> essentially, i have a macro, let's call it (expand-normal-functions), and a call like (expand-normal-functions (+ 5 2 (cl:+ 1 2))) should return (quote (+ 5 2 3))
<_death> markasoftware: ok.. so what's wrong with (defpackage :my-pkg (:use :cl)) (in-package :my-pkg) (defparameter *shadow-these* ...) ...
<markasoftware> so, it uses the list *shadow-these* to know wthich functions should be evaluated and which should be left alone while walking the tree
lemoinem is now known as Guest83539
Guest83539 has quit [Killed (weber.freenode.net (Nickname regained by services))]
lemoinem has joined #lisp
<markasoftware> _death: because then all the symbols in *shadow-these* are from common-lisp package. Maybe I should just buck up and write my-pkg: before each symbol in *shadow-these*
<_death> markasoftware: you can pass symbol names to shadow
<markasoftware> to be clear, if a file has (progn (in-package :some-package) 'some-symbol), that some-symbol will get interned into common-lisp because the reader does the whole progn at once?
<markasoftware> yes it does
<_death> first, the reader reads the form.. if the current package is cl-user, then some-symbol will be interned in cl-user
<_death> then, the form is evaluated
<_death> in-package will set *package* to the package named "SOME-PACKAGE", and the (cl:quote cl-user::some-symbol) form will evaluate to cl-user::some-symbol
Kundry_Wag has quit [Remote host closed the connection]
pnp has joined #lisp
<markasoftware> i need the symbols in *shadow-these* to be in the current package...i guess i could mapcar over it and re-intern all the cl symbols into my-pkg
<markasoftware> after in-package
<markasoftware> either way, I understand now
pnp has left #lisp [#lisp]
<markasoftware> My fundamental misunderstanding was thinking that the whole file was read, then the whole file was macroexpanded, then the whole file evaluated, etc
<markasoftware> now i realize it happens form-by-form
<markasoftware> I previously thought there were special cases in the reader that looked for in-package statements, but now it makes much more sense
<_death> in-package basically expands to setq *package* in an eval-when
pnp has joined #lisp
vlatkoB has quit [Remote host closed the connection]
<Lycurgus> anybody know what you have to do to have slime let commands thru to ACL?
cosimone has quit [Remote host closed the connection]
<Xach> Lycurgus: what is ACL in this context?
<Lycurgus> allegro common lisp
<Xach> Lycurgus: what does "let commands thru" mean?
<Lycurgus> it means that if I run ACL at the command line I can execute it native : commands but not when running slime with ACL
<Lycurgus> *its native
<Xach> ah, those repl commands. i don't know, sorry. slime has its own repl commands. what commands do you miss?
<Xach> I use the slime , commands instead but i don't know if they are all replaced.
<Lycurgus> well all of em in principle, but yeah will push off till I have immediate need for non slime provided, want cd/pwd right now
<Xach> I use ,cd for that
<Xach> never used ,pwd but i tlooks like it's there
<clothespin> does anybody know how to get sb-aclrepl working?
<Xach> clothespin: type (require 'sb-aclrepl). Does not work in slime.
<Xach> Only directly on the command-line.
<clothespin> ah i see
<Xach> I used to use that a lot but I don't use the cli directly any more, it's always through slime or emacs shell mode.
<Lycurgus> yeah , works dunno how the lisp honors but will know soon enuf
nika has quit []
luna_is_here_ has quit [Ping timeout: 260 seconds]
ggole has quit [Quit: Leaving]
je4i has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
luna_is_here_ has joined #lisp
rozenglass has joined #lisp
izh_ has quit [Quit: Leaving]
teej has joined #lisp
Lycurgus has quit [Quit: Exeunt]
illili has quit [Ping timeout: 258 seconds]
illili has joined #lisp
X-Scale has quit [Ping timeout: 260 seconds]
pnp has quit [Remote host closed the connection]
X-Scale has joined #lisp
scymtym has quit [Ping timeout: 248 seconds]
scymtym has joined #lisp
efm has quit [Remote host closed the connection]
jmercouris has joined #lisp
dale has joined #lisp
cosimone has joined #lisp
orivej has joined #lisp
slyrus has joined #lisp
libertyprime has quit [Ping timeout: 265 seconds]
resttime[m] has joined #lisp
slyrus_ has quit [Ping timeout: 268 seconds]
resttime[m] is now known as rest[m]
efm has joined #lisp
Oladon has quit [Quit: Leaving.]
rest[m] has left #lisp ["User left"]
Kundry_Wag has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
libertyprime has joined #lisp
Kundry_Wag has quit [Ping timeout: 240 seconds]
cosimone has quit [Quit: Quit.]
b0nn has joined #lisp
_whitelogger has joined #lisp
clothespin has quit [Ping timeout: 245 seconds]
clothespin has joined #lisp
bilegeek has joined #lisp
<pjb> markasoftware: Just use defpackage: https://termbin.com/73ed
Oladon has joined #lisp
<pjb> markasoftware: and with export: https://termbin.com/fizm
rumbler31 has joined #lisp
<rumbler31> I might be overthinking this, but I want to be able to modify parts of a list using setf. I'm storing coordinates in a list and am looking to do something like (setf "second place of list" value) such that the list is updated in place
<rumbler31> this function doesn't do what I want, and I'm sure I am misunderstanding lots of things
<pjb> (let ((list (list 1 2 3 4 5))) (setf (second list) 42) list) #| --> (1 42 3 4 5) |#
<rumbler31> directive is a symbol like r222 which will be interpreted as "move the cursor to the right 222 steps"
<pjb> There's nothing to think about.
<rumbler31> oh, let me review my code then, I guess I was thinking about it right
<pjb> (let ((list (list 1 2 3 4 5))) (setf (elt list (random 5)) 42) list) #| --> (42 2 3 4 5) |#
torbo has joined #lisp
<rumbler31> well, while I look deeper, my function doesn't actually seem to update the list in question. I get a list of '(0 0) coordinates instead
<pjb> rumbler31: look at my examples!
<pjb> rumbler31: also, '(0 0) returns a literal IMMUTABLE list.
ttg has joined #lisp
<pjb> my examples use LIST to build a new mutable list.
<rumbler31> hmm
clothespin has quit [Ping timeout: 260 seconds]
<rumbler31> so I should be able to call something like (incf place value) where place is bound at runtime to a form like (second list)
<pjb> No.
<pjb> But you can write (incf (second list) 3)
<pjb> or (incf (elt list index) increment)
<pjb> you can use any accessor function as a place.
narimiran has quit [Ping timeout: 268 seconds]
<pjb> Check in clhs wither it says "Accessor" or "Function".
<rumbler31> but I can't say (setf place (second list)) (incf place value)
<pjb> For example
<pjb> clhs sin
<pjb> says Function.
<pjb> but
<pjb> clhs second
<pjb> says Accessor.
<pjb> rumbler31: you can say it, but the place is the variable place.
<pjb> places are not first class objects.
<pjb> But you can make something like this with closures.
<rumbler31> hmm
torbo has quit [Remote host closed the connection]
<pjb> But if your places are only elements of a list, using (elt list index) as place should be enough.
<rumbler31> thank you
<jmercouris> anyone working on a CL LSP?
<jmercouris> I see steve losh has a call to action on his site
<jmercouris> has anyone contacted him?
parjanya has quit [Remote host closed the connection]
<prumnopytis> jmercouris: I can't see the call to action
<p_l> jmercouris: I believe some people who attempted it found that LSP doesn't offer enough functionality compared to SWANK
<jmercouris> most certainly it doesn't
<p_l> there are SWANK clients for Atom and I think some people are working on one for VSCode
<jmercouris> but as steve losh hints, one could use SWANK to implement LSP quite simply
illili has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<jmercouris> at least, probably :-)
<White_Flame> rumbler31: you initialize PLACE to NIL in your LET clause. INCF won't be able to work on it since it's not a number.
port1024 has quit [Quit: Leaving]
rozenglass has quit [Read error: Connection reset by peer]
<rumbler31> I set it in the case statement, but i've changed that code and it can be ignored
<rumbler31> I change to setting an index into elt instead of whatever is in there
<White_Flame> ok, that's what I was going to suggest
<White_Flame> since it's a list, you could also store which cons sell you which to (incf (car cell) increment)
<White_Flame> (setf cell list) vs (setf cell (cdr list))
<rumbler31> well, that was what I was trying for initially
Kundry_Wag has quit [Ping timeout: 258 seconds]
<White_Flame> I tend to use cons cells as value containers that can be passed around like that
<rumbler31> but I don't understand enough to make it work. I was trying to bind the place to be edited in the case and then make one call to (incf myplace increment)
<White_Flame> but really, the best way would be to do (list (case direction ...) (case direction ...))
<White_Flame> and simply build the list with the values in place
<White_Flame> (well, there's probably lots of "best" ways, but that'd be a way that's direct and concise)
Kundry_Wag has joined #lisp
<rumbler31> hmm
Kevslinger has quit [Quit: Connection closed for inactivity]
<White_Flame> it is more Lisp style to use expressions inline like that, instead of having tons of SETF everywhere, especially since most forms evaluate to useful values, including things like IF and CASE that tend to be non-expression statements in other languages.
<rumbler31> I guess I would make the two case statements a little less generic, an otherwise clause for when the place shouldn't be updated
<White_Flame> the 1st would be case for L & R, 0 otherwise. The 2nd would be a case for U & D, 0 otherwise
<rumbler31> right
<White_Flame> and you can just use count & (- count) for the values instead of looping
<rumbler31> so next up, this function seems to be storing the cursor position between calls, that is a complete surprise to me
karlosz has joined #lisp
<White_Flame> that's because of '(0 0)
<White_Flame> as mentioned aboe
<rumbler31> I know what closures are but as far as I can tell, I didn't make one
<White_Flame> that's a literal source code list that you're modifying
<White_Flame> (list 0 0) would create a new one every time it's called
<rumbler31> wowww
<rumbler31> but
<rumbler31> initial wouldn't be rebound to a new literal '(0 0) on each call?
<Xach> rumbler31: no
<Xach> rumbler31: "new literal" is kind of an oxymoron
<rumbler31> fair enough, it was odd to say,
bitmapper has quit [Read error: Connection reset by peer]
<rumbler31> but, that means that i've made a binding for a literal '(0 0), whose lifetime is uh, indefinite? and is initialized to a literal '(0 0) but since the place now exists, the "re-binding" isn't performed
<nirved> rumbler31: aoc2019-day-3 ?
<rumbler31> yup
<rumbler31> well before I make up my own terms, can someone describe what is going on properly?
<nirved> 2d coordinates might be better represented as complex numbers
bitmapper has joined #lisp
<rumbler31> I'm loosely familiar with that math but I'll give it a think
<rumbler31> so on one hand, it makes sense to me that if I've set something to be a literal that it would be immutable. but here we have a literal, which tells the compiler to close over this variable since it is being modified or something
<White_Flame> rumbler31: the source code comes in as text, which is converted to lists of atoms. QUOTE takes that list and returns it. There is one instantiation of the list (0 0) that is referred to in the intializer of INITIAL, which is the quoted list object
<White_Flame> and you're mutating it in that code
<White_Flame> (technically, I believe it's undefined behavior, but that's the mechanisms that are at play)
<rumbler31> alright, so what I did shouldn't make any sense, since I'm editing a literal,
<rumbler31> so hence undefined behavior is undefined
<White_Flame> yep, literals shouldn't be mutated
<White_Flame> because of the possibility of effects like this
<rumbler31> cheers
<White_Flame> remember, code is data, data is code. By modifying the data, you're basically modifying the code
<White_Flame> (or at least modifying the reference material the code is using in its initializer)
<White_Flame> If you were to use debugging tools of your implementation to print out the source code of your function, I bet you'd see (initial '(<something else>))
<White_Flame> try (describe 'directives-to-list)
heisig has quit [Ping timeout: 258 seconds]
clothespin has joined #lisp
ttg has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
<rumbler31> oh well, got the wrong answer anyways
akoana has joined #lisp
clothespin has quit [Ping timeout: 248 seconds]
<rumbler31> oh, because I am dumb
<rumbler31> union is not the function I want
<rumbler31> I think it might be time for a hash table :-X
<White_Flame> if you're using (x y) lists as the hash table key, make sure to (make-hash-table :test #'equal) so it doesn't go by list object identity
<rumbler31> righ
jmercouris has quit [Ping timeout: 240 seconds]
libertyprime has quit [Ping timeout: 240 seconds]
dale has quit [Quit: My computer has gone to sleep]
varjag has joined #lisp
libertyprime has joined #lisp
Achylles has quit [Remote host closed the connection]
jmercouris has joined #lisp
dale has joined #lisp
shifty has joined #lisp
clothespin_ has joined #lisp
EvW has quit [Quit: EvW]
EvW1 has joined #lisp