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]
<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?
<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
<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>.
<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 [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>
*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)]
<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
<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
<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]