freenode/#lisp - IRC Chatlog
Search
13:05:11
beach
Define well defined protocols, and write a test suite for the implementation of each one.
13:06:53
beach
Here, a "protocol" is a collection of (usually generic) functions and types (usually standard classes).
13:07:25
LdBeth
Nah, I just recalled call-by-reference in FORTRAN is now more commonly referred as out parameter
13:08:23
beach
ebrasca: I used "protocol" to mean what it means in the CLOS literature. Not as a wire protocol.
13:12:02
minion
ebrasca: please look at AMOP: AMOP: The Art of the Metaobject Protocol, an essential book for understanding the implementation of CLOS and advanced OO. See <http://metamodular.com/CLOS-MOP>
13:14:37
beach
If you look at the appendix of metamodular.com/SICL/environments.pdf you have a small example of a protocol.
13:17:46
beach
ebrasca: If you don't understand the concept of an interface or a protocol, you may end up writing some very messy software. I suggest you try to read up.
13:20:39
Josh_2
perhaps I should use this weekend to get started, you have made me worried now beach ʕ·͡ᴥ·ʔ
13:25:01
beach
risto: There is no obvious correlation between something being good and it being popular.
13:26:07
risto
I wanted to convert the :use to instead explicitly import everything using :import-from
13:26:41
beach
risto: I strongly recommend you not import from other packages (other than the COMMON-LISP package), and instead use explicit package prefixes. Your code will be much clearer, and it becomes much easier to refactor later.
13:27:44
LdBeth
And beach usually go against :use any package other than COMMON-LISP for the same reason
13:33:12
LdBeth
ebrasca: it’s more interesting that you can plug your custom type system/object system into CLOS
13:35:20
beach
ebrasca: Here is a very simple protocol for you: STACK [class]. PUSH object stack [generic function], POP stack [generic function], EMPTY-P stack [generic-function], TOP stack [generic function].
13:35:43
beach
ebrasca: Together with documentation about the return values and side effects of the generic functions, and the initargs of the class.
13:37:30
beach
ebrasca: Once you have that, and an implementation of it, you can then write a test suite making sure that your implementation does what your documentation says it should do.
13:38:22
beach
ebrasca: Like, the documentation should say that EMPTY-P returning false is a precondition for using POP and TOP.
13:45:40
beach
ebrasca: I don't understand your question. The person who defined this protocol will describe in the documentation what was intended. I suggest you structure your code the same way so that you have fewer bugs, and the ones you have are easier to find.
13:47:23
beach
ebrasca: Then, the author will make a test suite that checks that a newly created stack is empty, that if 234 is pushed, then the result is not the empty stack, and that if then TOP is called, it returns 234. Etc, etc. etc.
13:49:28
beach
ebrasca: What code are you planning to write that prompted you to ask how to make fewer bugs and easier to find ones?
13:50:19
ebrasca
beach: There is someting not ok with tcp in mezzano. I don't know if it is my mistake or not.
13:52:02
beach
ebrasca: But I am obviously not expressing myself very well, so I think I will be quiet for the time being.
13:52:15
LdBeth
ebrasca: in this case I recommend you do a version control and make regression test on every changes you’ve made to the original copy of code
13:59:50
risto
I still can't get the sexp.lisp example working without :use :esrap, I'm not sure what I'm doing wrong:
14:03:40
beach
risto: For that error, you need to consult the documentation for ESRAP, or ask scymtym or someone else who knows about DEFRULE.
14:09:29
beach
risto: It looks like it takes &bounds to be just another symbol, so then the lambda list has 4 required parameters.
14:11:19
beach
risto: Again, I am guessing, but COMMON-LISP:SECOND has a single (required) parameter, so it probably expects your lambda list to also have a single required parameter, as the error message suggests.
16:04:58
puchacz
hi, what's the recommended mathematical library please? I need linear regression, linear regression through origin, exponential regression, fixed power law regression etc.
16:39:27
francogrex
Hi, does anyone know if there is an android abcl lisp project? I am trying to tinker with it, the dexed class files run on dalvikvm... but that's just it
16:54:39
saturn2
all i've heard of is https://common-lisp.net/project/ecl/posts/Lisp-ECL-and-QML-Qt5-on-Android.html and of course mocl
17:04:27
francogrex
well, i've managed to run it on the command line as dalvikvm -Xmx256m -cp abcl.dex:abcl org.armedbear.lisp.Main where abcl.dex contains the dexed files and the abcl folder the .lisp files.
17:05:19
francogrex
I am running the ansi tests on it, but so far I know that it doesn't load compiled files (although it does compile functions and files)
17:09:07
francogrex
pjb: are I can try to tweek it to compile to android. it seems to work fine as interpreter only
17:09:40
pjb
francogrex: you will have to write an abcl compiler backend to generate dex instead of jvm.
17:13:15
francogrex
but pjb, ecl for android (unless running inside a arm image) is also only interpreted -- or is it only bytecode compile?
17:14:03
pjb
francogrex: bytecode compile, since it uses its own VM. I don't know if you can also install gcc to use it as ecl backend. I would think it should be possible, despite the restrictions in Android.
17:14:09
jackdaniel
regarding modules in ecl, you may build them if you have C compiler available on the android host. moreover you may crosscompile module beforehand
17:16:53
jackdaniel
cross compiling works but not as smooth as we'd like, something what requires some polishing
17:17:21
jackdaniel
(i.e host compiler must have same common compile-time configuration settings as the target
17:31:13
puchacz
actually it is probably not related, as abcl problem is about incompatible class hierarchies for what I remember, not different vm
17:31:32
jackdaniel
java is a language, dalvik is a virtual machine. it would be more appropriate to compare it to jvm
17:35:27
puchacz
yes, but it cannot "deliver" compiled opcodes into a file that can be loaded by another ABCL
17:36:37
puchacz
I always loaded programs from sources, it keeps cached compiled files, but you cannot collect them into a package and "deliver"
17:38:29
puchacz
yes, but it cannot "deliver" compiled opcodes into a file that can be loaded by another ABCL
17:38:44
puchacz
I always loaded programs from sources, it keeps cached compiled files, but you cannot collect them into a package and "deliver"
17:50:58
scottj
How would I load the clx composite extension? I think the rest of clx was loaded because it's in the :depends-on of stumpwm.asd.
17:51:59
jackdaniel
if it exists but doesn't have system of its own and file with this extension is not loaded by clx system, then only (load (compile-file "extension.lisp"))
17:54:29
scottj
jackdaniel: I'm not very familiar with asdf, does this provide any clues? https://github.com/sharplispers/clx/blob/master/clx.asd#L87
17:56:47
jackdaniel
so if it implements said extension you should have it available if your system depends on clx
17:59:24
scottj
My bad, it was loaded, I was looking for a package like xlib/composite since the gl extension has xlib/gl but composite's in the xlib package itself.
18:39:29
puchacz
can I do the same for output? for example, when I evaluate (log 7), I get 1.9459101F0
18:40:16
puchacz
I know I can evaluate (log 7.0) to get double float, but I would like to get it from integer as well
18:41:28
Bike
and in CL all irrational mathematical functions are defined to return either rationals or single floats if given rationals
18:42:46
puchacz
I guess I need to make sure I don't use integers or rationals as inputs because I want double floats on output of all mathematical functions
18:44:11
jackdaniel
if you ensure that all inputs are double floats declaring them so may boost your performance
18:52:41
puchacz
I am writing a single argument function for that so it is easily composable in mapcar and the likes
19:02:22
jackdaniel
don't forget to make it a method, so others may specilize to do the right thing™
19:38:56
minion
The URL https://gitlab.common-lisp.net/users/sign_in?secret=b90223d1 will be valid until 19:45 UTC.
20:25:13
MrMc
edgar-rft:I have created a library binding for the bladeRF SDR and would like to demodulate FM signals
20:46:10
Kundry_Wag
Hi. Is there any lisp (or known programming language from other family) that uses normal-order evaluation? Just curious.
20:46:48
edgar-rft
MrMc: Real-time DSP is done rather seldom in Common Lisp. Soundcard audio output is manageable, but do you want the demodulation in Common Lisp or can you use the DSP hardware on the bladeRF fo that?
20:52:33
edgar-rft
Kundry_Wag: with Common Lisp macros you can implement any evaluation model you want.
20:54:59
Kundry_Wag
edgar-rft: Yeah, sure. I was just wondering if normal-order by default would be so impractical (mainly because of evaluation side effects more than once) that it's not present in any mainstream programming language
22:57:00
no-defun-allowed
then lazy racket might be less of a headache and also still off-topic but less so by an arbitrary measure
23:10:47
LdBeth
Which proper strict analysis (i.e. converting as much as possible to applicative order) the performance can be quite impressive
0:17:34
Kundry_Wag
no-defun-allowed: Lazy evaluation is not equal to normal-order evaluation. See https://sookocheff.com/post/fp/evaluating-lambda-expressions/