freenode/lisp - IRC Chatlog
Search
0:19:18
White_Flame
aeth: I think that you could (destructuring-bind (...whatever... &rest rest) data (setf next-iteration rest)), then the iteration could use the 'next-iteration' variable to dynamically hop through the list. i think
0:29:12
aeth
White_Flame: You absolutely can use destructuring-bind in a loop to setf variables each iteration. I prefer this to LOOP's built-in destructuring because they're semantically slightly different, and destructuring-bind sides more on the side of having an error when the data doesn't match the expected pattern, instead of implicitly trying to get things to work
0:30:52
aeth
White_Flame: A simple example of where this is useful, but it doesn't actually do the setf here (I do it in some other places iirc unless those got refactored away). https://gitlab.com/zombie-raptor/zombie-raptor/blob/c37f9f5fe7223db13573b3fe84884b7e13cfcfc8/util/util.lisp#L555-573
0:32:44
aeth
You similarly have to work around LOOP's limitations when you need to do a MULTIPLE-VALUE-BIND because otherwise you have to cons a MULTIPLE-VALUE-LIST and then destructure it right away.
0:34:51
aeth
Both are limitations that I hope to fix with DO-LOOP when I have the time to write that macro.
1:35:47
fragamus
Hi I’m writing a lisp and I wanted to ask if there is a consensus on the use of brackets and braces as in Clojure
1:42:08
no-defun-allowed
I do like [] in Scheme though in some places, like (let ([x 2]) x) where they are there to make sure you know you're working with special forms, so you know X isn't getting funcalled or something.
1:42:29
no-defun-allowed
And yeah, I'd guess they would, but in Scheme, {}, [] and () are equivalent.
1:43:36
fragamus
Yeah I was thinking that making them equivalent would reduce the nastiness of having to step over them in meta programming
1:43:55
no-defun-allowed
wrt "Clojure is not a lisp", see http://www.loper-os.org/?p=42, and from there we should stick to discussing design issues that are in Common Lisp.
1:45:24
no-defun-allowed
Well, we can't stop you from inventing another pseudo-Clojure, but it's not something I would reccomend.
1:52:15
White_Flame
similarly, I like prolog's distinction between "compounds" and "lists", where there's a special place for a head. With sexprs, you never quite know if a list is intended as code or not, or more generally if the 1st term is special or not
2:05:18
White_Flame
but in general, type inference brings a ton of the performance without demanding every single type be specified
2:05:59
White_Flame
it's way better that it remains optional, because that allows you to change your program first, without having to deal with all the optimization at that stage
2:06:20
White_Flame
and then lock in optimizations as performance indicates, after the design has settled
2:07:11
White_Flame
(I define "change" generally as making it more flexible to handle things it didn't before, which would interfere with static overly specific types)
2:07:48
White_Flame
right, but when it can't infer something, does it refuse to compile, or does it just handle type decisions at runtime?
9:40:58
beach
no-defun-allowed: You can use floats for the report I guess, since no calculations are performed that will change the result.
9:41:35
jprajzne
maybe check the locale first and then obtain the correct format for the operating system?
9:41:50
no-defun-allowed
Well, I haven't declared any number types more specific than REAL, so I'm just adjusting to represent everything in cents.
9:43:08
beach
jprajzne: I am not so sure I would trust the operating system. Mine say "jeudi juillet 18" for today's date for instance.
9:43:52
beach
... which is no doubt a translation of Thursday July 18, except that in France, the date comes before the name of the month.
9:43:58
ck_
no-defun-allowed: mm that's pretty daring of you. For our consultancy, please authorize payment of 3+4i AUS
9:48:21
ck_
nine plus half five sounds like someone is reading a clock and taking timezone differences into account
9:51:14
ck_
Welcome to the wonderful world of locales. What would Sir like? LC_COLLATE? _CTYPE? _MESSAGES? _MONETARY? _NUMERIC?
9:51:20
beach
By the way, if you type "99 in Danish" to the Google search engine, you can see how it is spelled too.
9:53:17
beach
I believe you. I tried to set everything to US English using the GUI tools. But it doesn't take it into account.
9:58:04
no-defun-allowed
Oh, speaking of clomptroller, I have to present a prototype tomorrow, so I'm currently finishing off implementing my UI design.
9:58:40
jprajzne
thus if you have set something else than US format and this happens, it's a bug again
10:12:39
jprajzne
technically, there's been so much crap written that we should not be writing code anymore
10:13:18
ck_
There's the quote about the star developer who said he should be measured by the lines of code he could remove, not the ones he added
10:13:20
no-defun-allowed
Has anyone had any experience with cl-typesetting? I want to change the font to Computer Modern (I have the CMU family) but I'm not sure how PDF font names work.
10:14:04
no-defun-allowed
jprajzne: "In the old days, you would chastise people for reinventing the wheel. Now we beg, 'Oh, please, please reinvent the wheel.'" Though, this might be #lispcafe material.
10:18:03
no-defun-allowed
Oh, the names correspond to AFM files bundled with cl-pdf for some Adobe fonts.
10:25:20
moldybits
can (declare (ignore x)) help a compiler optimize code? or more specifically, does it ever happen in practice?
10:29:39
jackdaniel
it will help you to notice, that you've started using something you've declared as ignored