freenode/#lisp - IRC Chatlog
Search
15:32:23
hhdave
drunk_foxx[m]: :) I just checked it and it’s working for me now too, so it must have been fixed.
17:24:09
ealfonso`
I'm trying to mock a hunchentoot request to unit-test a handler. I'm using (make-instance 'hunchentoot:request :uri "/my-uri" :headers-in nil :acceptor my-acceptor) . but I'm getting "The variable HUNCHENTOOT:*ACCEPTOR* is unbound" somewhere in this :after method https://github.com/edicl/hunchentoot/blob/755bd3d34b596d3cda2425cc94ef5f7be3249ecf/request.lisp#L185 . I don't know where in the :after method because when I try to see the
17:24:09
ealfonso`
source in slime, I get "Cannot find source location for: #<COMPILED-CODE-LOCATION"... any ideas on how to make the source available?
17:45:29
jasom
It's a keyword, so I was hoping it would be optional. What do I do if the type could be different on different systems?
17:59:47
jasom
fe[nl]ix: okay if reader-macros are the only way, I can do it that way. It's a bit annoying that it can't at least give me an integer of the right size, since sizeof() can do that.
19:16:02
warweasle
I'm looking at tinyScheme as an embedded scripting language but I'd really like to use 1st order logic and rules.
19:18:59
warweasle
Xach: Yes...I have to splice it into my project. Eventually. But since I'm in the C++ code right now, it seems like a good time.
19:20:09
warweasle
Xach: ECL won't work. Or it might but it will take more effort to splice into my project.
19:21:11
warweasle
If you promise not to laugh, I want to use it in Unreal Engine as my scripting and configuration language.
19:31:06
dmiles
warweasle.. for the prolog-like database you out to look at KM interpreter here is some interaction http://www.cs.utexas.edu/users/mfkb/km/km-overview.script
19:33:55
warweasle
This is exactly what I need. I can use it for changing dialog trees and generating procedural gibberish.
19:35:46
warweasle
dmiles: I've never thought about how similar dialog is between modern games and text ones.
19:37:39
dmiles
https://www.cs.nmsu.edu/ALP/2011/03/natural-language-processing-with-prolog-in-the-ibm-watson-system/
19:38:43
dmiles
oh btw i agree with dialog trees and proceedural trees using the same mechanisms as the otehr
19:40:30
pierpa
dmiles: do you use KM? is it maintained and in good shape or an abandoned projects? after a quick browse it looks like a very interesting project (which I didn't know before)
19:40:42
dmiles
the reason i am developing WAM-CL is to make a hybrid MUD server that use DAYDREAMER and KM
19:46:47
warweasle
Then tell it to bootstrap itself into this new language...I'm sure nothing can go wrong.
19:54:36
warweasle
It's simple: YOu move a piece randomly. The other player says you can't do that. You flip the table and declare yourself the winner.
19:54:46
dlowe
if I had perfect recall and read every recorded chess match, I'd be pretty good at chess too
19:55:18
dlowe
it wasn't just that, but knowledge of all those openings made it undefeatable in the early game
19:59:13
dmiles
well in a game like chess we know there is no perfect game or perfect moves.. but you can pretned there is in order to win
20:03:24
dmiles
well warweasle we havbe to talk more soon.. i trying to figure out if you , myself, pierpa and some other people i know are dumb to not be working together
20:08:44
dmiles
ACTION is just trying to create a public opensrc version of the lisp application infrastructure built by cycorp
20:12:07
dmiles
i think i need the structural consistency of a MUD to control a blackboard that looks like what is stored in SNARK in order to encourage myself
20:14:44
dmiles
once this application infrastructure exists, it makes it much easier to write programs that are considered impossible
20:16:49
dmiles
considered impossible / well programs that we created pre-1990s except in non-toy applications
20:18:47
dmiles
the problem in MINSTREL, DAYDREAMER, SWALE was not the egg cracking problem .. it was that we didnt have subsumptive unification over KBs
21:30:31
tarruda
How do I create a defun-like macro so that the argument list is not evaluated when the macro is called?
21:31:11
tarruda
For example, how would I create a "mydefun" macro that would have the exact same syntax as "defun" (except for the "mydefun" part, of course)
21:34:34
tarruda
Bike: so if I call (my-defun (param1 param2) ...), wont lisp try to evaluate (param1 param2) as code?
21:35:19
tarruda
my question is, how I allow the macro caller to define the parameters of the function in a way similar to "defun" (without the lambda-list being executed)
21:40:13
cgay
tarruda: Bike's macro does that. In the REPL you can call (macroexpand-1 '(my-defun (x y) (cons x y))) to see the transformation. Maybe that will help.
21:40:41
pjb
tarruda: how the arguments of a macro are used, depend on their place in the expansion returned by the macro.
21:41:03
pjb
tarruda: if you insert an argument in a position in the expansion where it is not evaluated, then it won't be evaluated, and vice-versa.
21:41:30
pjb
If you put it in a position defining a name for a new binding, then a new binding it will be.
21:42:19
pjb
(defmacro example (thing) `(let ((,thing (quote ,thing))) (,thing ,thing))) (macroexpand ' (example x)) #| --> (let ((x 'x)) (x x)) ; t |#
21:42:45
pjb
then of course, you need a function named x: (defun x (x) (list x x)) (example x) #| --> (x x) |#
21:43:07
TMA
tarruda: the rules are really simple (except for the fine print). first, take the arguments to the macro call unevaluated. then pass them to the macro body. whatever it returns is the new code that shall be evaluated instead of the macro
21:43:20
tarruda
What I'm doing is simple, as an excercise I'm implementing a recursive descent parser
21:43:50
pjb
tarruda: beware that (symbol-name 'foo) #| --> "FOO" |# by default, since the default reader settings are to upcase the symbol names.
21:44:50
pjb
tarruda: (equal (length x) 0) == (zerop (length x)) and assumes that x is bound to a sequence (a list or a vector (including strings)).
21:45:14
pjb
param-list is not in a position to be evaluated in the expansion. So it won't be evaluated.
21:46:07
TMA
tarruda: actually you are repeatedly defining the function |parse-%s|, because FORMAT uses ~s not %s, % is just an ordinary character for FORMAT
21:46:18
pjb
Notably when something is several expressions like in ,@body. In a if you'd need progn : (if test (progn ,@body1) (progn ,@body2))
21:46:49
tarruda
I've edited the paste, to show how I intend to use the macro: https://pastebin.com/E1ML5qp5
21:47:19
tarruda
my goal is to define a `parse-ordinary` function, which automatically has code to detect if input length is 0
21:47:44
dmiles
<pjb> param-list is not in a position to be evaluated in the expansion. So it won't be evaluated.
21:48:00
tarruda
since I'm defining a lot of functions similar to this one, I wanted to abstract this input length check in the macro, not sure if this is the best approach
21:48:47
tarruda
pjb: no, I want the caller of `defrule` to determine the paramters, but it will always have at least one argument: the input string
21:49:31
TMA
tarruda: at present the use is equivalent to: (defun |parse-%s| param-list (if (equal (length input 0) nil (list (substring input 1 nil) (list 'literal (aref input 0))))))
21:50:49
pjb
tarruda: ok, since you want to allow more parameters, it's ok to do it like you did, with (car param-list).
21:51:25
tarruda
yea, my goal is to insert automatic detection of EOF in the input parameter, but allow the rule to have extra parameters
21:51:53
tarruda
pjb, I tried your macro but got this error: `Eager macro-expansion failure: (void-function gensym)`
21:52:40
pjb
Since you want to have at least one parameter in the lambda-list, you could write it like this: https://pastebin.com/WEcSSHU7
21:52:59
pjb
The lambda-lists for defmacro are destructuring lambda-list, so you can make it more sophisticated than for mere functions.
21:54:53
pjb
in emacs lisp you hacve to use destructing-bind explicitely: https://pastebin.com/pE3T8UpJ
21:56:33
pjb
You could use defmacro* in emacs lisp, defmacro* is closer to the Common Lisp defmacro. https://pastebin.com/rV5WXiA1
22:48:35
pierpa
dmiles: I don't need it for what I'm working on now. But it's a useful tool to keep in my toolbox.
22:52:28
pierpa
dmiles: in currently accepted terminology, chess is not a game of chance. Those are games which employs dice or a shuffled deck of cards. Chess is exactly *the opposite* of a game of chance.
23:01:00
zachk
pierpa, in chess, there is a chance your opponent doesn't see the moves you are planning
23:02:02
Bike
that's not even hidden information. not knowing what your opponent is going to do is just what a game is
23:24:22
makomo
oh, am i supposed to just use the class stream-usocket as a stream and just write to it as i would write to any stream?
23:27:07
makomo
never mind, usocket:stream-usocket is a socket, while usocket:socket-stream is the accessor for the underlying stream :-)
1:34:33
dmiles
i was indeed using chance loosely.. What I was trying to do is distinguish chess from a game of perfect information
1:39:39
dmiles
yet most all chess solvers i know about are designed to work based on "perfect information" which is never possibly going to happen
1:40:20
dmiles
in fact with all chess gambits if your opponent was playing with the same perfect information they cant win
1:40:53
dmiles
i mean the gambit will fail if your opponent actually was making all the perfect counter moves
1:42:58
dmiles
the best case is that your moves have create a multiplex of gambits that at leat one is not detected by your opponent
1:44:48
dmiles
not that this makes it a game of chance but you cannot know which gambits your opponent will miss
1:48:34
ebrasca
dmiles: I think you can find some steps with 100% win rate. I don't know if for white or black.
1:51:23
dmiles
if you, ebrasca, are correct then indeed there can be a perfect, non-chanchy, game of chess played
1:56:16
dmiles
also i was wrong about not being perfect information.. it is.. but its a game of incomplete information instead
2:40:20
Josh_2
https://pastebin.com/Ay4Utu8x can someone help me with this macro, I understand why it is saying it is an unknown block but I don't know how to fix it
2:46:08
Josh_2
however if I have return from block pop nil will the end result of the function be nil?
2:51:38
pierpa
if you macroexpand your original macro you see that there's no block named pop-data in the expansion
2:52:43
Josh_2
THanks for the help, you think I need to gensym the symbol names? I am actually trying to pass in global variable names intentionally
3:03:06
z3t0
Hi, I am trying to learn about programming languages that are fundamentally different from others
3:03:17
z3t0
So far I have spent some time hacking in common lisp and now am taking a look at smalltalk
3:03:47
z3t0
One of the main features of smalltalk is that everything is accessible and reflective as it is based on a live image
3:04:18
z3t0
I have noticed pretty much the same idea in common lisp, or is there something different about how one of these functions in terms of everything being at your fingertips at all times?