<Regenaxer>
Pilog 'or' unifies variables like everywhere else
razzy has quit [Ping timeout: 265 seconds]
<beneroth>
Good morning Regenaxer :)
<beneroth>
I did something like (pilog @Param Param @List List (select (@Goal) ((index Entity @Param)) (member @A @List) (or ((same @A @Goal a)) ((not (bool T @Goal a))) Prg)
<beneroth>
in the Prg, I didn't had @A present
<Regenaxer>
Yes, this is the Prolog way
<Regenaxer>
@A gets unified
<Regenaxer>
by member
<Regenaxer>
oh, you are still 'bool'ing ;)
<Regenaxer>
I feel uneasy with that
<beneroth>
hehe yeah
<Regenaxer>
as there is no false proving
<beneroth>
well I wanted "property a must be member of List or NIL"
<Regenaxer>
I would resort to Lisp in such cases
<beneroth>
ok
<Regenaxer>
but if it works, all right! :)
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
hunar has joined #picolisp
razzy has joined #picolisp
<hunar>
Hi everyone :D Is there an easier way than this (maxi max (mapcar fitness A)) or (fitness (maxi fitness A)) to get the maximum returned value when applying the function fitness to the elements of A
<Regenaxer>
Hi hunar!
<Regenaxer>
It should be in the secondary return value '@@'
<Regenaxer>
(doc 'maxi)
<hunar>
Ooooo, I read the doc multiple times but didn't read the last part
<Regenaxer>
:)
<hunar>
Cool :) another simple question, you don't like the CL naming syntax that uses - like get-circle-area
<hunar>
?
<Regenaxer>
It is not a problem for me
<Regenaxer>
Just useless in case of pil
<Regenaxer>
It is in CL because it is all uppercase
<Regenaxer>
so you can't use camelCase
<hunar>
c++ has cases but uses this_syntax .. I don't have problem with any of them though
<Regenaxer>
C (and C++) traditionally avoid upper case
<Regenaxer>
I think this is also due to its ancient origins
<hunar>
I personally read the-separated-words a little faster thanThis
<Regenaxer>
At the time C was developed camelcase was not yet invented
<Regenaxer>
ok
<hunar>
Aha that's the reason then
<Regenaxer>
I believe so
<Regenaxer>
So get-circle-area is fine
<hunar>
:D
<hunar>
Last question :) Is it (easily) possible to use javascript libraries? there is an excellent library called p5.js which I can't complement enough, It makes canvas drawing very easy and powerful
alexshendi has quit [Read error: Connection reset by peer]
<Regenaxer>
Sorry, telephone
hunar has quit [Quit: Ping timeout (120 seconds)]
hunar has joined #picolisp
<beneroth>
hunar, I also found separated words easier to read. I usually go with foo-bar for functions and FooBar/+FooBar for variables and classes
<hunar>
:D
cranium has joined #picolisp
<beneroth>
just stick with the picolisp naming convention, they make live easier and errors less likely.
<hunar>
Right, since all everyone uses it, I can't really do anything about it
<beneroth>
you can certainly, just not so wise maybe :)
<beneroth>
see also (lint) and (lintAll), I use them to rarely, but they can spot some mistakes easily, primarily by checking naming conventions
<hunar>
How can I use (lint)
<hunar>
I just ran lintAll on a file and it returned a function call
<hunar>
-> (("test.l" (def gen pow fitness function) (bnd mutation recombination termination mutate combine F fitness Population Y X))) It refers to function gen from lib/simul.l
<beneroth>
so your test.l has no (load "@lib/simul.") in it
<hunar>
It has
<Regenaxer>
I use lintAll usuall just on all loaded stuff
<Regenaxer>
: (lintAll)
<Regenaxer>
(lintAll "file.l") is intended for files like in the gui
<Regenaxer>
loaded on the fly
hunar has quit [Ping timeout: 256 seconds]
hunar has joined #picolisp
<hunar>
I think now I understand how lint is used :)
<hunar>
I was trying to learn the genetic algorithm within simul.l I wrote it for my future self that forgets the usage https://pastebin.com/Mck2zD5Z hence it's very sparse
<hunar>
The link above has an error at line 20, just ignore F @@
<Regenaxer>
Cool hunar! You are a very fluent Pil programmer already
<hunar29>
Yes :) I use it alot, I cant live without it :/
hunar29 is now known as Hunar
alexshe96 has quit [Quit: -a- Connection Timed Out]
<Hunar>
I haven't experimented too much with gui in Pil yet so I'm hoping someone tries it for me :) I constructed the simplest example download this file https://github.com/processing/p5.js/releases/download/v1.4.0/p5.js and put it somewhere, at the same location make an html file with these contents, then open the html file and a red canvas
<Hunar>
should be visible
<Hunar>
<!DOCTYPE html>
<Hunar>
<html lang="en">
<Hunar>
<head>
<Hunar>
<script src="p5.js"></script>
<Hunar>
<meta charset="utf-8" />
<Hunar>
</head>
<Hunar>
<body>
<Hunar>
<script>
<Hunar>
function setup() {
<Hunar>
createCanvas(400, 400);
<Hunar>
}
<Hunar>
function draw() {
<Hunar>
background(225,0,0);
<Hunar>
}
<Hunar>
</script>
<Hunar>
</body>
<Hunar>
How can I translate this to Pil, putting p5.js in the same folder as the picolisp file, then ....
<beneroth>
sorry, I've gotta go. see @lib/xhtml.l for the html dsl, e.g. (<html> '(lang . en) (<head> (<script> ....)]
<beneroth>
bbl
alexshendi has joined #picolisp
<Regenaxer>
Yes, @lib/xhtml.l and @lib/canvas.l
<Regenaxer>
I look up an example a little later
<Hunar>
Great :D It'll be cool to do something like (for A 10 (js "circle" A A 10)) to make 10 circles
<Hunar>
I might work on the in the future because I currently don't know how to start :/ .. one small question, p5js creates its own canvas, so doesn't use @lib/canvas.l is that a problem?
<Hunar>
work on this*
<Regenaxer>
What is its "own" canvas?
<Regenaxer>
Not a browser <canvas> element?
<Regenaxer>
@lib/canvas.l only defines some glue functions
<Regenaxer>
sends commands to JS in the browser
<Hunar>
I don't know too much about web, I mean in those examples the pil code creates the canvas while in p5js the function createCanvas(); is creating it, can they talk to each other?
razzy has quit [Ping timeout: 265 seconds]
razzy has joined #picolisp
<Hunar>
I'll dig into it until Saturday to see what I can achieve :)
<alexshendi>
Is there a (virtual) picolisp meetup in the nwar future?
alexshendi has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
alexshe32 has joined #picolisp
alexshendi has quit [Remote host closed the connection]
<alexshe32>
So the next one is on the 20th, 1600UTC
<alexshe32>
?
alexshe32 is now known as alexshendi
<Regenaxer>
Yes alexshendi, exactly ,)
<Regenaxer>
so 18:00 central european time
<alexshendi>
That's a Monday? Wasn't it supposed to be on a Saturday?
<Regenaxer>
yes, Monday
<Regenaxer>
this was the purpose of the 10/20 rule
<Regenaxer>
to have different weekday
<alexshendi>
OK, I'll probably show up .
<Regenaxer>
cause there was always somebody who could not attend on certain days
<Regenaxer>
That would be cool! :)
alexshe55 has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
<Regenaxer>
hunar, I think you don't need to call the <canvas> function in @lib/canvas.l
<Regenaxer>
But it expects that the application code defines 'drawCanvas'. It is a callback.
<Regenaxer>
You remember the chess program in PilBox and as a stand-alone version? It is all based on @lib/canvas.l and thus @lib/canvas.js
alexshe55 has quit [Ping timeout: 268 seconds]
razzy has quit [Ping timeout: 268 seconds]
<Hunar>
I don't know what to say :/ I have to check a lot of code to understand and use your helps.. I need to learn three things: 1. load a .js file using Pil 2. create a function that p5js can call (it calls setup once and draw every frame) 3. call javascript functions