p_l 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/> | ASDF 3.3.4
jprajzne has joined #lisp
Jesin has joined #lisp
jprajzne has quit [Client Quit]
tutti has quit [Ping timeout: 260 seconds]
dilated_dinosaur has quit [Ping timeout: 250 seconds]
efm has quit [Read error: Connection reset by peer]
markoong has joined #lisp
arduo has quit [Ping timeout: 250 seconds]
markong has quit [Ping timeout: 256 seconds]
jprajzne has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
markoong has quit [Ping timeout: 256 seconds]
mathrick has joined #lisp
Inline has quit [Ping timeout: 272 seconds]
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
ym555_ has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Ping timeout: 260 seconds]
wxie has joined #lisp
iAmDecim has joined #lisp
bitmapper has quit [Ping timeout: 260 seconds]
FennecCode has quit [Quit: ERC (IRC client for Emacs 26.2)]
jprajzne has quit [Quit: jprajzne]
wxie1 has joined #lisp
efm has joined #lisp
jprajzne has joined #lisp
wxie has quit [Ping timeout: 256 seconds]
wxie1 is now known as wxie
dtman34 has quit [Ping timeout: 250 seconds]
gko has joined #lisp
Oladon has quit [Quit: Leaving.]
wxie1 has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
wxie1 is now known as wxie
v88m has joined #lisp
renzhi has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
Kundry_Wag has joined #lisp
KDr24 has joined #lisp
jprajzne has quit [Quit: jprajzne]
logand` has joined #lisp
jprajzne has joined #lisp
logand has quit [Ping timeout: 250 seconds]
ebzzry has joined #lisp
jprajzne has quit [Quit: jprajzne]
elderK has joined #lisp
<elderK> Hey guys, what's the equivalent of enumerations in CL? Is there such a thing?
<elderK> The reason I ask, instead of just using symbols, is that for efficiency, I'd like to represent something as a 2D array. Say, a transition table.
<elderK> Each symbol would map to an integer index.
<elderK> Failing that, I might invent yet another "state machine" macro :P
xkapastel has quit [Quit: Connection closed for inactivity]
wxie1 has joined #lisp
jprajzne has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
wxie1 is now known as wxie
iAmDecim has quit [Ping timeout: 250 seconds]
SGASAU has quit [Remote host closed the connection]
<pjb> elderK: see com.informatimago.common-lisp.cesarum.utility:defenum
<conjunctive> Hi all, just released a Huet-style zippers library for CL: https://github.com/conjunctive/zip
SGASAU has joined #lisp
<conjunctive> This is my first try working heavily with type declarations in SBCL.
<conjunctive> Also, working with FSet has been fantastic! Coming from Clojure I felt right at home.
<pjb> elderK: there are other variants. see for example: ccl::defenum
mrrevolt has joined #lisp
broccolistem has joined #lisp
asarch has joined #lisp
<elderK> Thanks pjb
<LdBeth> good evening
<elderK> pjb: If using a case statement, would this require translating the integer back to a symbol, and such
<elderK> ?
shifty has joined #lisp
<LdBeth> elderK: for ccl::defenum, no
<LdBeth> it just defines a symbol macro
<elderK> Ah, I have not heard of symbol macros.
<elderK> I will read up :)
broccolistem has quit [Ping timeout: 260 seconds]
wxie has quit [Ping timeout: 260 seconds]
shifty has quit [Ping timeout: 256 seconds]
<elderK> LdBeth: defconstant defines symbol macros?
libertyprime has joined #lisp
<beach> Good morning everyone!
Oladon has joined #lisp
<pjb> elderK: your defenum macro expansion could include a case-<enum> macro…
<adlai> elderK: if you want to roll-your-own, i recommend an eq table from symbols to numbers; anyone concerned about the backlinks deserves the algorithmic complexity.
<elderK> adlai: an eq table?
<pjb> elderK: defconstant defines constant variables. Theorically, they could be implemented as symbol-macros, but implementations define them natively, to be able to detect bindings at compilation time, and for keywords.
<elderK> Good morning, beach!
<pjb> elderK: well, defining constant variables as symbol-macro wouldn't let you prevent binding them.
<adlai> elderK: instead of a 2D array containing symbols designating the elements within the enum, (make-hash-table :test #'eq) for mapping symbols to offsets within the array; then, you don't even have to allocate that array if it's prohibitively large.
shifty has joined #lisp
jprajzne has quit [Quit: jprajzne]
<adlai> have fun doing pointer arithmetic on enumerations :)
<elderK> adlai: I'd rather avoid a hashlookup every time I need the integer value of some symbol.
<elderK> I need to learn more about the case form. Are the things it matches against even evaluated?
<pjb> elderK: you have to define boundaries, outside of which the symbols are used and inside of which the integers are used.
<pjb> elderK: I like to use conversion functions to cross thos boundaries.
<pjb> elderK: If you define constant variables, they have to be defined at compilation-time, so you can use them with #. in case forms processing the integer values.
<pjb> In all cases, I don't see the point of using a hash-table, conversion functions can just use case.
<adlai> elderK: if you'd like to reoptimize an eq hashtable once you're convinced that the enum's membership set has settled, you can verify that hash-table-count and hash-table-size are sufficiently far apart, and then call rehash; however, this is all an implementation detail, and your enum lookups should happen at compile-time
jprajzne has joined #lisp
* adlai may be talking slightly outside the spec here
<adlai> myeah, there's no cl:rehash, although the desired side-effect is to rebuild the hashtable, without another call to make-hash-table, so that optimizers who pay attention to the membership set have an opportunity to work
<Bike> elderK: the case macro does not evaluate the keys, no.
<Bike> each case has a list of keys that are checked against with eql. if a clause key is T or OTHERWISE it's a default. if a clause key is some other object that counts as a list of one object. that's about it.
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
<elderK> Bike: Nuts.
<adlai> maybe elderK is just asking "how is case implemented, when i reserve the right to use as many distinct keys as the size of some mystery 2D program text"
<Bike> it means it can be compiled into a jump table sometimes. that's nice. but it's fundamentally a pretty static operator.
<Bike> you could whip up something with cond if you want evaluated keys, of course
<adlai> elderK: you may find the string-case macro implements exactly what you didn't think you were asking, if you want the enum members to exist at runtime
<elderK> Bike: Aye. It's just I see (cond ...) as a bunch of if statements :P
<Bike> well, good, because that's what it is
<elderK> I see case as something "hopefully" much more efficient, somewhat like switch in C.
<Bike> Yes
<Bike> it is, exactly
<beach> Those would be forms, not statements.
<Bike> and C switch only works with constant expressions, no?
<elderK> Correct.
GuerrillaMonkey has joined #lisp
<Bike> so that's how cl:case works as well. C does have a more expansive concept of constant expressions, though.
<elderK> :( Aye, but if I define something, say, (defconstant foo 3)
<adlai> there is a string-case library that builds a table from strings at compile time, and evaluates the key at run time, although it is not supposed to be abused as a replacement for enumerations
Involuntary has quit [Ping timeout: 260 seconds]
<elderK> and try to use that in a case, (case foo ...)
<Bike> right, that's what I meant.
igemnace has joined #lisp
<elderK> foo will be evaluated, no? But the keys in the case clauses wont.
<Bike> C allows that, lisp does not.
<Bike> you can probably (ab)use the #. syntax for that though.
<elderK> That seems painful.
<Bike> it's not that bad.
<adlai> elderK: in your example, the symbol foo might never be evaluated after the compiler hits defconstant
<Bike> (case expr (#.foo ...whatever code...))
<Bike> the macro trying to evaluate the keys would be a problem because A) it needs a list, and B) case is actually used with literal unevaluated symbols a fair bit
jprajzne has quit [Quit: jprajzne]
<Bike> might be interesting to think about an expansion of what constant expressions are good for, tho
jprajzne has joined #lisp
<elderK> :( So, what's the idiomatic equivalent to a C enumeration, and switching on enumerants? Or using those enumerants as indices?
<Bike> usually we use symbols instead of enumeration constants.
<Bike> iirc sbcl is smart enough to reduce a case on symbols ot a jump table, so that's cool
<elderK> That is cool.
<elderK> So then, if I want to have a mapping between symbols and integer indices, I need a map of somesort.
<elderK> Either a case statement say, or a cond, or a hash table.
<Bike> yeah. well, just define a symbol->integer function that everything uses, and stress about the best way to implement it later
<elderK> So, let's say we use #.SOME-NAME
<elderK> What environment would that SOME-NAME be retrieved from?
<Bike> the compilation environment
<elderK> Right, so i'd have to ensure that my constants were visible via eval-when, correct?
<Bike> if the implementation evaluates defconstants at compile time, as most do, that works fine. if you wanna be paranoid you can put an eval-when on
<Bike> i mean, (defconstant +foo+ 3) will usually be fine by itself
jprajzne has quit [Quit: jprajzne]
<Bike> anyway imma sleep bye bye
Bike has quit [Quit: leaving]
jprajzne has joined #lisp
<elderK> Goodnight Bike, thanks for your help.
cosimone_ has quit [Quit: Quit.]
<elderK> Well, nuts. That is disappointing :(
renzhi has quit [Ping timeout: 250 seconds]
momozor has joined #lisp
<adlai> what are you disappointed about ?
adam4567 has quit [Quit: ERC (IRC client for Emacs 26.3)]
EvW has joined #lisp
adam4567 has joined #lisp
<aeth> elderK: The most idiomatic equivalent to an enum is a member type, e.g. (deftype color () '(member :red :green :blue)) (typep :red 'color)
<aeth> Of course it doesn't actually have an (accessible) associated number until you define an ECASE that maps it to a number, as Bike said.
<aeth> A macro that generates both at the same time shouldn't be too hard.
torbo has joined #lisp
asarch has quit [Quit: Leaving]
akoana has joined #lisp
sauvin has quit [Ping timeout: 240 seconds]
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
xaotuk has quit [Ping timeout: 265 seconds]
sauvin has joined #lisp
pilne has quit [Quit: Clap on! , Clap off! Clap@#&$NO CARRIER]
dmiles has quit []
nmg has joined #lisp
EvW has quit [Ping timeout: 265 seconds]
vlatkoB has joined #lisp
mrrevolt has quit [Quit: Connection closed for inactivity]
Oladon has quit [Quit: Leaving.]
shangul has joined #lisp
akoana has left #lisp ["Leaving"]
ebzzry_ has joined #lisp
GuerrillaMonkey has quit [Remote host closed the connection]
ebzzry has quit [Read error: Connection reset by peer]
lemoinem has quit [Killed (livingstone.freenode.net (Nickname regained by services))]
lemoinem has joined #lisp
narimiran has joined #lisp
dmiles has joined #lisp
ArthurStrong has joined #lisp
wxie has joined #lisp
elderK has quit [Quit: WeeChat 2.8]
nicktick has quit [Quit: Leaving.]
nicktick has joined #lisp
nicktick has quit [Client Quit]
gravicappa has joined #lisp
wooden has quit [Ping timeout: 260 seconds]
wooden has joined #lisp
wooden has quit [Changing host]
wooden has joined #lisp
wxie has quit [Ping timeout: 258 seconds]
torbo has quit [Remote host closed the connection]
ggole has joined #lisp
dddddd has quit [Ping timeout: 256 seconds]
tsrt^ has quit [Ping timeout: 256 seconds]
tsrt^ has joined #lisp
Yoshido has quit []
ebrasca has joined #lisp
Cymew has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
jprajzne has quit [Quit: jprajzne]
random-nick has joined #lisp
jprajzne has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
cmatei has quit [Ping timeout: 240 seconds]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
arduo has joined #lisp
v88m has quit [Ping timeout: 256 seconds]
cmatei has joined #lisp
quazimodo has quit [Ping timeout: 260 seconds]
quazimodo has joined #lisp
Bourne has joined #lisp
tiwEllien has joined #lisp
tiwEllien has quit [Client Quit]
tiwEllien has joined #lisp
arduo has quit [Remote host closed the connection]
lisper29 has joined #lisp
nicktick has joined #lisp
KDr24 has quit [Ping timeout: 256 seconds]
Necktwi has quit [Ping timeout: 256 seconds]
KDr24 has joined #lisp
lisper29 has left #lisp [#lisp]
Necktwi has joined #lisp
anticrisis has quit [Quit: Leaving]
dilated_dinosaur has joined #lisp
ebzzry_ has quit [Read error: Connection reset by peer]
_whitelogger has joined #lisp
vhost- has quit [Ping timeout: 260 seconds]
v_m_v has joined #lisp
shangul has quit [Remote host closed the connection]
shangul has joined #lisp
ebzzry_ has joined #lisp
Aurora_iz_kosmos has quit [Ping timeout: 240 seconds]
space_otter has quit [Remote host closed the connection]
Aurora_iz_kosmos has joined #lisp
fivo has joined #lisp
Cymew has quit [Ping timeout: 265 seconds]
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
Cymew has joined #lisp
Lord_of_Life_ has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
cajetanp has joined #lisp
cajetanp has left #lisp ["WeeChat 2.8"]
gxt has quit [Quit: WeeChat 2.8]
frgo_ has joined #lisp
gxt has joined #lisp
Codaraxis has joined #lisp
frgo has quit [Ping timeout: 265 seconds]
TDeus has joined #lisp
TDeus has left #lisp [#lisp]
kopiyka has joined #lisp
v0|d has quit [Remote host closed the connection]
v0|d has joined #lisp
markoong has joined #lisp
heisig has joined #lisp
Cymew has quit [Ping timeout: 264 seconds]
Cymew has joined #lisp
markoong has quit [Ping timeout: 260 seconds]
markong has joined #lisp
kopiykazzz has joined #lisp
Bourne has quit [Ping timeout: 256 seconds]
kopiykazzz has quit [Remote host closed the connection]
__jrjsmrtn__ has joined #lisp
_jrjsmrtn has quit [Ping timeout: 256 seconds]
mn3m_ has joined #lisp
mn3m has quit [Read error: Connection reset by peer]
mn3m__ has joined #lisp
mn3m_ has quit [Ping timeout: 256 seconds]
ebzzry_ has quit [Read error: Connection reset by peer]
adam4567 has left #lisp ["ERC (IRC client for Emacs 26.3)"]
karlosz has quit [Quit: karlosz]
jmercouris has joined #lisp
Cymew has quit [Ping timeout: 265 seconds]
<jmercouris> can someone help me here, I'm not getting something http://dpaste.com/0MGBZBQ
<jmercouris> it says there is a conflict
Cymew has joined #lisp
<jmercouris> HOWEVER, I am not exporitng the symbol NEXT/BLOCKER-MODE::MODIFIERS
<jmercouris> s/exporitng/exporting
dale has quit [Quit: My computer has gone to sleep]
orivej has quit [Ping timeout: 264 seconds]
<jmercouris> somehow deleting the key argument in request-resource-block causes the error to go away
<jmercouris> this is what makes no sense to me
<jmercouris> how can a key argument to a function cause a name conflict?
ym555_ has joined #lisp
ebzzry_ has joined #lisp
asarch has joined #lisp
trocado has joined #lisp
rippa has joined #lisp
<trocado> (rename-file #p"test/current/" #p"test/123/") is saying it can't rename [current dir]/test/current/ to [current dir]/test/current/test/123/
<trocado> is this expected behaviour?
<trocado> i would assume that both paths are relative to current directory...
bendersteed has quit [Remote host closed the connection]
<Shinmera> clhs rename-file
<Xach> trocado: RENAME merges the new with the old
<Shinmera> "The primary value, defaulted-new-name, is the resulting name which is composed of new-name with any missing components filled in by performing a merge-pathnames operation using filespec as the defaults."
<Xach> trocado: if you don't want that, make sure the new name is more complete
<Xach> i think this is widely unexpected behavior, but it does allow some shortcuts if you have it memorized. like (rename-file "/My/cool/file/frob.lisp" "frob-backup") => "/My/cool/file/frob-backup.lisp"
<trocado> I see, it actually makes sense.
<Xach> it has internal logic at least. the problem with intuition and expectation is it's formed by whatever you learn first, and i learned a different style first (unix mv style).
v_m_v has quit [Remote host closed the connection]
scymtym has quit [Remote host closed the connection]
iAmDecim has joined #lisp
<trocado> Xach
<trocado> Xach: yes, that's right
v_m_v has joined #lisp
<Josh_2> Afternoon all
bitmapper has joined #lisp
dddddd has joined #lisp
ebrasca has quit [Remote host closed the connection]
Bike has joined #lisp
<phoe> hello
Bourne has joined #lisp
scymtym has joined #lisp
v_m_v has quit []
wxie has joined #lisp
cosimone has joined #lisp
iAmDecim has quit [Ping timeout: 265 seconds]
trocado has quit [Ping timeout: 265 seconds]
iAmDecim has joined #lisp
mn3m_ has joined #lisp
mn3m__ has quit [Ping timeout: 265 seconds]
jmercouris has quit [Remote host closed the connection]
<beach> Hello phoe.
Bourne has quit [Read error: Connection reset by peer]
shifty has joined #lisp
EvW has joined #lisp
n1kio has joined #lisp
Bourne has joined #lisp
xaotuk has joined #lisp
ym has quit [Quit: Leaving]
xaotuk has quit [Ping timeout: 265 seconds]
xaotuk has joined #lisp
fivo has quit [Quit: WeeChat 1.9.1]
iAmDecim is now known as cyberoctopi
quazimodo has quit [Ping timeout: 256 seconds]
quazimodo has joined #lisp
xaotuk has quit [Ping timeout: 258 seconds]
davepdot_ has joined #lisp
clintm[m] has joined #lisp
nmg has quit [Remote host closed the connection]
nmg has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
davepdotorg has quit [Ping timeout: 256 seconds]
Inline has joined #lisp
xaotuk has joined #lisp
davepdot_ has quit [Remote host closed the connection]
xkapastel has joined #lisp
igemnace has quit [Quit: WeeChat 2.8]
davepdotorg has joined #lisp
efm_ has joined #lisp
efm has quit [Ping timeout: 240 seconds]
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
davepdo__ has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
xaotuk has quit [Ping timeout: 260 seconds]
wxie has quit [Ping timeout: 250 seconds]
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
trocado has joined #lisp
cyberoctopi has quit [Ping timeout: 258 seconds]
srandon111 has joined #lisp
<srandon111> guys what is meant by "natural recursion"? and what would it be a "non-natural recursioN" ? i found a post on stackoverflow but wasn't able to understand still
<_death> looks like an idiosyncratic term to me
<dlowe> yeah, I would interpret as "solving a problem particularly amenable to recursion" but it's not a term of art
<Bike> recursion on natural numbers? no, i've never heard this term either
sjl_ has joined #lisp
nmg has quit [Remote host closed the connection]
<phoe> srandon111: which post on SO
efm_ has quit [Quit: Konversation terminated!]
sjl_ has quit [Client Quit]
<beach> I am sure if Daniel Friedman came up with those examples, he probably also supplied a definition of the term.
<beach> phoe: It the first answer if you Google it.
<phoe> OK - I see it now
<phoe> it seems to be related to natural numbers, and the most natural operations on these: a check whether a number is zero, adding one to a number, subtracting one from a number
<Bike> oh, like a natural transformation maybe?
<phoe> yes, that's my idea
<phoe> how Church naturals are constructed
<Bike> well i mean it's not actually natural number related https://en.wikipedia.org/wiki/Natural_transformation
shifty has quit [Ping timeout: 250 seconds]
<phoe> if you want to add 1 and 2 in the natural form, you get the stack of (add1 (add1 (add1 0))) which is a Church-encoded 3
shifty has joined #lisp
<phoe> the tail-recursive version does not have this form
efm has joined #lisp
<phoe> that's what I am thinking
<_death> think you mean Church numerals
<_death> i.e. names for numbers
Lord_Nightmare has joined #lisp
<phoe> _death: uh uh yes I mean that
<_death> to me it looks like a didactic device and not much more
cyberoctopi has joined #lisp
cyberoctopi has quit [Ping timeout: 240 seconds]
monokrom has joined #lisp
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
Lord_Nightmare has joined #lisp
epony has quit [Remote host closed the connection]
epony has joined #lisp
libertyprime has quit [Read error: No route to host]
ski has quit [Remote host closed the connection]
EvW has quit [Ping timeout: 260 seconds]
cyberoctopi has joined #lisp
pjb has quit [Ping timeout: 272 seconds]
Steinberg2010 has joined #lisp
n1kio has quit [Remote host closed the connection]
Necktwi has quit [Ping timeout: 265 seconds]
vlatkoB has quit [Remote host closed the connection]
<jcowan> _death: It's a dao of beginning programming that makes termination trivial to prove
<jcowan> specifically, structural recursion is correct based on the correctness of structural induction over the domain
davepdotorg has joined #lisp
vlatkoB has joined #lisp
vms14 has joined #lisp
ebzzry_ has quit [Read error: Connection reset by peer]
davepdo__ has quit [Ping timeout: 265 seconds]
heisig has quit [Quit: Leaving]
zaquest has joined #lisp
<vms14> how I make sbcl work as a script with the shebang?
<vms14> I've tried with #!/path/sbcl but won't load the code, just start
<vms14> and adding --script to that
<vms14> but then won't load quicklisp
EvW1 has joined #lisp
Steinberg2010 has quit [Ping timeout: 272 seconds]
<Xach> vms14: --script does not load .sbclrc so you need to do things more manually.
cyberoctopi has quit [Ping timeout: 258 seconds]
<vms14> thanks Xach, just saw it now on the man page
<vms14> but I'm not finding a similar flag
nicktick has quit [Quit: Leaving.]
<_death> you can save an image with quicklisp (and other third-party libraries) loaded
<vms14> meh, I've just made a shell script
cyberoctopi has joined #lisp
<Xach> vms14: what do you mean "similar flag"?
<vms14> bin/swank /usr/pkg/bin/sbcl --load /home/vms/swank.lisp
<vms14> Xach one that does the same as script, but also loading quicklisp
nicktick has joined #lisp
<Xach> vms14: no, there is no flag like that, put (load ...) in your script if you want to use quicklisp.
<vms14> yes, but then I have to make an additional .sh file
<Xach> vms14: why?
<vms14> #!/usr/pkg/bin/sbcl --load
<vms14> (format t ":D~%")
<vms14>
<vms14> this is a test
<vms14> won't work
<Xach> Don't do that. Use --script.
<vms14> with --script it does
<vms14> but then no quicklisp
nicktick has quit [Client Quit]
<Xach> Put (load <path to quicklisp>) in your script if you want to use it.
<vms14> so for having quicklisp I need to call it externally without a shebang
<Xach> No, you don't.
<Xach> Put the code to load quicklisp in your lisp script.
<vms14> thanks
ym555_ has quit [Quit: leaving...]
gko has quit [Ping timeout: 265 seconds]
<vms14> like this? #!/usr/pkg/bin/sbcl --load /home/vms/quicklisp/quicklisp/setup.lisp --script
<vms14> not does not work as script
<vms14> now*
<vms14> strange, because when called externally does work
<Xach> vms14: not at all like that.
<Xach> Use (load ...) in the script to load quicklisp in the script
<vms14> ah lol
<vms14> xD
<vms14> thanks again
<Xach> no problem
<vms14> still the shebang seems to work differently
<vms14> echo "(html)" | sbcl --noinform --load /home/vms/lisp/html.lisp --script
<vms14> does work fine, but I have to add --noinform because if not prints a banner even having --script
<vms14> but with the shebang will enter a repl and do nothing
<vms14> #!/usr/pkg/bin/sbcl --noinform --load /home/vms/lisp/html.lisp --script
<Xach> vms14: you cannot have arguments on the shebang line with --script
<Xach> --script must be the only argument
<vms14> weird, but got it
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
vms14 has quit [Remote host closed the connection]
pjb has joined #lisp
xaotuk has joined #lisp
mn3m_ has quit [Quit: mn3m_]
gravicappa has quit [Ping timeout: 265 seconds]
mn3m has joined #lisp
efm_ has joined #lisp
efm_ has quit [Client Quit]
efm has quit [Ping timeout: 264 seconds]
Inline has quit [Ping timeout: 265 seconds]
vhost- has joined #lisp
vhost- has quit [Changing host]
vhost- has joined #lisp
mn3m has quit [Quit: mn3m]
ArthurStrong has left #lisp [#lisp]
cyberoctopi has quit [Ping timeout: 265 seconds]
trocado has quit [Ping timeout: 265 seconds]
karlosz has joined #lisp
ahungry has joined #lisp
cyberoctopi has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Codaraxis has quit [Ping timeout: 258 seconds]
kamog has joined #lisp
kamog has quit [Client Quit]
Cymew has quit [Ping timeout: 265 seconds]
ukari has quit [Remote host closed the connection]
<srandon111> guys do you commonly use macros?
ukari has joined #lisp
<pjb> srandon111: yes.
<Xach> srandon111: yes
<dlowe> srandon111: yes
KDr2 has joined #lisp
KDr24 has quit [Ping timeout: 256 seconds]
<srandon111> why for example in other lisps such as clcojure the usage of macros is not encouraged ?
<srandon111> Xach, dlowe phb
<srandon111> * pjb
karlosz has quit [Quit: karlosz]
<dlowe> srandon111: I guess you'll have to ask them
karlosz has joined #lisp
karlosz has quit [Remote host closed the connection]
karlosz has joined #lisp
karlosz has quit [Remote host closed the connection]
cyberoctopi has quit [Ping timeout: 256 seconds]
<fiddlerwoaroof> srandon111: my experience with Clojure is that many of the developers come from other languages to it and, so, they don't see the value of macros
madand_ has joined #lisp
<fiddlerwoaroof> (other, non-lisp languages)
<dlowe> specifically, in non-lisp languages macros always break things
<fiddlerwoaroof> Yeah
Kemwer_ has joined #lisp
Kaisyu72 has joined #lisp
mgsk__ has joined #lisp
hydan_ has joined #lisp
asedeno_ has joined #lisp
lonjil2 has joined #lisp
pent_ has joined #lisp
<fiddlerwoaroof> Rich Hickey uses them a lot in the stuff he builds, though
vert2 has quit [Ping timeout: 256 seconds]
jonatack_ has joined #lisp
Kemwer has quit [Ping timeout: 246 seconds]
asedeno has quit [Ping timeout: 246 seconds]
pent has quit [Ping timeout: 246 seconds]
madand has quit [Quit: ZNC 1.7.5 - https://znc.in]
Kaisyu7 has quit [Remote host closed the connection]
lonjil has quit [Quit: No Ping reply in 180 seconds.]
parjanya has quit [Ping timeout: 246 seconds]
mgsk has quit [Ping timeout: 246 seconds]
hydan has quit [Ping timeout: 246 seconds]
<fiddlerwoaroof> Another problem is that some macros (go in core.async) use code-walkers to do major program transformations and end up pretty brittle
jonatack has quit [Ping timeout: 246 seconds]
hydan_ is now known as hydan
asedeno_ is now known as asedeno
mgsk__ is now known as mgsk
pent_ is now known as pent
<fiddlerwoaroof> So, people often have a bad experience using those libraries
Tordek has quit [Remote host closed the connection]
Tordek has joined #lisp
karlosz has joined #lisp
<conjunctive> srandon111: They believe macros are more difficult to compose than functions, and tend to design interfaces around hash-table literals.
<conjunctive> fiddlerwoaroof is right, there is still plenty of macro usage in Clojure code.
Tordek has quit [Ping timeout: 264 seconds]
Tordek has joined #lisp
vert2 has joined #lisp
<srandon111> conjunctive, how can i learn/practice them?
<srandon111> is there any good resource walking you step by step from simple examples to more commples examples ? conjunctive
<fiddlerwoaroof> Paul Graham's On Lisp is a decent introduction
<fiddlerwoaroof> Practical Common Lisp is a better first book to learn about CL
shifty has quit [Ping timeout: 264 seconds]
shifty has joined #lisp
<conjunctive> srandon111: I agree with fiddlerwoaroof, Practical Common Lisp is a great introduction.
<conjunctive> I have heard good things about Let Over Lambda, for working extensively with macros.
<dlowe> Let Over Lambda is entertainment for lispers.
<fiddlerwoaroof> Let Over Lambda is a bad introduction because a couple of its examples dont' work
<dlowe> it's an exploration of what's possible
<fiddlerwoaroof> and it uses standardized functions and macros in non-conforming ways
<phoe> ^
<phoe> LOL is a prime example in Lisp mental gymnastics
<conjunctive> Oh my mistake, thanks for the clarification! I've only just started it.
<phoe> it is enlightening in many ways and useless in many other ways
<phoe> after reading multiple Lisp books, I've often come back to Graham's ANSI CL, Practical Common Lisp, On Lisp, CL Recipes
<White_Flame> on lisp does make a bunch of little utility macros that aren't possible to write as functions
<phoe> not to LOL though
<phoe> so, in a way, it's a theoretical book
<phoe> a very good one, but without much replayability value
<White_Flame> (although many of On Lisp's utilities will be superceded by alexandria)
<White_Flame> regarding let-over-lambda, having used codebases written to its style, I vehemently oppose it for actual work
<White_Flame> for musing about creating an object system from scratch, fine
<srandon111> White_Flame, what is alexandria?
<White_Flame> srandon111: it's a very common general utility library
<phoe> srandon111: a library that is considered by some people to be an essential supplement to the CL package
Necktwi has joined #lisp
<conjunctive> srandon111: You can find the repo at https://gitlab.common-lisp.net/alexandria/alexandria
<White_Flame> although as a learner, the simpler On Lisp utilities are easier to see how they're written
<White_Flame> if you go through the alexandria source code, there's a lot more mindfulness to optimization and ease of use that makes it more complex
<White_Flame> *makes the implementation more complex
<conjunctive> On the topic of Lisp books, would you recommend any prelimary material for the MOP book?
<jcowan> LOL is a careful and thorough explanation of how to do things with macros that are not even worth doing.
<jcowan> (among other things)
orivej has joined #lisp
<fiddlerwoaroof> conjunctive: PCL, basically
<fiddlerwoaroof> the first couple chapters of AMOP are a fairly good example of how to design a complex system in common lisp and wrap in in macros
cyberoctopi has joined #lisp
luni has joined #lisp
shangul has quit [Ping timeout: 258 seconds]
shifty has quit [Ping timeout: 258 seconds]
shifty has joined #lisp
hhdave_ has joined #lisp
zaquest has quit [Read error: No route to host]
hhdave has quit [Ping timeout: 264 seconds]
hhdave_ is now known as hhdave
zaquest has joined #lisp
zaquest_ has joined #lisp
zaquest has quit [Remote host closed the connection]
eschatologist has quit [Remote host closed the connection]
eschatologist has joined #lisp
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
zaquest_ has quit [Ping timeout: 258 seconds]
dddddd has quit [Ping timeout: 256 seconds]
<srandon111> thanks conjunctive
z147 has joined #lisp
<eta> is there a function that takes functions A and B and returns (lambda (v) (A (B v))?
cyberoctopi has quit [Ping timeout: 265 seconds]
<ahungry> so a compose like?
<fiddlerwoaroof> eta: alexandria:compose?
<ahungry> http://rosettacode.org/wiki/Compose_function#Common_Lisp - thats a good sample if you want to just roll your own, its pretty simple/small
<fiddlerwoaroof> The eval version there is evil
zaquest has joined #lisp
cyberoctopi has joined #lisp
<phoe> alexandria:compose is the thing you want
<phoe> I use it almost as often as I use #'a:curry and #'a:rcurry
momozor has quit [Quit: leaving]
shifty has quit [Ping timeout: 260 seconds]
achillesp has joined #lisp
* dlowe wistfully wishes they had called it papply instead of curry
<splittist> you can always use serapeum:partial (I think)
<dlowe> I don't care that much
<dlowe> just enough to complain about it
<dlowe> it's a very specific level of discomfort
luni has left #lisp [#lisp]
<Shinmera> Seems like my normal level of comfort overall
cyberoctopi has quit [Ping timeout: 260 seconds]
achillesp has quit [Remote host closed the connection]
anticrisis has joined #lisp
quantico has quit [Quit: leaving]
parjanya has joined #lisp
<phoe> the mythical weltschmerz
<phoe> ...cl-weltschmerz is a tempting project name
efm has joined #lisp
cybercafe has joined #lisp
<LdBeth> good mornig
<cybercafe> hello friends
cyberoctopi has joined #lisp
<eta> fiddlerwoaroof: thanks, that function's great :)
<LdBeth> eta: It seems you might like to have threading macro too
<eta> LdBeth: is that the arrow function thing?
<LdBeth> yes
cyberoctopi has quit [Ping timeout: 264 seconds]
<pjb> srandon111: people tend to discourage the use of what THEY cannot master. For example, in C, it is strongly discouraged to use inner functions, since it's impossible to write them. In C++ it's discouraged to use OOP, since they cannot do multiple inheritance correctly. etc.
lxbarbosa has joined #lisp
EvW1 has quit [Ping timeout: 265 seconds]
narimiran has quit [Ping timeout: 265 seconds]
pilne has joined #lisp
ggole has quit [Quit: Leaving]
dddddd has joined #lisp
rumbler3_ has quit [Remote host closed the connection]
rumbler31 has joined #lisp
<aeth> pjb: "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" https://en.wikiquote.org/wiki/Brian_Kernighan
<aeth> in particular, anything here in this thread about C's switch is clever: https://news.ycombinator.com/item?id=22789304
<phoe> Lisp makes it possible to debug things that are undebuggable in other languages
rumbler31 has quit [Ping timeout: 240 seconds]
<aeth> Lisp also makes it possible to have things be undebuggable that are debuggable in other languages. e.g. most uses of the programmable reader
<phoe> but it also makes it possible to write 100% clusterfuck code that is impossible to debug even in Lisp
<phoe> yes
<eta> but only if you use HANDLER-BIND instead of HANDLER-CASE and INVOKE-DEBUGGER :p
<phoe> not really
<phoe> you can easily write a reader macro that reads and executes a Malbolge program
<phoe> try debugging that
<eta> ew
<eta> phoe: oh yeah, you also can't debug recursive macro expansions
<srandon111> phoe, how?
<eta> unless you very carefully macroexpand-1 everything
<fiddlerwoaroof> eta: macroexpansions aren't that bad with Slime's macrostepper
<eta> fiddlerwoaroof: true
<fiddlerwoaroof> There are a couple edge-cases
<eta> but if you try and compile a whole file
<eta> then you're done for
<eta> SBCL just blows its stack and moans at you
choegusung has joined #lisp
choegusung has left #lisp [#lisp]
cosimone has quit [Quit: Quit.]
arbv_ has joined #lisp
arbv has quit [Read error: Connection reset by peer]
Jesin has quit [Quit: Leaving]
lxbarbosa has quit [Ping timeout: 246 seconds]
rippa has quit [Read error: Connection reset by peer]
Jesin has joined #lisp
Steinberg2010 has joined #lisp
<pjb> aeth: definitely. This is why a good way to debug some code, is to rewrite it from scratch!
<pjb> which is also a good reason why you should have modular code. So you don't have to rewrite everything, but just the bad module or function.
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Steinberg2010 has quit [Ping timeout: 246 seconds]
VoidSick has joined #lisp
cyberoctopi has joined #lisp
rumbler31 has joined #lisp
logand` has quit [Remote host closed the connection]
anticrisis has quit [Quit: Leaving]
z147 has quit [Quit: z147]
efm has quit [Read error: Connection reset by peer]
Steinberg2010 has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
efm has joined #lisp
efm has quit [Client Quit]
anticrisis has joined #lisp
random-nick has quit [Ping timeout: 240 seconds]
VoidSick has quit [Quit: WeeChat 1.9.1]
tiwEllien has quit [Ping timeout: 240 seconds]
watkinsr has joined #lisp
efm has joined #lisp
akoana has joined #lisp
<jasom> aeth: I used to use that Kernighan quote, but I now disagree with it. I think debugging and writing software are different (though not entirely orthogonal) skills. Over the past 10 years I've written very little code for work, but I've debugged others' code a heck of a lot. My debugging skills have shot way up while my development skills have atrophied a bit. I would say at this point that I am better at
<jasom> debugging code I've never seen before than I am at writing a project from scratch.
<fiddlerwoaroof> Yeah, my experience is that debugging is often easier than writing the code
monokrom has quit [Quit: Leaving]
<fiddlerwoaroof> e.g. when the cleverness/intelligence was in seeing a very simple way to solve a problem
xkapastel has quit [Quit: Connection closed for inactivity]
<fiddlerwoaroof> Or seeing the problem as an application of a more general problem
<jasom> Also very few bugs are novel. I've on occasion suggested fixes to customers code without having ever seen the code, just from observing the symptoms.
Steinberg2010 has quit [Ping timeout: 246 seconds]
ahungry has quit [Remote host closed the connection]
cyberoctopi has quit [Ping timeout: 256 seconds]
msk_ has joined #lisp
cyberoctopi has joined #lisp
msk has quit [Ping timeout: 260 seconds]
xkapastel has joined #lisp
v0|d has quit [Ping timeout: 256 seconds]
notzmv has quit [Ping timeout: 258 seconds]
cosimone has joined #lisp
Aurora_iz_kosmos has quit [Ping timeout: 240 seconds]
<aeth> jasom: I suppose it's more accurately about reading than debugging, as in, it's harder to read (clever) code than to write it. e.g. regex
<aeth> I'm not sure that's true, either, though. There are definitely lots of things that take all day to write a handful of lines
<aeth> In that case, it's a bit hard to separate writing from debugging, though
<fiddlerwoaroof> I've used regexes so much by now that I forget people have trouble reading them :)
<aeth> which regexes matter
<aeth> some languages let you do multiline and even commented regex
<fiddlerwoaroof> I mean the standard, compressed "line-noise" regexes
<fiddlerwoaroof> e.g. (?:[a-z]{2,})? stuff
wxie has joined #lisp
cyberoctopi has quit [Ping timeout: 264 seconds]
cosimone has quit [Quit: Quit.]
<fiddlerwoaroof> It's a bit like APL: for someone just getting started the syntax is gibberish, once you've really internalized it, it's the most efficient way to express precisely what you mean in the problem space.
<aeth> Idk, I think regex is kind of like sh. It can't scale. Or, rather, it can scale but why would you?
<aeth> that is, you can do neat one liners, but at some point, it's not the best tool
cosimone has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
cosimone has quit [Client Quit]
wxie has quit [Ping timeout: 250 seconds]
cosimone has joined #lisp
rpg has joined #lisp
Aurora_iz_kosmos has joined #lisp
anticrisis_ has joined #lisp
anticrisis__ has joined #lisp
<fiddlerwoaroof> Sure, but as a DSL for specifying sets of strings inside a larger program, it's really nice
anticrisis has quit [Ping timeout: 265 seconds]
anticrisis_ has quit [Ping timeout: 265 seconds]
gigetoo has quit [Ping timeout: 240 seconds]
gigetoo has joined #lisp
ayuce has joined #lisp
ayuce has quit [Remote host closed the connection]
<fiddlerwoaroof> (SETF DRAKMA:*HEADER-STREAM* (SWANK-BUFFER-STREAMS:MAKE-BUFFER-OUTPUT-STREAM))
<fiddlerwoaroof> This is pretty nice: I can turn on http-mode in the resulting emacs buffer and get a nice colorized log of http requests next to my repl