freenode/lisp - IRC Chatlog
Search
17:02:44
dim
maybe there are? some companies want solutions that work and are easy to maintain and don't care so much about the programming language that's used to deliver the solution
17:26:03
anamorphic
Is there a loop clause that works for things that are sequences? I found "for foo being the elements of fooseq" works, but I think it's a loop impl specific
17:28:13
anamorphic
So something like (loop with length = (length myseq) for i below length do ... (elt myseq i)) would be the way to go?
17:52:12
aeth
anamorphic: Never use length more than once, ideally on something known to be small. It's O(n) on lists.
17:57:08
aeth
If your loop is simple enough you could have a macro use for ... in ... when it's a list or for ... across ... when it's a vector. If you need to set, you would have to set the car on for ... across if it's a list (if that's not undefined behavior) and use indices for vectors
17:57:55
aeth
anamorphic: Iterate is problematic imo. It is not just a strict superset of loop with s-expressions for clauses
17:59:10
aeth
You would have to learn it (and it has a 40+ page PDF manual) and expect the reader to know it. You also would, apparently, have to use iterate:foo symbols for its clauses instead of keywords
17:59:57
sjl_
You can use keywords with iterate, except for the first symbol. (iterate (for x :from 0))
17:59:58
aeth
I have added writing something like iterate but readable by people who only know loop to my macro todo list
18:00:57
aeth
sjl_: That means that you need to :use iterate if it isn't a symbol in CL (never :use packages) or prefix always or explicitly import those symbols one-by-one
18:02:18
aeth
I'm perfectly happy to start with a keyword in a DSL and, in fact, it helps hint that it is a DSL and not a Lisp macro/function.
18:02:21
sjl_
Sure. That's the point of the package system -- if I extend iterate with an iteration construct (foo ...) and someone else extends it with a different (foo ...), the names don't clash.
18:03:56
aeth
sjl_: One possible solution is to do the extensible part in a clause that begins with keyword and then is followed by a symbol
18:04:20
pjb
(defmacro while …) (defmacro for …) and with do dolist and dotimes, you don't need anything lese.
18:04:35
Bike
saying extensibility is overrated now, in the midst of "how can i use this LOOP extension", is a little odd
18:05:37
sjl_
aeth: ... I'd rather use the package system than invent some kind of inheritance system for loops.
18:06:49
sjl_
And I very much like iterate's extensibility. I probably have 50+ custom iterate driver macros/clauses that save me boilerplate.
18:08:17
aeth
Bike: Outside of LOOP similar super-iteration macros/functions, the solution is simple when extending: write your own macro or higher order function on top of a more basic one, e.g. my do-destructuring-bind macro on top of dolist.
18:11:48
pfdietz
LOOP is so simple a child of five could understand it. Someone please get me a child of five.
18:12:07
aeth
Bike: Even for something that replaces loop, the solution for extensibility might just be to write your own macro/HOF on top of it
18:13:48
Bike
how exactly would you write another macro on top of loop that gives it a new thing to iterate over
18:14:23
aeth
Bike: The only problem with either of my extension solutions (pseudo-inheritance, probably trivially implemented on actual inheritance; or write a macro) is when you want to combine two separate extensions in one iteration construct
18:15:07
aeth
Bike: I'm talking about a superset of s-expressionized LOOP, let's call this hypothetical DO-LOOP
18:37:39
aeth
Someone should write a bot that posts irc://irc.freenode.net/#lisp when someone says "pwd" (with a limit of once every 12 hours so people don't spam it and it only happens to accidents)
20:28:02
anamorphic
Do any of the various documentation utils let you reference an image file (e.g. diagrams) from within doc strings?
20:51:12
jackdaniel
docstrings are strings. you may create a library which can interpret a special syntax, but for CL it will be a bunch of letters anyway
20:53:23
dim
I think anamorphic is asking specifically about such syntax supporting utilities that would read the docstrings etc
21:01:00
fisxoj
it's not markdown, but I've been working on https://github.com/fisxoj/coo that works with docstrings that are restructured text
21:01:31
fisxoj
it's not super usable, yet, I just found https://github.com/eudoxia0/docparser and need to incorporate that
21:29:27
z3t0
How do I go down a line in the slime repl? Pressing enter causes the code to be evaluated
22:59:59
jiby
I'm fighting with string ~basics. Objective is getting regex "[abc]" from list of #\[ '(#\a #\b #\c) #\]
23:01:32
jiby
so I'd need to give it a sequence-of-char? it doesn't like (concatenate 'string '(#\[) char-list '(#\[)) either
0:20:20
no-defun-allowed
what was that program that typeset mathematical equations using boxes and stuff in the terminal?
2:18:08
Bike
clschool is for learning the language, lisp is for when you've learned the language but not really
4:40:06
aeth
elderK: Meanwhile a question about e.g. "what web libraries should I use?" would belong here
4:44:17
aeth
There are also channels for specific topics, e.g. #lispgames so questions aren't just in one of the two