freenode/#lisp - IRC Chatlog
Search
14:39:23
Ukari
it is a good idea to use (make-symbol "name") instead of (gensym) in defmacro for a better debug experience?
14:40:11
Bike
i find it a bit confusing in the case of e.g. nested macroexpansions, where they'll have distinct symbols that look the same
14:47:00
beach
I once had a student who used only one-letter variables, thinking it would take up too much memory otherwise.
14:48:46
phoe
I once read about a Russian who defined a C macro `#define RETURN(x) return x; }` - including the closing brace, thinking all the closing brackets would take up too much hard disk space otherwise.
14:50:47
schweers
When I started programming (in C/C++), I used the built-in smaller integer types whenever I felt they would be enough. So my code was riddled with 8 and 16 bit ints. On the stack, no less!
14:54:53
syncriix
I have a lot of tasks to sort in emacs, like a few thousand... and I want to sort them by TODO state, Priority and alphabetic order
15:33:17
jeosol
beach, I am doing ok. Finally was able to submit my challenge abstract, waiting for reply.
15:33:46
jeosol
you guys were great help in resolving a bunch of issues, code runs steady, clean, with a lot less problems.
15:35:14
jeosol
This question is probably for the web channel if there is one. I am trying to now add a front end interface. I delved into angular 4 last few days and I almost lost my mind with the unnecessary complexity. I would prefer to stay in lisp
16:38:14
Ukari
`(funcall (lambda () (or (values-list (list)) "hi")))` and `(funcall (lambda () (values-list (or (list) (list "hi")))))`
16:43:18
Ukari
i ask this because the condition that (funcall (lambda () (values))) returns no value while (funcall (lambda () )) returns a NIL
16:44:24
beach
So you just want an example of something similar that would return more than one value?
16:44:32
Ukari
so i want to make (funcall (lambda () (values))) also returns a "NIL" when I defstruct a NIL-struct instead of NIL
17:05:18
foojin
Ukari: Do you have a special ship just for this? With nothing to map over, there's no way to create something sensible for a more complex definition of nil-ship.
17:06:10
foojin
Ukari: You just happen to have something which always turns out the same when constructed.
17:12:47
foojin
Ukari: So I recommend describing the actual problem instead of oversimplifying to the point of the resulting example becoming useless even under its own constraints.
17:13:56
Ukari
it is my fault, i don't like the code style in test-wanna-1 due to it need to do one more step to make a single element list. so i use (or (values may-nil) single) instead and find that it don't return multiple values anymore in this code style
17:33:30
shka_
i want function that will, after accepting full lambda list return me list of optional arguments, key arguments, aux arguments…
17:33:32
foojin
Ukari: First of all, why do you even bother with returning values if you end up collecting them in a list anyways?
17:35:55
Ukari
i am trying to make a generator which needs to transform "return values" in generator function to "iterator objects", something like `function* a() {return 1}; a().next()` in javascript
17:39:09
shka_
Ukari: i did something like generators, simply made syntax like clojure loop, but i save arguments in closure on recur and instead simply jumping to begin i return value
17:46:30
Ukari
shka_, (setf gen (lambda () (funcall (lambda (store) (lambda () (incf store))) -1))) (setf next (funcall gen)) (funcall next) ?
17:48:17
shka_
first function establishes lexical binding for inner function, inner modifies bindings and returns value
17:50:38
shka_
anyway, in use: https://github.com/sirherrbatka/cl-data-structures/blob/df228a268e7ab3478cbf59b71ecdaead0e3edbe1/src/api/expression-tests.lisp#L34
17:50:46
foojin
Ukari: That doesn't look like what you can write in JS and Python (this probably can be done with macros), but if you don't care about keeping the style, it would do just fine.
17:53:30
shka_
traverse will work like (map nil ...), to take just one value you can use cl-ds:consume-front
18:48:18
flip214
> asdf/backward-interface::*deprecated-function-style-warning-enable-asdf-binary-locations-compatibility-notified-p*
19:01:18
defunkydrummer
flip214: i prefer verbose names; and BTW deprecated-function-style-warning-enable-asdf-binary-locations-compatibility-notified-p is still short for Java standards, comparatively
19:02:09
defunkydrummer
flip214: still much better than Java's InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
19:02:21
defunkydrummer
flip214: For real. Take a look at: https://github.com/zxlooong/jdk16045/blob/master/com/sun/java/swing/plaf/nimbus/InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState.java
19:07:47
sunshavi
jackdaniel: an example near to this layout on McCLIM? https://i1.wp.com/qt-project.org/doc/qt-4.8/images/mainwindowlayout.png
19:12:08
jackdaniel
or, if you feel fancy, you may experiment with bbpane (black board pane) which is a "floating" layout (as in opposed to "tiling")
19:22:55
sunshavi
jackdaniel: wanna see the same layout on commonQt. I have found and example on the network?
19:34:45
sunshavi
jackdaniel: see this if u have time (if commonQt installed): https://transfer.sh/dE0xc/holanombre.lisp
19:40:38
jackdaniel
if commonQt works for you and McCLIM doesn't – go for it. I don't think there is much merit in picking wrong tools just for a sake of being lispy
19:44:29
sunshavi
jackdaniel: actually I am trying to check both (commonQt, and McCLIM). commonQt seems quite fine for this kind of layout. I just want to invest a couple of hours and see if I could come with something similar to that with McCLIM.
20:26:59
Bike
(cons nil nil) is a call to the function called CONS. (nil) is a call to the function called NIL. simple, yes?
20:30:15
Bike
(cons nil nil) calls the cons function. the cons function returns a list. that list is then passed to the length function.
20:33:12
loginoob
so anything inside a list like here (Something) will be considered a function call when not in quotes
20:35:04
Bike
or another operation, if something is a macro or special operator. but that is the basic syntax, yes.
23:01:06
cantor
I am getting really tired of all the downsides of Clojure, should I switch to Common Lisp? I am concerned about the enormity of the language and the situation around the build/packaging ecosystem
23:23:09
sukaeto
cantor: you're in a channel about Common Lisp, so I imagine you'll get a very biased answer here
23:23:53
cantor
i.e. people here use common lisp a lot, I want to see what they think of my concerns
23:25:32
sukaeto
a lot of us use Common Lisp professionally and are pretty happy with it, and neither the size of the language nor the tooling were deterrents for that
23:27:35
cantor
Also, what companies use Common Lisp professionally? Is there a list compiled somewhere?
23:30:28
cantor
rme: I knew of Rigetti, but last time I looked they had that "internship-like" program and the regular job descriptions were out of my league
0:40:53
ealfonso
I can't use (setf (slot-value obj sym) value), which complains that the first setf argument is not a symbol. is there a good way to get the accessor for a given slot?
0:42:20
ealfonso
I guess I could generate the accessor's name. but not sure that is the best approach
1:24:40
ealfonso
i have this ugly to-camel-case function that doesn't work because of overlapping ppcre matches: https://pastebin.com/0mjqfqDi any suggestions or should I just not use ppcre for this?
1:28:17
Josh_2
Instead of replacing all of them all at once, couldn't you extract each match and remove the duplicates (if I'm understanding correct)