freenode/#lisp - IRC Chatlog
Search
20:50:58
jackdaniel
I wrote rest api test automation that way (macros were more functionality oriented)
20:54:16
phadthai
other than handling HTTP, you may want to bind *debugger-hook* to handle conditions and use eval... also look at slime/swank that includes a third party implementation-independent REPL
21:16:23
reepca
is there a way to have a 'for' variable in a loop have an initial value and a stepping clause?
22:00:41
no-defun-allowed
That sounds great (and they almost didn't make any paren jokes), but that's steep.
22:02:06
pjb
copec: that's ok. Lispers have been programming in lisp for decades before loop was invented.
22:33:45
no-defun-allowed
TRIVIAL-SKI-COMBINATOR-CALCULUS: the ultimate TRIVIAL-UNTYPED-LAMBDA-CALCULUS
1:08:28
pjb
LdBeth: not harmful, but using to<-from instead of from->to might be better in lisp: (c<-b (b<-a a)) instead of (b->c (a->b a))
1:09:17
ebrasca
pjb: I need to implement wait-for-input-internal for usocket Mezzano implementation.
1:10:37
pjb
ebrasca: well -internal probably means that it's an internal function, so it can do anything, depending on the implementation of your code. wait-for-input should be clear enough: it should wait until something is ready to be read.
1:12:15
pjb
ebrasca: it should be noted that you get no help from CL for this kind of features. There's a LISTEN function for character streams, but since it's always implementation and platform dependent if and how streams are buffered, LISTEN doesn't give much information. It does precisely what it's specified to do, indicate whether there's data ready to be processed for lisp. But more data could have been available if the things had bee
1:12:17
LdBeth
pjb: I mean thinking in coercion while asking for formatting is no good. There could have many functions have type number->string
1:14:41
pjb
LdBeth: scheme number->string doesn't have the type number -> string: it can signal errors…
1:17:32
pjb
Note how C++ or Java function signatures include the set of conditions that are signaled. int foo(int x) throws Y,Z;
1:21:06
LdBeth
pjb: partial in the sense that not all elements in the set of input type are covered. However you can still view conditions/errors/exceptions as objects of certain type
1:22:01
_death
C++ has exception specifications, but nobody uses them because they have issues.. except maybe to say that a function does not throw
1:22:09
LdBeth
A partial function in domain A could be a total on in domain B which is a subset of A
1:25:40
_death
dlowe: well, I wanted to say that I haven't used it for a while, but then I recalled that I used it today.. to add a bit of texture manipulation functions to my imgui+ecl thingy so that I can use vecto to draw stuff and see it appear immediately on screen :)
1:26:09
dlowe
"If an exception is thrown from a function that has not specified the thrown exception in its exception specification, the result is a call to the function unexpected()."
1:28:22
_death
I could've just used cl-opengl for that bit, but I didn't want to depend on it for such basic functionality so provided my own interface
1:29:50
Xach
_death: i am on the verge of making something that uses the vecto api but draws into a browser immediately instead. i need faster feedback.
1:30:38
Xach
dlowe: i was thinking a websocket where lisp pushes primitives to a little js kernel that draws to a canvas. but it's all thinking so far, no doing.
1:31:44
Xach
bidirectional, too, so i could send mouse events to lisp and react. again, mostly daydreaming without code so far.
1:33:35
Xach
this seems legit easier than porting my preferred way of messing around with graphic objects to javascript
1:34:11
smokeink
Xach: I think it's very doable; I've done it with trident mode but I want to switch to using websockets ;
1:45:42
_death
Xach: the color changes every time I C-M-x.. I didn't measure how much time it takes to render though
1:49:27
_death
you could do something like that with simple cl-opengl code.. likely easier than websockets+js :)
1:55:14
Xach
_death: i'd like to cut down the feedback loop of thinking about a tweak to a graphics hack and seeing what it looks like. i'd also like to add some interactivity.
1:59:25
Xach
https://i.imgur.com/mgXMaMY.png would be fun to make all the "rays" point at the cursor
2:10:05
Bike
those are escape characters. They mean that that all the characters in the name are exactly those characters, and not downcased or anything.
2:36:10
loke
Speaking of lispmemes... Where does this come from? https://www.reddit.com/r/LispMemes/comments/ciw99r/heres_a_better_way_to_macro/
2:37:01
loke
There must be some story to this, because no sane person would write code like that. Ever.
3:33:14
smokeink
(let () (defvar x0 2) x0) ; why does it give a Warning: this undefined variable: X0 ? (when evaling it the 1st time) and this one doesn't?: (progn (defvar x6 2) x6)
3:34:57
pjb
smokeink: The second form could also give a warning when evaluating it the first time. If it doesn't, it may show that you evalulate it in a REPL that uses an optimization for progn forms.
3:35:38
pjb
smokeink: in both cases, defvar doesn't do anything until the form is evaluated: it has no compilation-time effect. Therefore when both forms are compiled, at compilation time, there is no variable known by x0 or x6.
3:36:57
pjb
smokeink: once you evaluate them, the symbol x0 (or x6) is marked as being special, a dynamic binding is established between the symbol and the initial value, and all the code that was compiled using lexical binding of variables named x0 (or x6) are still lexical bindings. So basically, your defvar forms are useless.
3:37:55
pjb
smokeink: in which case, since you have a different environment between the old code already compiled, and the new code, you can get semantic discrepancies, and strange bugs.
3:39:12
pjb
Therefore 1- never use defvar or defparameter other than as toplevel form (note progn keeps it a toplevel form, so what I called optimization above must actually be the specified semantic).
3:41:36
pjb
smokeink: (defvar *x0* 2) (let () *x0*) #| --> 2 |# (progn (defvar *x6* 2) *x6*) #| --> 2 |#
3:43:58
pjb
China releases its own programming language Mulan <https://cntechpost.com/2020/01/17/china-releases-its-own-programming-language-mulan/>
3:48:37
smokeink
if they don't use Chinese characters, I wouldn't call it very Chinese https://img2018.cnblogs.com/i-beta/989505/202001/989505-20200117111140494-1123911009.png
3:48:44
no-defun-allowed
pjb: I cannot find any information on the language other than news, and how is it related to Lisp?
3:50:40
no-defun-allowed
"elastic actor execution model" sounds interesting, but it sounds difficult to put with "C" and embedded devices.
3:53:38
LdBeth
no-defun-allowed: according to some Chinese user, it’s currently like a cut down version of Python
4:03:37
smokeink
pjb: here's some Common Lisp https://paste.ofcode.org/Wnu3ffzKvnwf3ZM3M8cibA in Classical Chinese . the advantage is having short identifiers - if you're used to the logograms -
4:04:45
pjb
smokeink: and the advantage, is that since it's lisp code, ie. lisp data, we can easily write a little function to substitute the chinese ideogram with words using the latin alphabet. :-)
4:07:49
smokeink
you could, but that would be at the end when you want to share the code with others ; during development you can keep it short
5:38:40
HiRE
so I am trying to summarize a bunch of booleans... I figured I could do something like `(reduce #'or '(t t t t nil))` and expect it to be false.
5:42:58
White_Flame
also, if you use REDUCE, it will always traverse the entire list. SOME/EVERY/etc will early exit if the condition is met/breached
5:44:17
no-defun-allowed
You would have to use SOME; and I would advise against using APPLY where you want to REDUCE because some implementations may have small argument limits.
6:26:34
Nilby
And when you're familiar with those, then you can move on to the more vague temporally mutable versions: past-identity possible-position sometime once whenever and whatever.
6:30:20
HiRE
thats on the same level of using #define in C to make your entire program read like a telegraph