freenode/#lisp - IRC Chatlog
Search
4:48:54
markasoftware
I want to pass the value of a variable as an argument to a function, if that variable is non-nil
4:49:07
markasoftware
otherwise i want to omit the argument so that the function can use its default value for it. (it is &optional).
4:49:51
markasoftware
Do I just make my own macro to handle this? Or is there some convenient way I am overlooking?
5:12:46
akoana
markasoftware: maybe use something like this: (defun f (&optional (p 'default supplied-p)) (if (and supplied-p (null p)) 'default p))
5:18:16
beach
I guess &aux is on my mind because I used it in my paper on representing method combinations.
6:45:25
Shinmera
p_l: I used &aux in a custom macro to denote special bindings that should be emitted. https://shinmera.github.io/for/#bindings
6:46:12
beach
p_l: Yes, maybe so. I would certainly not want to see it disappear in this famous updated standard that so many people seem to want.
6:53:10
beach
I don't think there is a difference. But in my paper on method combinations, I analyze the lambda list. It would be much harder to analyze the body of the function.
6:54:08
heisig
phoe: Since &aux fits into the lambda list, it can sometimes shorten your code by one line. And it means that you have a central place to put your declarations (after the lambda list).
6:54:19
Shinmera
The &aux are used to emit bindings that surround the entire loop block, whereas the body is emitted within the iteration loop.
6:54:42
kpoeck
3.4.1.5 Specifiers for aux variables .... &aux variable processing is analogous to let* processing.
6:54:42
Colleen
kpoeck: karlosz said 9 hours, 44 minutes ago: https://github.com/robert-strandh/SICL/pull/153 fixes the maxima issue, it compile instantly now
6:54:42
Colleen
kpoeck: karlosz said 9 hours, 9 minutes ago: that means you don't need to comment do-inlining out. if you do, everything will be kinda slow.
6:54:53
heisig
And of course &aux is important in cases where you have no body - like struct constructors.
9:01:05
phadthai
2 should be the result, maybe something mistyped... there's an extra opening paren before your defvar
9:01:56
phadthai
and yes it's important to understand the distinction between defvar and defparameter
9:15:46
no-defun-allowed
doomlist3: Check your parens (and the structure suggested by your indentation).
9:26:04
jackdaniel
beach: I can imagine an expansion, where cd is separately bound in the end clause
9:26:49
beach
I can imagine such an expansion as well, but then it is not helpful to give that kind of style warning.
9:28:05
jackdaniel
doomlist3: to answer your explicit problem: you want (dolist (cd '(1 2 3)) (format t "hu ~a~%" cd))
9:28:30
jackdaniel
dolist has two arguments: one is the binding and return-result clause, and the second is its body
9:30:00
beach
doomlist3: If your code had been correct, with the FORMAT form in the body of the DOLIST, it would have been indented two positions compared to the (DOLIST, not 12.
11:34:11
Bike
Atomic theory says all matter is made up of tiny little balls science calls "atoms". When you ride a bike, your and the bike's atoms get jostled around, so when you do it long enough you swap atoms.
11:34:23
Bike
This is why people who ride bikes a lot eventually become more like bicycles with bell like voices
12:05:46
jmercouris
as you can see it is loading shared libraries from /opt/local/lib which IS NOT in the library load paths
12:22:27
jmercouris
on this page: https://common-lisp.net/project/cffi/manual/html_node/_002aforeign_002dlibrary_002ddirectories_002a.html
12:22:36
jmercouris
I found a foot note at the bottom: https://common-lisp.net/project/cffi/manual/html_node/_002adarwin_002dframework_002ddirectories_002a.html#g_t_002adarwin_002dframework_002ddirectories_002a
12:32:22
MichaelRaskin
Yes, as a terminal command — check if there is an environment variable with such contents
12:33:10
jmercouris
echo $PATH -> /Users/jmercouris/User:/opt/local/sbin:/opt/local/bin:/opt/local/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS
12:33:12
MetaYan
jmercouris: That paste doesn't show cffi:*foreign-library-directories* . You see, on my macOS I have (CFFI::DARWIN-FALLBACK-LIBRARY-PATH), which adds /opt/local/lib
12:33:52
jmercouris
MetaYan: yes it does, CFFI: Foreign Library directories (/Users/jmercouris/Source/Lisp/xyz/bin/xyz.app/Contents/MacOS/../Resources/
12:35:37
jmercouris
it should not be touching that though unless *foreign-library-directories* is not set, which it is
12:38:24
jackdaniel
since we discuss cffi pats not really related to common lisp, any idea why after enabling terminal raw mode, if the very first input is i.e C-c it is delivered as a signal?
12:41:55
MetaYan
And the output of (print cffi:*foreign-library-directories*) doesn't give something like https://termbin.com/3g28 ?
12:43:50
jmercouris
yeah, it is expanded: (#P"/Users/jmercouris/Source/Lisp/xyz/bin/xyz.app/Contents/MacOS/../Resources/" #P"/Users/jmercouris/Source/Lisp/xyz/bin/xyz.app/Contents/MacOS/")