Search
Saturday, 9th of June 2018, 18:09:04 UTC
18:11:56
random9899
http://dpaste.com/0XVKK6D
18:12:09
random9899
now all the lift-test.lisp tests pass too
18:13:58
random9899
with the lift-standard.config http://dpaste.com/3TZA0YC
18:16:13
random9899
the interactive failure thing was annoying, throwing you into the debugger and stuff....
21:26:11
Inline
the test-creating-multiple-tests testsuite in lift gives me once 4 or 3 or 2 as an answer to a 3 tests grouped by 2 case
21:46:45
Inline
compiling the lift-test system gives consistent results tho, so something is in the vulnerable ephemeral state somewhere
21:47:13
Inline
cause testing it right after i load all of my packages and my repl tends to give wrong answers
21:48:15
Inline
always recompile test frameworks before doing testing
23:44:18
asarch
Two questions: https://pastebin.com/NeBZKbKF
23:45:01
asarch
2) How could you specify which 'get-sugar' (either from 'chocolate' or from 'cafe') you want in 'serving-drink'?
23:45:44
asarch
From the question #1 I get: 3: (ERROR "Illegal function call in method body:~% ~S" ((FORMAT T "The level of sugar is: ~d~%" (GET-SUGAR CUP))))
23:46:04
on_ion
i think 'dinner' is the varname isnt it?
23:46:38
on_ion
although i would say, the slot 'sugar' would be part of something that the chocolate and the cafe would share
23:46:51
on_ion
like (defclass sugar-water (water) ((sugar...))
23:47:11
Bike
you have serving-drink with a defgeneric with one parameters, and then the method has two parameters.
23:47:19
Bike
maybe you meant ((cup dinner))?
23:47:34
Bike
":accessor set-sugar" is probably not what you want
23:47:41
asarch
ACTION checks his notes...
23:47:49
Bike
since accessor defines a reader /and/ a writer
23:48:29
Bike
defining a writer that isn't a setf function is stylistically wrong, as wlel
23:48:36
asarch
Bingo! Problem #1 fixed! You were right Bike, it was ((cup dinner))
23:49:04
Bike
as for "how could you specify" i think you're confused
23:49:16
Bike
which methid is called naturally depends on the argument dispatch
23:49:28
Bike
cup is a dinner, so it calls the GET-SUGAR for dinner
23:49:38
Bike
which, per precedence rules, would be the one for CHOCOLATE since it's the leftmost superclass
23:50:00
Bike
but having two different slots as you do is kind of bad
23:50:16
Bike
you should just specify the sugar slot in a parent class, and then specify initforms in the lower class if you'd like
23:50:36
asarch
It is a simple example for my annotations
23:50:59
Bike
your example ought to match actual practice, no?
23:51:00
asarch
You know, I C++ I could cafe::sugar or chocolate::sugar
23:51:47
Bike
all methods are only dealt with virtually, if you like
23:51:52
asarch
I just was wondering if there was such a way to do the same in Lisp
23:52:13
Bike
why do you want to do that?
23:52:21
asarch
There is no way to access super-class method?
23:52:35
Bike
you can access other methods on the same function if you like
23:52:39
specbot
http://www.lispworks.com/reference/HyperSpec/Body/f_call_n.htm
23:53:28
Bike
and probably a general tutorial of some kind
23:54:26
asarch
In my example, because of the class precedence list 'serving-drink' uses 'sugar' from 'chocolate'
23:54:54
Bike
There's another quirk here because of your multiple slot definition.
23:54:58
asarch
How would you "manually" use 'sugar' from 'cafe'?
23:55:10
Bike
As I said, you probably don't want to do that. You can't have two distinct slots with the same name in the same object.
23:55:24
Bike
So your question isn't really valid.
23:55:48
asarch
How would you "manually" use 'sugar' from 'cafe'?
23:55:55
Bike
You can't. There isn't one!
23:56:03
Bike
Your dinner class has ONE slot called "sugar".
23:56:33
Bike
Why would you expect to be able to have distinct slots with the same name?
23:56:41
asarch
I thought it was like other programming languages
23:56:45
Bike
that would be so confusing.
23:57:27
asarch
Why? Most programming languages let you do this
23:57:44
asarch
Even PHP which it doesn't support multiple inheritance
23:58:07
Bike
As I said, if you must you can think of everything about classes as being what C++ terms "virtual".
23:58:10
Bike
It's looked up at runtime.
23:59:09
specbot
Inheritance of Slots and Slot Options: http://www.lispworks.com/reference/HyperSpec/Body/07_ec.htm
23:59:51
asarch
So, if I do: (defparameter *my-cup* (make-instance 'dinner)) and then (serving-drink *my-cup*), 'sugar' from 'cafe' doesn't exist, right?
0:00:13
Bike
yes. your dinner will have only one slot called SUGAR.
0:00:35
Bike
The defclass merges the slot definition information from the 'cafe' and 'chocolate' classes.
0:01:54
asarch
In (defclass dinner (chocolate cafe) ()), I thought the 'sugar' slot was from the last element from the class precedence list
0:02:09
asarch
In this case, 'cafe'
0:02:17
asarch
But it seems it is the opposite
0:02:18
Bike
The page I just linked explains what dinner's slot will be like.
0:02:29
Bike
yes, it's left to right.
0:02:36
Bike
though if you want to get a little hardcore you can customize it.
0:03:16
Bike
The two slot definitions only differ in their initform and docstring. According to the page I just linked, dinner's slot will have these from the most specific superclass, i.e. CHOCOLATE.
0:04:51
asarch
ACTION takes notes...
0:06:01
asarch
This was an easy example to know how Lisp handles the diamond-inheritance problem
0:07:24
Bike
and as i mentioned you can customize this behavior if you want to deal with mop stuff.
0:07:51
Bike
you might even be able to arrange a metaclass where child classes just get the unaltered class from their supers
0:08:10
Bike
and then you access them with some special slot-value where you include a class designator in addition to the slot name
0:09:24
asarch
Can you give me an example?
0:09:51
asarch
In this case, 'sugar' from 'cafe'
0:10:45
Bike
An example of this custom metaclass?
0:10:59
asarch
Yeah, using this small example
0:11:15
Bike
it would be kind of lengthy to do.
0:12:05
asarch
Is 'defclass' part of MOP?
0:12:34
Bike
no, it's part of the standard. MOP defines most of the stuff behind how it works.
0:13:17
asarch
Reading about CLOS and all related stuff, I found the CLOS version of Racket is Swindle
0:13:33
Bike
i know nothing concerning that topic.
0:14:59
msmith
hi all, can someone remind me of the command that would allow me to destructure a list and use it as parameters in a function?
0:15:02
asarch
Anyway, thank you very much once again
0:15:31
Bike
msmith: maybe you are thinking of apply
0:17:43
msmith
Bike: yes that's it thanks
0:17:49
asarch
So far I found three "glitches" in Lisp: 1) You can't read the value of "ARGS" in a binary file (for passing values) 2) There is no standard way to access to the value of :documentation from defclass 3) And this :-P
0:18:23
Bike
lisp's object system is more like smalltalk than C++. that's hardly a glitch.
0:19:00
Bike
and you can do (documentation (find-class name) t)
0:20:03
Bike
and i have no idea what you mean with the first thing
0:21:45
asarch
Well, you write an small application in Lisp to start a web server and then you need to specify the port number manually: my-lisp-server --port 8080
0:22:14
Bike
you can parse command line arguments, if that's what you mean
0:23:12
Bike
it's nothing i do very often, but there are some libraries, like http://quickdocs.org/command-line-arguments/
0:29:45
White_Flame
of course, each implementation also exposes a simple list of strings representing C's argv
0:30:07
White_Flame
libraries build on top of those
0:44:35
asarch
Thank you White_Flame
0:44:39
asarch
Thank you very much :-)
3:27:21
drmeister
How does one handle a condition in a handler-bind handler?
3:28:47
drmeister
Is there some special return value that the handler returns to indicate that it does or doesn't handle the condition?
3:29:14
drmeister
"If the handler declines, the search continues for another handler."
3:29:17
drmeister
clhs handler-bind
3:29:18
specbot
http://www.lispworks.com/reference/HyperSpec/Body/m_handle.htm
3:29:27
drmeister
How does it decline?
3:30:50
energizer
** NICK energizer_
3:34:09
energizer_
** NICK energizer
3:56:05
akkad
ACTION looks for a swagger parser in cl
4:19:37
beach
Good morning everyone!
4:19:46
beach
drmeister: A handler declines by returning normally.
4:21:49
specbot
Condition System Concepts: http://www.lispworks.com/reference/HyperSpec/Body/09_a.htm
4:48:45
beach
MichaelRaskin: I think you are right. I need more than one `next' PC value when there is a branch in the code. But I can do that. I just have the table contain either a singleton address or a list of addresses.
5:43:50
pillton
aeth: I have only just now read your suggestion to specialization-store.
5:45:11
pillton
aeth: Sorry about that. I will have to think about it.
Sunday, 10th of June 2018, 6:09:04 UTC