bilegeek has joined #commonlisp
igemnace has quit [Remote host closed the connection]
habamax has joined #commonlisp
herjazz has joined #commonlisp
tetsuo9 has quit [Ping timeout: 264 seconds]
rtypo has quit [Ping timeout: 245 seconds]
random-nick has quit [Ping timeout: 246 seconds]
dcb has quit [Quit: MSN Messenger 4.0.1]
markb1 has quit [Server closed connection]
markb1 has joined #commonlisp
ElKowar has quit [Server closed connection]
ElKowar has joined #commonlisp
superdisk has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 240 seconds]
dec0d3r has joined #commonlisp
dec0d3r has quit [Quit: Leaving]
tyson2 has quit [Remote host closed the connection]
Oladon has quit [Quit: Leaving.]
herjazz has quit [Quit: leaving]
zagura has quit [Server closed connection]
zagura has joined #commonlisp
notzmv has joined #commonlisp
m5zs7k has quit [Server closed connection]
m5zs7k has joined #commonlisp
cognemo has quit [Server closed connection]
cognemo has joined #commonlisp
tetsuo9 has joined #commonlisp
Oladon has joined #commonlisp
AkashaPeppermint has quit [Server closed connection]
robin has quit [Ping timeout: 246 seconds]
Lord_Nightmare has joined #commonlisp
bilegeek has quit [Quit: Leaving]
asarch has joined #commonlisp
shka has joined #commonlisp
duuqnd has joined #commonlisp
msavoritias has joined #commonlisp
asarch has quit [Quit: Leaving]
duuqnd has joined #commonlisp
snits has joined #commonlisp
rgherdt has joined #commonlisp
Catie has quit [Read error: Connection reset by peer]
alcor has joined #commonlisp
Catie has joined #commonlisp
Catie has quit [Client Quit]
robin has joined #commonlisp
bjorkint0sh has joined #commonlisp
bjorkintosh has quit [Ping timeout: 246 seconds]
robin_ has joined #commonlisp
robin has quit [Ping timeout: 246 seconds]
Catie has joined #commonlisp
dinomug has joined #commonlisp
dinomug has quit [Remote host closed the connection]
dinomug has joined #commonlisp
cdegroot has quit [Ping timeout: 246 seconds]
srji has quit [Quit: leaving]
srji has joined #commonlisp
<
beach>
Hello srji.
<
srji>
im trying to get familiar with generating lisp code
<
beach>
Generating it from what?
thollief has joined #commonlisp
<
srji>
im trying to generate similar defmacros just the name is changed
<
srji>
here is my code
<
Mrtn[m]>
ood Idea 💡
<
srji>
(loop for item in '(primary secondary success danger warning info light)
<
srji>
collect `(defmacro btn-,item (&body body) (btn (:type ,(format nil "~a" item)) ,@body)))
<
beach>
srji: Please use a paste site for more than one line of code. For instance plaster.tymoon.eu.
<
beach>
OK, so you can't build a symbol that way.
<
beach>
You would have to build the symbol in the loop, using things like concatenate (to build a name) and INTERN to build the symbol form the name.
<
ixelp>
(loop for item in '(primary secondary success danger warning info light) - Pastebin.com
<
beach>
Like I said...
<
srji>
what about the ,@body?
<
srji>
is is trying to eval it
<
beach>
It looks that way.
<
beach>
I think you are about to embark on a form where you need nested backquotes. That can be very tricky indeed.
<
srji>
it is really tricky
<
beach>
If you give me a few minutes, maybe I can create something.
<
srji>
i think i found a solution
<
ixelp>
(defmacro define-button-macros () `(progn ,@(loop for item in '(primary - Pastebin.com
<
beach>
Yes, something like that.
<
beach>
The thing is you need two commas before the FORMAT form.
<
srji>
you are talking about my first try?
<
beach>
But it is better to do that outside the DEFMACRO form.
<
srji>
to generate the symbol name?
<
beach>
To generate the strings "primary", ...
<
beach>
Or use FORMAT instead of CONCATENATE of course.
notzmv has quit [Ping timeout: 240 seconds]
<
srji>
i already use format instead of concatenate
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
<
beach>
Yes, I know. That's why I mentioned it.
dino_tutter has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
<
pjb>
No, don't use FORMAT to build symbol names.
<
pjb>
If you use format, you will use ~A but the behavior of ~A depends on the readtable and other
*print-…* variables. So you WILL write buggy code.
<
beach>
Good point.
<
pjb>
It's more complicated to control the dynamic environment, even with with-standard-io-syntax; simplier to just use concatenate.
Gleefre has joined #commonlisp
pjb has quit [Ping timeout: 246 seconds]
pjb` has joined #commonlisp
phadthai has quit [Server closed connection]
phadthai has joined #commonlisp
Lord_of_Life has quit [Server closed connection]
Gleefre has quit [Remote host closed the connection]
pjb has joined #commonlisp
Lord_of_Life has joined #commonlisp
dinomug has quit [Remote host closed the connection]
pjb` has quit [Ping timeout: 260 seconds]
pjb has quit [Remote host closed the connection]
pve has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life_ is now known as Lord_of_Life
pjb has joined #commonlisp
pony has left #commonlisp [#commonlisp]
Inline has joined #commonlisp
rtypo has joined #commonlisp
<
ixelp>
(defmacro btn ((&key (type nil) (size nil)) &body body) `(spinneret:with-html - Pastebin.com
<
srji>
i do not fully understand how this is working
<
srji>
without using the quote on ',item-name i got a error undefined symbol
igemnace has joined #commonlisp
<
beach>
Your code has several direct violations of the rules stated on page 13 of the LUV slides by Norvig and Pitman.
<
srji>
i dont know these slides
<
srji>
be specific?
<
beach>
For example: WHEN should be used only in a context where the value is not used.
<
beach>
And the test form of WHEN should be a Boolean.
<
srji>
a ok, i thought of when as shorter way of if
<
Inline>
there's no then part to when
<
beach>
It is shorter. But short is not always the most readable.
<
Inline>
err there's no else part to when
<
srji>
so better to use cond in this context?
<
beach>
IF is fine.
<
beach>
(if (null ,type) nil (format...))
<
beach>
Or rather (if (null ,type) '() (format...))
* beach
takes a break.
<
srji>
first i came up with (if ,type (format ...) then i decided this could also be a (when
inline__ has joined #commonlisp
inline__ has quit [Remote host closed the connection]
Inline has quit [Ping timeout: 245 seconds]
Inline has joined #commonlisp
duuqnd is now known as Duuqnd
Oladon has quit [Quit: Leaving.]
waleee has joined #commonlisp
rgherdt has quit [Ping timeout: 240 seconds]
scymtym_ has joined #commonlisp
<
beach>
srji: Semantically, they are the same, but the LUV slides are not about semantics, but about communication between programmers.
scymtym_ has quit [Quit: ERC 5.6-git (IRC client for GNU Emacs 30.0.50)]
jmdaemon has quit [Ping timeout: 246 seconds]
jello_pudding has quit [Ping timeout: 246 seconds]
random-nick has joined #commonlisp
<
srji>
which is important. it is hard to think about technical stuff and at the same to think about design oder readability of code
jello_pudding has joined #commonlisp
<
beach>
It becomes easier over time. Just like it gets easier over time to write technical documents with the reader in mind.
<
beach>
But I guess if you believe Steven Pinker, it doesn't get easier for everyone. I am thinking of his book "The Sense of Style".
<
beach>
So I guess there must be programmers that never learn as well.
euandreh has joined #commonlisp
waleee has quit [Ping timeout: 246 seconds]
pranavats has left #commonlisp [Disconnected: Hibernating too long]
rgherdt has joined #commonlisp
dcb has joined #commonlisp
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
waleee has joined #commonlisp
Gleefre has joined #commonlisp
euandreh has quit [Ping timeout: 246 seconds]
euandreh has joined #commonlisp
tyson2 has joined #commonlisp
bird_ has quit [Ping timeout: 246 seconds]
zaymington has joined #commonlisp
bird_ has joined #commonlisp
pranavats has joined #commonlisp
srji has quit [Remote host closed the connection]
dino_tutter has quit [Ping timeout: 246 seconds]
masinter has quit [Remote host closed the connection]
habamax has quit [Remote host closed the connection]
zaymington has quit [Ping timeout: 246 seconds]
Lycurgus has joined #commonlisp
attila_lendvai has joined #commonlisp
matt` has joined #commonlisp
jonatack has quit [Ping timeout: 240 seconds]
Lycurgus has quit [Quit: Exeunt: personae.ai-integration.biz]
cage has joined #commonlisp
euandreh has quit [Ping timeout: 245 seconds]
rtypo has quit [Ping timeout: 245 seconds]
euandreh has joined #commonlisp
waleee has quit [Ping timeout: 245 seconds]
rbcarleton has joined #commonlisp
Inline has quit [Ping timeout: 246 seconds]
tyson2 has quit [Remote host closed the connection]
mzan has joined #commonlisp
rbcarleton has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.2)]
jonatack has joined #commonlisp
tyson2 has joined #commonlisp
dcb has quit [Ping timeout: 240 seconds]
dcb has joined #commonlisp
rbcarleton has joined #commonlisp
jmdaemon has joined #commonlisp
rtypo has joined #commonlisp
asarch has joined #commonlisp
waleee has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
dino_tutter has joined #commonlisp
mgl has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
gxt__ has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
gxt__ has joined #commonlisp
Inline has joined #commonlisp
cage has quit [Quit: sQuit]
cage has joined #commonlisp
Oladon has joined #commonlisp
bjorkint0sh has quit [Remote host closed the connection]
bjorkint0sh has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
igemnace has quit [Remote host closed the connection]
Gleefre has quit [Ping timeout: 246 seconds]
Volt_ has joined #commonlisp
tyson2 has joined #commonlisp
Lord_Nightmare has joined #commonlisp
thollief has quit [Ping timeout: 264 seconds]
thollief has joined #commonlisp
msavoritias has quit [Ping timeout: 245 seconds]
waleee has quit [Ping timeout: 260 seconds]
tyson2 has quit [Ping timeout: 246 seconds]
dinomug has joined #commonlisp
triffid has joined #commonlisp
lucasta has joined #commonlisp
Oladon has quit [Quit: Leaving.]
Gleefre has joined #commonlisp
Inline has quit [Ping timeout: 250 seconds]
pranavats has left #commonlisp [Error from remote client]
Volt_ has quit [Quit: ]
Inline has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 28.2]
pranavats has joined #commonlisp
anticomputer has quit [Ping timeout: 240 seconds]
anticomputer has joined #commonlisp
asarch has quit [Quit: Leaving]
karlosz has joined #commonlisp
Guest52 has joined #commonlisp
sherbert has joined #commonlisp
karlosz has quit [Read error: Connection reset by peer]
karlosz has joined #commonlisp
matt` has quit [Remote host closed the connection]
steew has quit [Read error: Connection reset by peer]
thollief has quit [Quit: Leaving]
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 245 seconds]
mgl has quit [Quit: Client closed]
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
tyson2 has joined #commonlisp
LW has joined #commonlisp
LW has quit [Client Quit]
snits has joined #commonlisp
masinter has joined #commonlisp
waleee has joined #commonlisp
alcor has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
karlosz has joined #commonlisp
dinomug has quit [Remote host closed the connection]
karlosz has quit [Client Quit]
euandreh has quit [Ping timeout: 245 seconds]
euandreh has joined #commonlisp
shka has quit [Ping timeout: 252 seconds]
dinomug has joined #commonlisp
waleee has quit [Ping timeout: 264 seconds]
euandreh has quit [Ping timeout: 264 seconds]
waleee has joined #commonlisp
euandreh has joined #commonlisp
waleee has quit [Ping timeout: 246 seconds]
rgherdt has quit [Remote host closed the connection]
waleee has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
dino_tutter has quit [Ping timeout: 245 seconds]
Gleefre has quit [Remote host closed the connection]
azimut has quit [Ping timeout: 240 seconds]
habamax has joined #commonlisp
habamax has quit [Client Quit]
habamax has joined #commonlisp
euandreh has quit [Remote host closed the connection]
euandreh has joined #commonlisp
flip214_ has joined #commonlisp
flip214 has quit [Read error: Connection reset by peer]
Catie` has joined #commonlisp
Catie has quit [Ping timeout: 245 seconds]
pve has quit [Quit: leaving]
euandreh has quit [Ping timeout: 245 seconds]
waleee has joined #commonlisp
Catie has joined #commonlisp
euandreh has joined #commonlisp
Catie` has quit [Ping timeout: 252 seconds]
Catie` has joined #commonlisp
Catie has quit [Ping timeout: 245 seconds]
attila_lendvai_ has quit [Ping timeout: 245 seconds]
Oladon has joined #commonlisp
waleee has quit [Ping timeout: 240 seconds]