Subscribe

2010-07-06 Thread Edwin Eyan Moragas
Hello Edwin Eyan Moragas haa...@gmail.com :-)
You are now subscribed



-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: solicting user stories of picolisp

2010-07-19 Thread Edwin Eyan Moragas
On Mon, Jul 19, 2010 at 10:39 PM, Mateusz Jan Przybylski
dexen.devr...@gmail.com wrote:
 However, a (quick'n'dirty) HTML  HTTP application in PicoLisp got me a v=
ery
 good grade for `Programming languages  paradigms' course at Uni.

 The lecturer never heard of Lisp before; after listening to my explanatio=
ns he
 wrapped it up with:
 =A0``So this Lisp is a newfangled language, quite like Ruby, right?''
 Geez...

i really hope you were kidding.



 --
 Mateusz Jan Przybylski


 ``One can't proceed from the informal to the formal by formal means.''
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Unsubscribe

2010-07-24 Thread Edwin Eyan Moragas
Good bye Edwin Eyan Moragas haa...@gmail.com :-(
You are now unsubscribed



-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Subscribe

2010-07-24 Thread Edwin Eyan Moragas
Hello Edwin Eyan Moragas e...@yndy.org :-)
You are now subscribed



-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


warning while compiling picolisp

2010-07-25 Thread Edwin Eyan Moragas
Hi all,

compiling picoLisp-3.0.3 on openbsd 4.6 gives some warnings. the
others i am familiar with but this one is beyond my C programming foo
at the moment:

flow.c: In function `doCatch':
flow.c:1351: warning: argument `x' might be clobbered by `longjmp' or `vfork'

i'm willing to test patches if anybody has a solution to this.
otherwise, i'll just have to dig deeper.

thank you.

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: warning while compiling picolisp

2010-07-25 Thread Edwin Eyan Moragas
On Mon, Jul 26, 2010 at 12:59 AM, dexen deVries dexen.devr...@gmail.com wrote:
 On Sunday 25 of July 2010 17:41:11 you wrote:
 compiling picoLisp-3.0.3 on openbsd 4.6 gives some warnings. the
 others i am familiar with but this one is beyond my C programming foo
 at the moment:

 flow.c: In function `doCatch':
 flow.c:1351: warning: argument `x' might be clobbered by `longjmp' or
 `vfork'

 Not a patch, but this is what i've found:

 http://www.technovelty.org/code/c/cdecl.html

thank you. learn something... old.. every day. :)

 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: PL vs. BSD License

2010-08-02 Thread Edwin Eyan Moragas
Hi Alex, all,

On Mon, Aug 2, 2010 at 2:29 PM, Alexander Burger a...@software-lab.de wrote:
 Hi all,

 as this discussion popped up recently and in the past, and will surely
 pop up in the future: What do you think if PicoLisp were released under
 the BSD license instead of GPL?

i go for BSD.


 My reason for asking this is simple: On several occasions I experienced
 that the acceptance of PicoLisp is limited by the GPL. Companies are
 reluctant to use it because they are afraid of being forced to publish
 their little secrets. Their fear is sometimes rational and sometimes
 not, but the effects are the same. For me it is critical, as my economic
 survival depends on it.

the way i understand it (from reading all of the pros and cons posts
of GPL vs BSD over the net for quite some time) is that the GPL forces
you to publish changes when you want to distribute the code outside of
the company. the most clear statement i have read somewhere tells me
the GPL is a distribution license. i think that captures the spirit
of the GPL. or most of it.


 Ideologically, I prefer the GPL. It guarantees that freedom
 propagates. But it does this by cutting down on freedom, so it is
 schizophrenic. I used to compare the situation with freedom in a
 society: A society should not give an individual member so much freedom
 that he can make himself a dictator and thus destroy freedom. But this
 comparison is wrong. Using free software in a non-free project doesn't
 decrease its freedom; it just doesn't increase it the way the GPL tries
 to enforce. So is this just much ado about nothing?

this is a complex issue and i am not an expert. my additional
arguments would be:

1) the BSD license does not force one to publish changes. good for
companies. the GPL does not enforce this too *unless* you distribute
your changes to pre-existing GPL code.

2) the BSD license still ensures that the code remains free. the GPL
does not guarantee that changes in the pre-existing code will be made
publicly available (see point 1).

3) the GPL is complex. so many ifs. i'm not keen on using complex things.

best regards,

eyan

PS:
hat tip to Alex for PicoLisp and bringing this issue up in the list.
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: PL vs. BSD License

2010-08-02 Thread Edwin Eyan Moragas
Hi Dan, all,

On Mon, Aug 2, 2010 at 7:24 PM, Daniel Elliott danelliotts...@gmail.com w=
rote:
 Hello.

 Does the GPL affect code that I write that runs on PicoLisp, or just
 changes to the PicoLisp interpreter?

picoLisp is made up of 1) the interpreter and 2) libraries and support
files that come with the distribution, ie the *.l files.


 If only changes to the interpreter are affected, than GPL is the way
 to go as far as I am concerned.

if the interpreter were GPL and the support files were BSD, then your
code would not be affected. with this i am sure.

however, if you use any of the .l files (which is GPL), is your code
also forced to be GPL? i don't know.


 However, I should add that many large companies (at least in the US)
 are irrationally terrified of anything GPL. =A0It is very annoying.

 - dan

 On Mon, Aug 2, 2010 at 3:50 AM, Mansur Mamkin mmam...@mail.ru wrote:
 Hi all,

 Hi all,

 as this discussion popped up recently and in the past, and will surely
 pop up in the future: What do you think if PicoLisp were released unde=
r
 the BSD license instead of GPL?


 Why not? It would be great to see PicoLisp under BDS license

 Oops, sorry, I mean BSD

 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


documentation license?

2010-08-09 Thread Edwin Eyan Moragas
Hi Alex,

what's the license of the documentation that comes with picoLisp?

best,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


first swing at running local wiki

2010-08-09 Thread Edwin Eyan Moragas
Hi all,

built picoLisp, fetched the wiki, untarred it, then followed the
instructions here:
http://www.mail-archive.com/picolisp@software-lab.de/msg01556.html

in summary it went like:

$ cd ~/picoLisp
$ mkdir -p db/wiki
$ ./dbg wiki/main.l lib/too.l -main wiki/init.l -go

opened the browser to: http://host:5000 and i got this output on the terminal:

e...@obsddev $ ./dbg wiki/main.l lib/too.l -main wiki/init.l -go
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'Nil'
/bin/picolisp:lib/ht: undefined symbol 'prin'
/bin/picolisp:lib/ht: undefined symbol 'prin'
/bin/picolisp:lib/ht: undefined symbol 'bufSize'
/bin/picolisp:lib/ht: undefined symbol 'bufSize'
/bin/picolisp:lib/ht: undefined symbol 'bufString'
/bin/picolisp:lib/ht: undefined symbol 'bufString'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'Env'
/bin/picolisp:lib/ht: undefined symbol 'outString'
/bin/picolisp:lib/ht: undefined symbol 'outString'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'evList'
/bin/picolisp:lib/ht: undefined symbol 'name'
/bin/picolisp:lib/ht: undefined symbol 'Intern'
/bin/picolisp:lib/ht: undefined symbol 'ihash'
/bin/picolisp:lib/ht: undefined symbol 'hashed'
/bin/picolisp:lib/ht: undefined symbol 'begString'
/bin/picolisp:lib/ht: undefined symbol 'begString'
/bin/picolisp:lib/ht: undefined symbol 'endString'
/bin/picolisp:lib/ht: undefined symbol 'endString'
/bin/picolisp:lib/ht: undefined symbol 'firstByte'
/bin/picolisp:lib/ht: undefined symbol 'firstByte'
/bin/picolisp:lib/ht: undefined symbol 'firstByte'
/bin/picolisp:lib/ht: undefined symbol 'firstByte'
/bin/picolisp:lib/ht: undefined symbol 'firstByte'
/bin/picolisp:lib/ht: undefined symbol 'firstByte'
/bin/picolisp:lib/ht: undefined symbol 'outName'
/bin/picolisp:lib/ht: undefined symbol 'outName'
/bin/picolisp:lib/ht: undefined symbol 'mkChar'
/bin/picolisp:lib/ht: undefined symbol 'mkChar'
/bin/picolisp:lib/ht: undefined symbol 'mkChar'
/bin/picolisp:lib/ht: undefined symbol 'evCnt'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'Chr'
/bin/picolisp:lib/ht: undefined symbol 'getChar'
/bin/picolisp:lib/ht: undefined symbol 'getChar'
/bin/picolisp:lib/ht: undefined symbol 'cons'

Re: documentation license?

2010-08-10 Thread Edwin Eyan Moragas
Hi Alex,

On Tue, Aug 10, 2010 at 2:09 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 what's the license of the documentation that comes with picoLisp?

 I assumed that it is also under the GPL until now, as the GPL is the
 only license included in the distribution.

 As we are currently discussing the license issue, what would be your
 proposal for the documentation? Is a separate license preferable?

no proposal from here. :) just asking. it's more of a mental
preparation for future projects.


 I think the documentation is tightly coupled and in sync with the code,
 so I felt that it should be under the same license as the code.

thank you.


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: first swing at running local wiki

2010-08-10 Thread Edwin Eyan Moragas
Hi Alex,


On Tue, Aug 10, 2010 at 2:23 PM, Alexander Burger a...@software-lab.de wrote:

 I didn't test under OpenBSD since last year. Something's wrong with the
 link flags (PICOLISP-FLAGS or DYNAMIC-LIB-FLAGS) in src/Makefile?
will check.

thank you

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: first swing at running local wiki

2010-08-10 Thread Edwin Eyan Moragas
Hi Alex,


On Tue, Aug 10, 2010 at 2:39 PM, Edwin Eyan Moragas e...@yndy.org wrote:
 I didn't test under OpenBSD since last year. Something's wrong with the
 link flags (PICOLISP-FLAGS or DYNAMIC-LIB-FLAGS) in src/Makefile?
 will check.

 thank you

no problems with the link flags as far as i can tell. it compiles cleanly.

diverging a bit. what's picolisp's protocol of loading shared libs?

i'm asking to just save effort. i can trace it in the code but... you
know the drill. :)

the errors i posted earlier comes *after* i stop the browser from
waiting for the request.

in another train of thought, i'm thinking of creating a static binary
instead of dynamic libs, so the my question is still in line with this
effort.

patience and peace,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: first swing at running local wiki

2010-08-10 Thread Edwin Eyan Moragas
On Tue, Aug 10, 2010 at 10:19 PM, Alexander Burger a...@software-lab.de wr=
ote:
 Hi Edwin,

 no problems with the link flags as far as i can tell. it compiles cleanl=
y.

 OK


 diverging a bit. what's picolisp's protocol of loading shared libs?

 A simple dlopen() followed by dlsym(). This happens e.g. in src/main.c
 in the sharedLib() function.

got it. thank you.

i was sprinkling some printf()s in the sharedLib() function. again,
happens after browser is stopped.


i also looked at tab.c. saw the functions being registered there.

 Hmm, probably upon the first access to a function in the shared object
 file. I'm not sure at the moment exactly _when_ the first of those
 functions is called.

 You could try manually som functions from lib/ht, e.g.:

 =A0 $ ./dbg
 =A0 : (ht:Prin abcd)
 =A0 alt;bamp;cgt;d- abcd

 =A0 : (ht:Fmt 'abc def 123 (4 5 6))
 =A0 - $abcdef+123_+4_+5_+6

 If this works, we are done :)

didn't. dbg spewed out similar errors. digging deeper...


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: first swing at running local wiki

2010-08-11 Thread Edwin Eyan Moragas

 e...@obsddev $ ./dbg wiki/main.l lib/too.l -main wiki/init.l -go
 !? (ht:Pack @U)
 ht:Pack -- Undefined
 ? (bye)
 File not found

 the error is from dlerror(). i'm also posting to m...@openbsd for some
 clues. haven't dealt with dlopen() and friends before. :)


i did another run. the buffer was too short so i hardcoded the
absolute path. sorry.

dlerror() now returns Cannot load specified object.

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: first swing at running local wiki

2010-08-12 Thread Edwin Eyan Moragas
Hi Alex,

On Thu, Aug 12, 2010 at 2:28 AM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 made ext.c and ht.c as part of the picolisp binary by editing the
 makefile. also tweaked tab.c (and io.c, flow.c since there were
 clashing symbols there) and pico.h to include the missing protoypes.

 Hmm, this should not be the way ;-)

indeed. i just wanted to have my fix. :)

(snip)


 Are you sure that the build of lib/ht and the other DLLs was
 successful? Are there any strange file permissions? Could you unpack a

yes. at least as much as i can tell. gmake didn't give out any errors.

 picoLisp.tgz file in some temporary space, and do the steps described in
 INSTALL?

i did. still the same errors.

(snip instructions for bootstrapping wiki)

thank your for the instructions. the bootstrap was successful. i have
a few minor errors but i was able to remove them (used the
non-dynamic-lib build, my bad).


 Sorry for the rather complicated procedure, but I didn't care to provide
 for a clean bootstrap procedure, because I created the DB manually
 during development of the first version of the wiki ;-)

no worries. i should be the one apologizing for bugging the list.

moving forward, i'm playing with some flags to diagnose the problem.
the obsd guys game some hints that i can work with.


/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


looks like solved (was Re: first swing at running local wiki)

2010-08-12 Thread Edwin Eyan Moragas
On Thu, Aug 12, 2010 at 2:31 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 thank your for the instructions. the bootstrap was successful. i have

 Great!


 moving forward, i'm playing with some flags to diagnose the problem.
 the obsd guys game some hints that i can work with.

 Thanks. I'd really be interested to know what goes wrong.

i got the thing behaving correctly by tweaking the Makefile:

ifeq ($(shell uname), OpenBSD)
OS = OpenBSD
PICOLISP-FLAGS = -m32 -rdynamic -Wl,-E
LIB-FLAGS = -lc -lm
DYNAMIC-LIB-FLAGS = -Wl,-E -Wl,-shared
STRIP = strip
else


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: looks like solved (was Re: first swing at running local wiki)

2010-08-12 Thread Edwin Eyan Moragas
Hi Alex,

possible additions to the Makefile (INSTALL instructions sensitive) :

 # Clean up
 clean:
rm -f *.o
+   rm -f ../lib/ht
+   rm -f ../lib/ext


On Thu, Aug 12, 2010 at 3:21 PM, Edwin Eyan Moragas e...@yndy.org wrote:
 On Thu, Aug 12, 2010 at 2:31 PM, Alexander Burger a...@software-lab.de w=
rote:
 Hi Edwin,

 thank your for the instructions. the bootstrap was successful. i have

 Great!


 moving forward, i'm playing with some flags to diagnose the problem.
 the obsd guys game some hints that i can work with.

 Thanks. I'd really be interested to know what goes wrong.

 i got the thing behaving correctly by tweaking the Makefile:

 ifeq ($(shell uname), OpenBSD)
 =A0 =A0 =A0 =A0OS =3D OpenBSD
 =A0 =A0 =A0 =A0PICOLISP-FLAGS =3D -m32 -rdynamic -Wl,-E
 =A0 =A0 =A0 =A0LIB-FLAGS =3D -lc -lm
 =A0 =A0 =A0 =A0DYNAMIC-LIB-FLAGS =3D -Wl,-E -Wl,-shared
 =A0 =A0 =A0 =A0STRIP =3D strip
 else


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe


-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: looks like solved (was Re: first swing at running local wiki)

2010-08-12 Thread Edwin Eyan Moragas
On Thu, Aug 12, 2010 at 3:56 PM, Alexander Burger a...@software-lab.de wro=
te:
 Hi Edwin,

 possible additions to the Makefile (INSTALL instructions sensitive) :

 =A0# Clean up
 =A0clean:
 =A0 =A0 =A0 =A0 rm -f *.o
 + =A0 =A0 =A0 rm -f ../lib/ht
 + =A0 =A0 =A0 rm -f ../lib/ext

 That's right. It is not absolutely necessary, though, as just removing
 '*.o' will trigger a complete rebuild anyway. If we include the
 libraries, then we should also include all other targets, which would
 make things harder to maintain and keep in sync.

copy that.


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


difference between a cons pain and plain list

2010-08-17 Thread Edwin Eyan Moragas
Hi all,

yes, a lisp newcomer here.

looking at the example in the app dev doc:

: (h1 '(id . bar) Title)

two questions
1) if the cons pair was written as code(id bar)/code instead of as
with the example, would h1 treat it different? how?
2) what's the fundamental difference between a cons pair and a simple
list? as far as simple symbols go, it would look something like this:

(a . b ) == [a, b]
(a b) == [a, b, NIL]

making it three:
3) when is a cons pair appropriate to use?

cheers,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: difference between a cons pain and plain list

2010-08-17 Thread Edwin Eyan Moragas
Hi Alex,

On Tue, Aug 17, 2010 at 8:34 PM, Alexander Burger a...@software-lab.de wro=
te:

 (a . b ) =3D=3D [a, b]
 (a b) =3D=3D [a, b, NIL]

 Well, it depends how your '[' and '[' notation is interpreted. I would
 draw it as cell boxes. (a . b) is a single cell (two pointers), with 'a'
 in the CAR and 'b' in the CDR:

 =A0 +-+-+
 =A0 | =A0a =A0| =A0b =A0|
 =A0 +-+-+

 while (a b) consists of two cells, where the CDR of the second cell is
 NIL:

 =A0 +-+-+ =A0 =A0 +-+-+
 =A0 | =A0a =A0| =A0---+| =A0b =A0| NIL |
 =A0 +-+-+ =A0 =A0 +-+-+

thank you for this. clearer now. this is how it is implemented in
picolisp underneath, right? (from pico.h)

so if i had a different base data structure, it wouldn't be like this?
say in other lisp implementations?

reason i'm asking is that if i had arrays as base structures in C
instead of linked cells, a dotted pair would look something like:

+-+-+
|  s  |  t  |
+-+-+

and a list as:

+-+-+-+
|   s  |  t  | NIL  |
+-+-+-+

is this a possible way to think about this or am i just chasing windmills?



 3) when is a cons pair appropriate to use?

 When you have data structures that typically appear in pairs. A good
 example are two-dimensional coordinates, x and y. You can put a single
 coordinate into a single cell (x . y) instead of a two-element list (x
 y), as you know there will never be a third element.

 In that way you save half of the space.

 A three-dimensional coordinate, btw, could be put into a two-cell
 structure (x y . z), needing only two cells instead of three.

like so?

+-+-+ +-+-+
|  x  |  ---+|  y  |  z  |
+-+-+ +-+-+



 Besides saving memory, cons pairs also make access easier sometimes. To
 access the 'z' in (x y . z) you can use the function 'cddr', doing two
 pointer dereferences. To access it in (x y z), you need three pointer
 operations (i.e. 'caddr').

 Basically, you are free to decide your data structure depending on the
 application. Sometimes a list has advantages over a pair, for example
 when you need uniform access (e.g. 'mapping' over the list).

thank you for taking time to answer my silly questions.

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: script for generating tags for picolisp

2010-08-18 Thread Edwin Eyan Moragas
Hi Alex,

On Wed, Aug 18, 2010 at 3:41 PM, Alexander Burger a...@software-lab.de wro=
te:
 Hi Doug,

 On Tue, Aug 17, 2010 at 09:19:23PM -0700, Doug Snead wrote:
 ...
 # make a tags file for pico lisp source files.
 ...

 As I understand it, this is not exactly what Edwin intended. I think he
 wanted a tags file for the main interpreter functions written in C

Doug sent something that i actually intended. there's ctags for C functions=


Re: script for generating tags for picolisp

2010-08-18 Thread Edwin Eyan Moragas
Hi Doug,

thanks for this. this would come in handy.

On Wed, Aug 18, 2010 at 12:19 PM, Doug Snead semaphore_2...@yahoo.com wro=
te:
 Here's one shell script I used to use for that (I called it lisptags) ...=
 hopefully it still works :-)

 #!/bin/sh
 # make a tags file for pico lisp source files.
 # use:
 # =A0 =A0 =A0 lisptags foo.l bar.l baz.l ... bof.l
 # generate the file 'tags'
 # [based on lisptags csh script by John Foderaro, c.1982]
 awk '
 /^[ \t]*\([bd][em][ \t]/ {
 n=3D$2;
 gsub(/^\(/,,n);
 gsub(/\)$/,,n);
 print n \t FILENAME \t?^ $0 $?;
 }
 /^[ \t]*\(class[ \t]/ {
 n=3D$2;
 gsub(/^\(/,,n);
 gsub(/\)$/,,n);
 print n \t FILENAME \t?^ $0 $?;
 if (n ~ /^\+/) {
 =A0gsub(/^\+/,,n);
 =A0print n \t FILENAME \t?^ $0 $?;
 }
 }
 ' $* | sort  tags

 =3D =3D =3D



 --- On Tue, 8/17/10, Edwin Eyan Moragas e...@yndy.org wrote:

 From: Edwin Eyan Moragas e...@yndy.org
 Subject: script for generating tags for picolisp
 To: picolisp@software-lab.de
 Date: Tuesday, August 17, 2010, 12:05 AM
 Hi all,

 anybody who made an attempt to create such kind of script?
 or maybe a
 resource somewhere in the interwebs for this?

 cheers,

 /e
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe




 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


(extend cls)

2010-08-18 Thread Edwin Eyan Moragas
Hi all,

i'm going thru the wiki code. encountered `(extend)` in it but
couldn't find an example in the tutorial but found the definition in
the docs.

after reading thru, seems to me that *Class is used to change class
definitions (from wiki/er.l and doc/family.l). examining wiki/gui.l,
seems to me that class definitions (say +Doc) are kept in top-level.

execution flow now would look like:

a) define classes using `(extend)` or `(class)`
b) open the db
c) accept requests
d) do whatever
e) render the page
f) goto #c

questions:

1) am i on the right track so far?
2) as far as i can tell, only 1 db can be opened at any time. how does
one deal with multiple databases?

thanks for your patience. :)

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


how to run tests

2010-08-22 Thread Edwin Eyan Moragas
Hi all,

i can't find anything on how to run tests that come with the source
distribution. anybody has an URL or a clue how to do this?

thank you.

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: how to run tests

2010-08-23 Thread Edwin Eyan Moragas
Hi Alex,

On Mon, Aug 23, 2010 at 1:56 PM, Alexander Burger a...@software-lab.de wro=
te:
 Hi Edwin,

 i can't find anything on how to run tests that come with the source
 distribution. anybody has an URL or a clue how to do this?

 Do you mean the unit tests residing in the test/ directory?

yes.


 They are started via lib/test.l, with a somewhat special command
 (written as a comment in the beginning of lib/test.l):

 =A0 $(/bin/pwd)/p lib/test.l -bye

 This special path syntax for 'p' is necessary so that the functions
 checking pathes and the current working directory return the expected
 results.

 When all goes well, OK is printed, otherwise an error handler is
 entered:

 =A0 $ $(/bin/pwd)/p lib/test.l -bye
 =A0 OK

great. thank you. :)

more stuff to do for me. i want this to pass on openbsd. in due time. :)



 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: non forking picoLisp appserver

2010-08-23 Thread Edwin Eyan Moragas
On Mon, Aug 23, 2010 at 7:10 PM, Alexander Burger a...@software-lab.de wro=
te:
 Hi Edwin,

 can i make the picoLisp app server not fork? that is, when i run

 There was a discussion about that here in 2008. You can easily make a
 non-forking server by not calling the standard 'server' function which
 automatically forks upon a connect, but use a 'listen'ing loop instead:

 
 #!bin/picolisp lib.l

 (load ext.l lib/http.l lib/xhtml.l)

 (allowed () @start)

 (de start ()
 =A0 (html 0 Hello NIL NIL
 =A0 =A0 =A0Hello World! ) )

 (let (P (port 8080) =A0H @start)
 =A0 (setq *Home (cons H (chop H)))
 =A0 (loop
 =A0 =A0 =A0(when (listen P)
 =A0 =A0 =A0 =A0 (http @)
 =A0 =A0 =A0 =A0 (close @) ) ) )
 

 This loops infinitely, listening on port 8080. When a request arrives,
 it is handled, and the connection closed.

 This works, but has disadvantages like denying further requests while a
 transaction is running, and not being able to keep state information in
 a session the way the child processes do after a fork. For certain
 special cases it might well make sense, though.


thank you Alex.

cheers,

/eyan
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


port handling and httpgate

2010-08-24 Thread Edwin Eyan Moragas
Hi all,

i start httpgate with:

$ bin/httpGate 3000 8080  8081 8082

then run the sample app.

it shows me the login screen and then the location in the browser points at:

http://192.168.1.253:3000/45313/713963214703762...@start?*menu=+3*Tab=+1*ID=

which shows a blank page. console shows:

e...@saidin $ ./dbg app/main.l -main -go
: 22487 * 2010-08-25 09:01:10 admin

which i guess is alright.

running the sample app without httpgate gives me no problems.

where's the best place to look to start tracking down this problem. i
am running this on an openbsd box by the way. haven't tested it on
linux (which is a well known deployment environment anyway).

cheers

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: port handling and httpgate

2010-08-24 Thread Edwin Eyan Moragas
Hi Alex,


 Do you need this kind of setup for some special reason? After all, the

not really. i was just using it for tests. i didn't even give port 80
a shot yet. :).

 main purpose of 'httpGate' is to proxy all requests to the default port
 to app-specific ports like 8080. If you pass :3000 to the browser, you
 could as well directly pass :8080.

 If such a setup were indeed necessary (e.g. because you have no
 permission to start 'httpGate' at port 443, but you need it for HTTPS),
 then the protocol between 'httpGate' and the application server would
 need to be extended a little, passing the alternate port (3000). No big
 deal, but it seems nobody needed that until now ;-)


it's not necessary. yet. i was on the 'completeness' frame of mind.
if this works on port 80, then it will work with other ports as
well.

will try the usual port and if i don't succeed, then it will be a concern.

cheers

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: port handling and httpgate

2010-08-24 Thread Edwin Eyan Moragas
Hi Alex,


 will try the usual port and if i don't succeed, then it will be a concern.

it is a concern.

$ ./bin/httpGate 80 8080

gives the same result.

cheers,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: where are the values of CAR and CDR stored?

2010-08-24 Thread Edwin Eyan Moragas
Hi Santiago,

thank you for this.

i should have been clearer in my question. how is, say, a symbol,
stored using cells?.

On Wed, Aug 25, 2010 at 11:06 AM, santiago ottonello sano...@gmail.com wr=
ote:
 I guess the actual data is in car

 i.e.

 hi

 |h| *|-|i|*|-NIL

 But just a guess :-)

you've hit it right in the head. assuming your answer is correct, the
i guess i get it.

:-)



 2010/8/24 Edwin Eyan Moragas e...@yndy.org

 Hi list,

 looking at pico.h i see the definition of the cell:

 typedef struct cell { =A0 =A0 =A0 =A0 =A0 =A0// PicoLisp primary data ty=
pe
 =A0 struct cell *car;
 =A0 struct cell *cdr;
 } cell, *any;


 these are pointers to... where? this would answer questions like:
 where is the actual symbol (or internal string representation of it)
 stored?

 i can dig deeper in the source but where to start?

 cheers,

 /e
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe


-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: where are the values of CAR and CDR stored?

2010-08-24 Thread Edwin Eyan Moragas
Hi Mansur,

On Wed, Aug 25, 2010 at 12:27 PM, Mansur Mamkin mmam...@mail.ru wrote:
 Hi all!

 Look at http://www.software-lab.de/doc/ref.html#vm

yes. i have read thru it and several times over. thank you.

what i need is confirmation of my understanding.

so i guess this mean that symbols are stored like picolisp ints? CAR
holding a digit (in the case of symbols, a single character) and the
CDR pointing to the next cell, which holds a digit in its CAR, and so
on?


 Hi Santiago,

 thank you for this.

 i should have been clearer in my question. how is, say, a symbol,
 stored using cells?.

 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: where are the values of CAR and CDR stored?

2010-08-25 Thread Edwin Eyan Moragas
Hi Alex,


 As you observed, a cell is defined as a structure of two pointers. This
 is just to keep the C compiler happy. In truth, the CAR and the CDR
 contain either a pointer to another cell, or a plain binary value.

this is what i was after. thank you.

cheers,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


httpGate redux

2010-08-25 Thread Edwin Eyan Moragas
Hi list,

using the dev version, i was able to install and run the wiki with
httpGate successfully. i can log in and do things fine.

*but* i am redirected to a different port
(http://192.168.1.253:34205/523083596357234...@start?*menu=+3*Tab=+1*ID=*Evt=+1*Got=_+2_+1)
after logging in. how can i just make it stick with port 80?

thanks much

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: httpGate redux

2010-08-26 Thread Edwin Eyan Moragas
Hi Alex,


 Sticking with port 80 is usually handled by 'httpGate'. To the outside
 world, there will always only port 80 (or 443) be visible.


there's the rub. i'm running it behind httpGate.

thank you,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: httpGate redux

2010-08-26 Thread Edwin Eyan Moragas
Hi Tomas,

On Thu, Aug 26, 2010 at 2:52 PM, Tomas Hlavaty t...@logand.com wrote:
 I use nginx as a web server and proxy on port 80 and it allows you more
 freedom of configuration than when using httpGate. =A0You can read a bit
 about my setup at
 http://logand.com/blog/picolisp-behind-nginx-proxy.html Hope it helps.

i found your resource some time ago and plan on using it as a base for
configuring apache to proxy. thank you for this.

back to my problem at hand, i'll spell out what i did.

i'm running things on:

e...@saidar $ uname -a
OpenBSD myhost 4.6 GENERIC#58 i386

launched httpGate using:

e...@saidar $ sudo ./bin/httpGate 80 8080  8081 8082

after initializing the wiki prereqs and setting *Wikiport to 8080, i
launch it using:

e...@saidar $ ./dbg wiki/main.l lib/too.l -main -go

pointed my browser to:

http://192.168.1.253/

and this displays the login page.

logged in using admin/admin and it redirects me to:

http://192.168.1.253:13678/228846712525427...@start?*menu=3d+3*Tab=3D+1*I=
D=3D*Evt=3D+1*Got=3D_+2_+1

and since OpenBSD is not officially supported, i'll just have to do
things on my own. however, if there are any clues as to where to
start, it would indeed be most helpful.

after a cursory look at httpGate.c at around line 220, i think that's
where URL rewriting happens. i'll look into that some more.


 Cheers,

 Tomas
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


where is the tail?

2010-09-15 Thread Edwin Eyan Moragas
Hi list,

reading thru the reference:

A property is a key-value-pair, represented as a cell in the symbol's tail.

looking at the definition of a cell (from pico.h):

typedef struct cell {
   struct cell *car;
   struct cell *cdr;
} cell, *any;

where is the 'tail' in light of what's given? is it in the 'car' or
'cdr'? the ASCII art in http://www.software-lab.de/doc/ref.html#cell
is a bit vague.

best,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


symbols, values and properties

2010-09-25 Thread Edwin Eyan Moragas
Hi list,

reading up on the docs again, it mentions symbols, values and properties.

the way i understand it, symbols evaluate to a value. symbols also
have properties. several questions:

1) how are symbol properties implemented on the C level?
2) how are symbol properties stored in the db?

what i'd like to accomplish is a decent understanding of the
implementation before i delve deeper into the code.

thank you.

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: symbols, values and properties

2010-09-26 Thread Edwin Eyan Moragas
Hi Alex,

On Sun, Sep 26, 2010 at 3:11 PM, Alexander Burger a...@software-lab.de wro=
te:

 Note that - as opposed to association lists - the key is in the CDR of
 the cell. This has advantages when manipulating the value, because the
 CAR of a cell is a variable ('var' called in the documentation).

 Searching for a property by a key goes through the list, and looks for a
 CDR that is '=3D=3D' (pointer equal) to the key. When a property is found=
,
 it is moved to the front of the list, as a side effect to accelerate
 further accesses (last recently used scheme).

thank you for this.



 2) how are symbol properties stored in the db?

 The whole symbol (value and properties) is simply stored in the PLIO
 format, a binary serialization format. The name of an external symbol
 determines its location, at which offset into which file it resides.

 The PLIO format is also used by other functions like 'pr', 'rd', 'tell',
 'hear' etc. You can experiment with it also outside the database context
 by writing it to a plain file:

 =A0 : (put 'A 'a 1) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Create some=
 properties for 'A'
 =A0 - 1
 =A0 : (put 'A 'b 2)
 =A0 - 2
 =A0 : (put 'A 'c 3)
 =A0 - 3

 =A0 : (getl 'A) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # See the=
 property list
 =A0 - ((3 . c) (2 . b) (1 . a))

 =A0 : (out 'a (pr (getl 'A))) =A0 =A0 =A0 =A0 =A0 # Print property list t=
o file a
 =A0 - ((3 . c) (2 . b) (1 . a))

 =A0 : (hd 'a) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Hexdu=
mp of the PLIO representation
 =A0  =A001 01 04 06 02 05 63 01 04 04 02 05 62 01 04 02 =A0..=
c.b...
 =A0 0010 =A002 05 61 03 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0..a.
 =A0 - NIL

 Does this help?

helped a lot.

it became clearer too after reading the answer to the second question.
that and reading the source in sym.c of doGetl.

i'm still on the path of trying to see all the little details.

thank you much.

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


opt/pilog.l?

2010-10-05 Thread Edwin Eyan Moragas
hi all,

being a newbie and all, what is the significance of pilog.l in opt/ in
the source distribution?

best,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: opt/pilog.l?

2010-10-05 Thread Edwin Eyan Moragas
Hi Alex,

On Tue, Oct 5, 2010 at 3:10 PM, Alexander Burger a...@software-lab.de wrote:

 The first case were some Pilog extensions from cle, and as there is
 already a lib/pilog.l and a misc/pilog.l, we agreed to put such
 things into a new directory opt/.

thank you.

cheers,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


warning in io.c

2010-10-06 Thread Edwin Eyan Moragas
Hi all,

compiling picolisp gives me this warning:

io.c: In function =91doEcho=92:
io.c:2161: warning: =91op=92 may be used uninitialized in this function

my problem is that i can't find where `op is defined. any help would
be appreciated.

best,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: picolisp in java

2010-10-14 Thread Edwin Eyan Moragas
Hi Tomas,

On Thu, Oct 14, 2010 at 1:43 AM, Tomas Hlavaty t...@logand.com wrote:

 In that email, I just wanted to say that I implemented some functions
 directly in Java and that speeds up the fibo benchmark significantly.
 For getting better picture about interpretation overhead, there are now
 three versions: one (the original and slow) completely interpreted, one
 with native functions and one completely native.

thank explains it.

by the way, thank you for releasing this in the wild.

your java implementation gave me a better understanding how picolisp
works under the hood.

reading Alex's code is really a great exercise to become a solid C
head. this is a Good Thing (tm).

cheers,

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: wiki password

2010-10-27 Thread Edwin Eyan Moragas
On Wed, Oct 27, 2010 at 2:54 PM, Alexander Burger a...@software-lab.de wro=
te:
 Hi Tomas,

 This is a big flaw. =A0You should not be able ever to find out his
 password.

 Why not?

 Nobody could stop me anyway. I could trace the program during execution,
 for example, to get the passwords.

oh yes! :D

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


just a big THANK YOU

2010-12-21 Thread Edwin Eyan Moragas
Hi list (esp Alex),

was browsing thru the rosetta code examples. not to mention all the
docs and written materials made available freely via the web.

to everyone who has made picolisp what it is today, THANK YOU so much!

have a merry christmas y'all!

cheers!

/e
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: composite primary keys

2011-03-16 Thread Edwin Eyan Moragas
Hi Henrik,

On Wed, Mar 16, 2011 at 3:34 PM, Henrik Sarvell hsarv...@gmail.com wrote:
 Might the +Aux relation be what you're looking for?

i'm approaching this from with a SQL background so forgive me for my naivete.

checking the docs out, +Aux is a Prefix class maintaining auxiliary
keys for +relations, in addition to +Ref or +Idx indexes. Expects a
list of auxiliary attributes of the same object, and combines all keys
in that order into a single index key.

which means that there must exist a primary key for the +relation in question.

however, i'm looking for a +Key with multiple columns.

i'm not sure if this is applicable at all, please note. so if +Aux is
indeed the right direction, i'll give it a swing.

thank you.

/e


 On Wed, Mar 16, 2011 at 2:19 PM, Edwin Eyan Moragas e...@yndy.org wrote:
 Hi List,

 anyone encountered creating a composite primary key for Pilog?

 or it is applicable in the Pilog context? how would one go about using
 composite primary keys?

 thank you.

 /e
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: composite primary keys

2011-03-16 Thread Edwin Eyan Moragas
Hi Alex,

On Wed, Mar 16, 2011 at 3:54 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 anyone encountered creating a composite primary key for Pilog?

 You mean for database indexes?

not just for indexes but for a composite primary key. i'm not sure tho
if my head is right on this.


 If so, there is the '+Aux' prefix class which does this, and there is
 also a function 'aux' for direct access. The Pilog rules know about
 '+Aux' and handle it accordingly.

thank you. hope you've read my response to Henrik's.

whack me with a clue stick anytime. :)


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: composite primary keys

2011-03-16 Thread Edwin Eyan Moragas
Hi Alex,

On Wed, Mar 16, 2011 at 4:44 PM, Alexander Burger a...@software-lab.de wrote:

 In my mind, I distinguish between objects and indexes in the DB. The
 objects are the payload data, and also have direct links between each
 other (the +Link and +Joint relations).

uhm. this helps a lot. thank you.

Henrik,

thanks to you too. those articles helped.

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


setting a cookie from a script

2011-03-16 Thread Edwin Eyan Moragas
Hi List,

i got as far as figuring out where a script is executed in a
(listen)-ing http server.

i think it's somewhere here in http.l:

 ((= '@ (car @U))
#URL starts with @
#@U is @start by default
(if (disallowed)
   (prog (msg *Url  not allowed) (http404))

   (and *SesId (timeout *Timeout))
 # put this here to find out what the (apply (val... kungfu below is doing
   (out NIL (println ((val (intern (ht:Pack
(cdr @U L)))
   (apply (val (intern (ht:Pack (cdr @U L) ) )

all well and good. now how do i set a cookie?

what i'm trying to do is create a non forking server, store sessions
in an idx variable (maybe) and have a way to connect the session with
the cookie.

i'm hoping this is not too hard. *crossing fingers, hands and all*.

thank you.

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: setting a cookie from a script

2011-03-16 Thread Edwin Eyan Moragas
Hi Alex,

On Thu, Mar 17, 2011 at 12:46 AM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 i got as far as figuring out where a script is executed in a
 (listen)-ing http server.

 i think it's somewhere here in http.l:

                      ((= '@ (car @U))
                         #URL starts with @
                         #@U is @start by default
                         (if (disallowed)
                            (prog (msg *Url  not allowed) (http404))

                            (and *SesId (timeout *Timeout))
  # put this here to find out what the (apply (val... kungfu below is doing
                            (out NIL (println ((val (intern (ht:Pack
 (cdr @U L)))
                            (apply (val (intern (ht:Pack (cdr @U L) ) )

 Actually, this is not the place where a script is executed, but a direct
 Lisp function call. For that, the funtion's name is written in the URL
 as @foo.

ah. yes. my mistake.


 A lisp script (source file) is executed a little more down in the
 source, at

                     ((tail '(. l) @U)
                        (and *SesId (timeout *Timeout))
                        (apply script L *Url) )

 i.e. when the name ends with .l.



 all well and good. now how do i set a cookie?

 You can create cookies by calling the 'cookie' function in your function
 or script:

   (cookie Name This is my name)

 or

   (cookie Address My City My Street)

 The first argument is the cookie's name, and all following arguments are
 stored as a list as the cookie's value.

 They will be transmitted in the HTTP response.


 Upon the next request, all cookies will be returned in an assoc list in
 the global variable '*Cookies'.


it works! thank you.

/e
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


understanding (task)

2011-03-25 Thread Edwin Eyan Moragas
Hi list,

in http.l, i see a lot of (task (close S)) usage.

from the docs, (task) says it's a front end to the *Run global and
created a (job) environment.

isn't (close) simple enough to just let it rip? why should it be
enclosed in a (task).

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: understanding (task)

2011-03-25 Thread Edwin Eyan Moragas
Hi Alex,

On Fri, Mar 25, 2011 at 4:00 PM, Alexander Burger a...@software-lab.de wrote:
 Instead of enclosing it in (task (close S)), two separate calls (close
 S) and (task S) would also be all right (just a little bigger).

 But both are necessary: (close S) to free the socket file descriptor,
 and (task S) to remove the corresponding entry from the list in '*Run'.

is this in the context of multiple picolisp processes? figured S is
just a socket and calling (close) in a non forking server would be ok?

thank you.

/e


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: understanding (task)

2011-03-25 Thread Edwin Eyan Moragas
Hi Alex

On Fri, Mar 25, 2011 at 4:46 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

  But both are necessary: (close S) to free the socket file descriptor,
  and (task S) to remove the corresponding entry from the list in '*Run'.

 is this in the context of multiple picolisp processes? figured S is
 just a socket and calling (close) in a non forking server would be ok?

 It doesn't matter whether there are multiple picolisp processes: Both
 the open file descriptor, and the list of tasks in '*Run', are private
 to each process.

i see.

in this light, i might have been asking the wrong question...


 So if you just close the file descriptor, but don't remove it from the
 task list, you'll get a Key conflict error when the next time a new
 socket with that file descriptor number is assigned a 'task', or when
 the event handler processing '*Run' passes the closed file descriptor to
 select(2).

what's the reason for running it via (task) in the first place?

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: understanding (task)

2011-03-25 Thread Edwin Eyan Moragas
On Fri, Mar 25, 2011 at 9:22 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

  So if you just close the file descriptor, but don't remove it from the
  task list, you'll get a Key conflict error when the next time a new
  socket with that file descriptor number is assigned a 'task', or when
  the event handler processing '*Run' passes the closed file descriptor to
  select(2).

 what's the reason for running it via (task) in the first place?

 A task is a piece of code to be run whenever a certain event happens.

 An event is either the expiry of a timer, or the arrival of data on a
 file descriptor. There may be several timers and many file descriptors
 where the process is expecting something to happen, so they are all put
 into a list in '*Run', and handled with I/O Multiplexing (the POSIX
 select(2) system call).

there you go. thank you.



 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


paging Tomas Hlavaty for java.wl license

2011-03-28 Thread Edwin Eyan Moragas
Hi Tomas,

was wondering if you'd like to attach an explicit license to wl
(hopefully MIT too, or new BSD :) since i cannot find one (or maybe
i'm just a moron not to find it).

i'm hoping i could use java.wl for some open source stuff (currently
vaporware) i'm doing.

btw, wl.java is a great start for wannabe language implementors like
me. thank you for that (and the very helpful picolisp community).

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


autogenerated keys for pilog

2011-03-30 Thread Edwin Eyan Moragas
Hi List,

what's the best way to go about autogenerated keys for Pilog? i've
been digging around a bit and can't find anything related.

hints and pointers would be most appreciated. thank you.

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: autogenerated keys for pilog

2011-03-31 Thread Edwin Eyan Moragas
H Alex,

On Thu, Mar 31, 2011 at 2:42 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 what's the best way to go about autogenerated keys for Pilog? i've
 been digging around a bit and can't find anything related.

 Hmm, I am not sure what that is. You mean something along autogenerated
 keys in JDBC? I find

   JDBC's auto-generated keys feature provides a way to retrieve values
   from columns that are part of an index or have a default value
   assigned


 In the PicoLisp DB there are no keys used to join tables. Instead,
 objects are directly linked, i.e. they refer to each other (in
 properties) by containing other objets, or lists of objects.

check. another insight. thank you.


 The relation maintenance classes for that are '+Link' and '+Joint'.


 In fact, there is a function 'genKey' which generates keys, but this is
 different from how I understand the above autogenerated keys. 'genKey'
 simply returns a new number not yet existent in an index.

i think this hits the nail squarely.


 Can you give an example what you'd like to do?

suppose there is a song entitled evergreen. one was sung by barbra
streisand, the other by will young. different lyrics, but same song
title.

i'd like to use SongTitle as a key, but it won;t cut it, as in the
example above. so i have to revert to something like an autoincrement
key.

this is it! thank you.


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


understanding (id) (was Re: autogenerated keys for pilog)

2011-03-31 Thread Edwin Eyan Moragas
Hi Henrik,

On Thu, Mar 31, 2011 at 2:48 PM, Henrik Sarvell hsarv...@gmail.com wrote:
 You get the same behavior as auto increment in for instance MySQL with this
 one: http://software-lab.de/doc/refG.html#genKey

 I use it a lot in the VizReader code.

great. thank you.


 I'm not so sure I would've used it much though if I had know about the (id)
 function from the start: http://software-lab.de/doc/refI.html#id

i'd like to understand this more. can you please give an illustration
on how to do this?


 In my case it's all about displaying a nice id that is easy to relate for
 humans and JavaScript in my non-traditional gui and as you can see both
 approaches accomplish that but that latter is imo more elegant.

 /Henrik Sarvell


 On Thu, Mar 31, 2011 at 1:26 PM, Jakob Eriksson ja...@vmlinux.org wrote:

 On Thu, Mar 31, 2011 at 09:57:06AM +0800, Edwin Eyan Moragas wrote:
  Hi List,
 
  what's the best way to go about autogenerated keys for Pilog? i've
  been digging around a bit and can't find anything related.
 
  hints and pointers would be most appreciated. thank you.


 Hi!

 I have copied your (very good) question to:
 http://stackoverflow.com/questions/5496015/autogenerated-keys-in-pilog

 As I want to promote the Picolisp language on that site, but I have a hard
 time thinking up good questions and answers on my own.

 best regards,
 Jakob
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: understanding transient symbols, (====) and dynamic binding

2011-04-13 Thread Edwin Eyan Moragas
On Wed, Apr 13, 2011 at 2:15 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 if i understand correctly, () when called outside a method works
 only when a file is (load)ed?

 I'm not sure what you mean here. Isn't that the case for _any_ function?

check. i realized this after sending my first email.


 To my understanding '' is a normal function, which clears the
 transient symbol table as a side effect.

right. again, more insight.

only the transient table is cleared, but the transient symbols
themselves are left alone.

additionally, the reference says:

That means, a transient symbol cannot be accessed then by its name,
and there may be several transient symbols in the system having the
same name.

i had a hard time understanding this until i checked the source, which
just wipes out the transient hash table but leaves the heap alone.




 replying to myself, wrote a test...

 (de test1 ()
(if (not (num? ctr))
   (setq ctr 1)
   (inc 'ctr)
)
(prinl ctr)
()
 )

 (test1)
 (test1)
 (prinl ctr)

 did a face palm and tells myself that's how a static behaves in C!.
 did that explain that right?

 Yes, exactly.

 'test1' will always refer to ctr, even if it is gone out of visibility
 (transient scope) for the outside world.


after writing the test (damn, i should be writing more tests rather
than asking...), reading the C code and reading and re-reading the
reference i now have a clearer picture of how transient symbols are
used. this is just part of unlearning  i think.

elegance!

thank you Alex for sharing all of this.

(wishful thinking: alternative syntax for representing transient
symbols without embedded spaces. maybe something like \xxx)

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: understanding transient symbols, (====) and dynamic binding

2011-04-13 Thread Edwin Eyan Moragas
On Wed, Apr 13, 2011 at 3:22 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 (wishful thinking: alternative syntax for representing transient
 symbols without embedded spaces. maybe something like \xxx)

 Yeah, that's something I'm missing too. Transient symbols which
 represent not just strings simply look ugly.


 In fact, there exists something along that line, though not really a
 syntax in the traditional sense: Transient symbol markup.

this is way too complex. perhaps i didn't express myself clearly. i
was looking at something far simpler.

at the moment, we have transient symbols as my transient symbols.
this syntax for this is just fine. what if we can express MyParam, a
transient symbol as \MyParam (or something similar) (a personal quirk,
i dislike double quotes too much).

maybe implement '\' as a read macro (?) to convert \MyParam to
MyParam during read time.

anyway, i'm not pushing this too much. was just thinking out loud.


 This is something tc.rucho and I were experimenting with for quite a
 while. You can see it going in and out over the years if you search for
 '*Tsm' in CHANGES.

 In the end (since 3.0.6) we disabled it by default, as it caused too
 much confusion. But the mechanics for *Tsm are still in the system
 (doc/refT.html#*Tsm). You can switch in on by loading lib/tsm.l:

   $ ./p lib/tsm.l +

 or

   $ ./dbg lib/tsm.l

 Transient symbol markup causes transient symbols to be displayed in an
 underlined font on the console, without the double quotes. Once you get
 used to it, it is a nice thing. The drawback is that it is difficult to
 be supported in most editors (tc.rucho implemented some support for it
 in emacs, and partially in vim).

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: understanding transient symbols, (====) and dynamic binding

2011-04-13 Thread Edwin Eyan Moragas
On Wed, Apr 13, 2011 at 7:45 PM, Alexander Burger a...@software-lab.de wrote:
 On Wed, Apr 13, 2011 at 10:57:17AM +0200, Alexander Burger wrote:
 I was thinking of re-introducing a syntax like :MyParam, or perhaps
 MyParam, but this saves only a single character over MyParam, and
 doesn't look so very much better.

 The main reason of not doing this was that it adds yet another syntax
 rule, increasing the confusion about transient symbols. If both :MyParam
 and My Param are transient symbols, people will forget about the fact
 that they are the same internally, and then a statement where indeed a

 I forgot to mention an even bigger problem if two alternative syntaxes
 are used for transient symbols: Which one should be used for output
 (print, pp, edit etc.)?

more problems. :)

will leave this for now and maybe someday when i understand the
internals more i can present some solution.



 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


named, interned symbols

2011-04-14 Thread Edwin Eyan Moragas
Hi list,

several things that need help on.

i encounter named symbol and interned symbol a lot in the docs.

i just want to make sure that i understand things correctly.

1) named symbols are symbols that have a name in their property cell

2) interned symbols are symbols that are bound to  symbol name, ie
(setq) and having an entry in the intern hash

3) anonymous symbols are symbols that aren't bound to a symbol name,
but can be accessed as a member of a list

4) transient symbols are named and bound (ie having an entry in
the transient hash).

did i get those right?

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Changed '@' to '!' for functions in URLs

2011-05-08 Thread Edwin Eyan Moragas
On Sun, May 8, 2011 at 6:31 PM, Jakob Eriksson ja...@vmlinux.org wrote:
 In which Linux distributions?  This is great news!

debian for one. not sure about the others yet.



 // Jakob

 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


more questions on transient symbols

2011-05-22 Thread Edwin Eyan Moragas
Hi Alex,

the effect of () is that it clears the transient index.

how then does the interpreter find the correct one to achieve the as
identifiers with a limited access scope (like, for example, static
identifiers in the C language family)  feature as pointed out in the
reference after calling ()?

this is more of a curiosity since i can't figure it out from the code.

thank you.

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: more questions on transient symbols

2011-05-22 Thread Edwin Eyan Moragas
On Mon, May 23, 2011 at 12:19 AM, Edwin Eyan Moragas e...@yndy.org wrote:
 Hi Alex,

 the effect of () is that it clears the transient index.

 how then does the interpreter find the correct one to achieve the as
 identifiers with a limited access scope (like, for example, static
 identifiers in the C language family)  feature as pointed out in the
 reference after calling ()?

 this is more of a curiosity since i can't figure it out from the code.

 thank you.

 /e


here's a code sample of what i've been playing with:

eyan@faya $ dbg
: (setq a 234)
- 234
: (de x (a b)
   ()
   (pack a b))
- x
: (setq y (x 3 4))
- 34
: (prinl y)
34
- 34
: (prinl a)
a
- a
:

inside (x), all's well even with the transient index cleared. the
thing i'm afraid of is clearing the transient index and getting the
wrong transient symbol in the process.

any more clues or pointers would be most appreciated.

thank you.

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: more questions on transient symbols

2011-05-23 Thread Edwin Eyan Moragas
Hi Alex,

On Mon, May 23, 2011 at 2:00 PM, Alexander Burger a...@software-lab.de wrote:

 The interpreter _first_ 'read's the list

   (de x (a b) () (pack a b))

 and _then_ executes it, i.e. assignes the list

   ((a b) () (pack a b))

 to the symbol 'x'.

 The function '' is not executed yet, and the transient index is not
 changed.

aha!

thank you. hmmm. i need to understand the difference between run-time
and read-time more.

cheers!

/e


 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


sorting db queries

2011-05-23 Thread Edwin Eyan Moragas
Hi list,

i'm currently playing with pilog and the database.

i'm trying to look for an example of sorting the output of database
queries by a given attribute.

as a trivial example:

(class +MyClass +Entity)
(rel date (+Date))

and if i run a query, i'd like to sort the output, say, by increasing date.

sorry if i missed this somewhere.

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: sorting db queries

2011-05-23 Thread Edwin Eyan Moragas
Hi Alex,

thank you. just what i need.

/e

On Tue, May 24, 2011 at 2:09 AM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 i'm trying to look for an example of sorting the output of database
 queries by a given attribute.
 ...
 (class +MyClass +Entity)
 (rel date (+Date))
 ...
 and if i run a query, i'd like to sort the output, say, by increasing date.

 There are two possibilities:

 1. If this sorting is often necessary, you maintain an index for that
   attribute:

      (rel date (+Ref +Date))

   Then all queries on that attribute will directly return sorted
   results:

      (collect 'date '+MyClass)
      (collect 'date '+MyClass fromDate tillDate)

      (pilog '((db date +MyClass @M) ...) ...)

   Note, however, if 'select' is used with multiple search attributes,
   the resulting order is not defined.


 2. If you need to do that only once or seldom, sort the results after
   fetching them:

   (by '((This) (: date)) sort
      (collect 'someOtherAttribute '+MyClass) )

   This has the disadvantage that first all results must be fetched, of
   course, before they can be sorted.

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


limiting results of select/3

2011-05-25 Thread Edwin Eyan Moragas
Hi list,

after checking the 'select' predicate doc, i can't find any way to
limit the number of results of the query.

i'm thinking along the lines of the LIMIT clause of SQL.

thank you.

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


running test suite in mac osx error: IP bind error: Address already

2011-06-09 Thread Edwin Eyan Moragas
Hi guys,

any chance ideas on how to fix this on osx?

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: running test suite in mac osx error: IP bind error: Address

2011-06-10 Thread Edwin Eyan Moragas
Hi Alex,

On Fri, Jun 10, 2011 at 1:16 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 any chance ideas on how to fix this on osx?

 In which situation does this error appear?

not sure which specific one. but the ouput's here:

eyan@faya $ $(/bin/pwd)/p lib/test.l -bye +
[test/lib.l:5] !? (port T )
IP bind error: Address already in use
?




   # lsof -i :port


was using netstat and the lsof invocation above. the port's ok.

this also happens in obsd by the way.

btw, if it is significant, i'm sticking with 3.0.5. i tried this with
the current version too and it's the same story.

/e
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: running test suite in mac osx error: IP bind error: Address

2011-06-10 Thread Edwin Eyan Moragas
Hi Alex,

On Fri, Jun 10, 2011 at 4:05 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 eyan@faya $ $(/bin/pwd)/p lib/test.l -bye +
 [test/lib.l:5] !? (port T )
 IP bind error: Address already in use

 Oh, I see. This are the unit tests, and it is the place where it tries
 to bind to a UDP port.

 So it seems the UDP handling of PicoLisp doesn't work under Mac OS (and
 OpenBSD, where Mac OS is derived from, iirc).

check this.


 In the past, we have tested it a lot under FreeBSD, and couldn't see any
 problems with that.

 Is there anybody who can debug it under Mac OS or OpenBSD?

i'll be on it. not sure about time frame tho since i'm diddling with
an app at the moment. looks like i'm the only one running it on obsd
so i guess it's not an urgent issue. :)



 btw, if it is significant, i'm sticking with 3.0.5. i tried this with
 the current version too and it's the same story.

 No problem, I think. The network stuff didn't change recently.

 What comes to my mind, though: PicoLisp is not IPv6 ready yet (see
 previous discussions here). Could this be a reason?

probably not. IPv6 not enabled in my obsd setup.

thanks Alex. was silly i should have mentioned running the test suite
in my first email.

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: running test suite in mac osx error: IP bind error: Address

2011-06-10 Thread Edwin Eyan Moragas
On Fri, Jun 10, 2011 at 5:43 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 i'll be on it. not sure about time frame tho since i'm diddling with

 Great!

 an app at the moment. looks like i'm the only one running it on obsd
 so i guess it's not an urgent issue. :)

 We are now discussing it also in IRC. ckeen checked on his BSD system,
 and the UDP binding worked. We ran into other problems, though, the
 signal() calls don't seem to work :(

ctrl-c when repl is running is not working on obsd. not sure if this
is related to the signal() call. it's in my todo list.


 Too bad ...

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: running test suite in mac osx error: IP bind error: Address

2011-06-10 Thread Edwin Eyan Moragas
whopee!

thanks Alex and ckeen!

On Fri, Jun 10, 2011 at 8:24 PM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 We are at it ... :)

 We've got it!! Thanks to ckeen! :)

 There were actually two problems with the OpenBSD version:

 1. Signal handling was wrong. There was the possibility of an array
   out-of-bound access because of a non-portable max signal number.

 2. UDP handling was indeed wrong. The port was used twice during the
   tests, and not closed in between. It is just that Linux doesn't give
   an error in that case.

 Both should be fixed now.

 If you like to try, please download the latest version, e.g.

   wget software-lab.de/picoLisp.tgz


 Many thanks for your bug report!

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: running test suite in mac osx error: IP bind error: Address

2011-06-10 Thread Edwin Eyan Moragas
downloaded and ran the unit tests

now runs fine on osx snow leopard and obsd 4.8 32 bit.

thanks a bunch again guys!

On Fri, Jun 10, 2011 at 9:01 PM, Edwin Eyan Moragas e...@yndy.org wrote:
 whopee!

 thanks Alex and ckeen!

 On Fri, Jun 10, 2011 at 8:24 PM, Alexander Burger a...@software-lab.de 
 wrote:
 Hi Edwin,

 We are at it ... :)

 We've got it!! Thanks to ckeen! :)

 There were actually two problems with the OpenBSD version:

 1. Signal handling was wrong. There was the possibility of an array
   out-of-bound access because of a non-portable max signal number.

 2. UDP handling was indeed wrong. The port was used twice during the
   tests, and not closed in between. It is just that Linux doesn't give
   an error in that case.

 Both should be fixed now.

 If you like to try, please download the latest version, e.g.

   wget software-lab.de/picoLisp.tgz


 Many thanks for your bug report!

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: android picolisp using ndk/jni

2011-07-07 Thread Edwin Eyan Moragas
Hi Doug,

you've been pretty busy. :)

cheering everybody on...

/e

On Thu, Jul 7, 2011 at 4:43 PM, Doug Snead semaphore_2...@yahoo.com wrote:
 http://developer.android.com/sdk/ndk/overview.html :
 Typical good candidates for the NDK are self-contained, CPU-intensive 
 operations that don't allocate much memory, such as signal processing, 
 physics simulation, and so on.

 Ok, here's a plan for :-) a real Android picolisp ... start by taking a 
 version of picolisp, and begin cutting it back by dropping everything ndk 
 c/c++ headers do not support.    So, the idea would be you'd get much of 
 picolisp, hopefully more than minipicolisp, at least as much as ersatz, (I 
 would think), and with no java interpretation penalty for the lisp 
 interpreter.

 re: ... that don't allocate much memory. Fine; allocate what you need per 
 application on init (from java), pass it to android picolisp to use.


 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: The PicoLisp Ticker

2011-07-15 Thread Edwin Eyan Moragas
On Fri, Jul 15, 2011 at 4:13 PM, Doug Snead semaphore_2...@yahoo.com wrote:

 I think you created a bot-trap :-)


aha! that figures.

i'm subscribed to google alerts with 'picolisp' and 'pico lisp' as
keyword. i have gotten 4 so far from that wacky ticker of yours.

but don't remove it, please! it *is* fun.


 --- On Fri, 7/15/11, Alexander Burger a...@software-lab.de wrote:

 From: Alexander Burger a...@software-lab.de
 Subject: The PicoLisp Ticker
 To: picolisp@software-lab.de
 Date: Friday, July 15, 2011, 12:58 AM
 Hi all,

 let me share my funny experiences about the PicoLisp
 Ticker, and how it
 is handled by Mr. Google:

    http://picolisp.com/5000/-2-1i.html

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


doProve (was Re: Ninety-Nine Lisp Problems: pilog)

2011-07-16 Thread Edwin Eyan Moragas
 (BTW - Many people might not realise the heart of pilog, the prove function, 
 is written in C and seems very fast. For some prolog applications, it may be 
 fast or faster than compiled prologs - would like to see some benchmarks to 
 investigate that feeling. But for years, I was under the false impression 
 that pilog was completely written in lisp and so pilog programs were doubly 
 interpreted, but I was wrong: the heart of the pilog interpreter is C.)



now this got me interested. does Alex, or anybody else, have a
picolisp version of the doProve() and doUnify() c functions?

/e
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: doProve (was Re: Ninety-Nine Lisp Problems: pilog)

2011-07-17 Thread Edwin Eyan Moragas
Hi Alex,

On Sun, Jul 17, 2011 at 3:55 PM, Alexander Burger a...@software-lab.de wrote:

 Hmm, after some searching, it seems I have only a fragment of some
 initial version, when I experimented in Lisp before I rewrote the time
 critical parts in C.

 There is 'prove', but 'unify' seems missing. Anway:

thanks for this! i'll find this useful for my personal research. :)

cheers

/e

 
 (de prove (Q)
   (when Q
      (use (N NL Alt Tp1 Tp2 Env E)
         (back)
         (while (or Tp1 Tp2)
            (cond
               (Alt
                  (ifn
                     (setq E
                        (unify (car NL) (cdar Tp1) N (caar Alt) Env) 
 )
                     (or (setq Alt (cdr Alt)) (back))
                     (when (cdr Alt)
                        (push Q
                           (cons N NL (cdr Alt) Tp1 Tp2 Env) ) )
                     (push 'NL N)
                     (inc 'N)
                     (setq
                        Tp2 (cons (cdr Tp1) Tp2)
                        Tp1 (cdar Alt)
                        Env E )
                     (off Alt) ) )
               ((not Tp1)
                  (setq  Tp1 (pop 'Tp2)  NL (cdr NL)) )
               ((=T (car Tp1))
                  (while (= (caaar Q) (car NL))
                     (pop Q) )
                  (pop 'Tp1) )
               ((num? (caar Tp1))
                  (setq E (eval (cdar Tp1)))
                  (push 'NL (get NL (caar Tp1)))
                  (setq  Tp2 (cons (cdr Tp1) Tp2)  Tp1 E) )
               ((pat? (caar Tp1))
                  (if
                     (and
                        (eval (cdar Tp1))
                        (unify (car NL) (caar Tp1) (car NL) @ Env) )
                     (setq  Tp1 (cdr Tp1)  Env @)
                     (back) ) )
               ((not (setq Alt (get (caar Tp1) T)))
                  (back) ) ) )
         (let R NIL
            (for (L Env (cdr L) (cdr L))
               (when (=0 (caaar L))
                  (push 'R
                     (cons (cdaar L) (lookup 0 (cdaar L) Env)) ) ) )
            (or R (bool Env)) ) ) ) )

 (de back ()
   (setq
      Env (pop Q)
      N (pop 'Env)
      NL (pop 'Env)
      Alt (pop 'Env)
      Tp1 (pop 'Env)
      Tp2 (pop 'Env) ) )

 (de - X
   (lookup
      (get NL (or (cadr X) 1))
      (car X)
      Env ) )

 (de unifyEnv (Lst)
   (setq Env
      (unify (cadr NL) Lst (car NL) Lst Env) ) )
 

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


difference between (let) and (bind)

2011-07-27 Thread Edwin Eyan Moragas
Hi list,

looking at the docs, looks like (bind) is just a fancy way of doing
(let). is this correct? i tried looking at the source but i'm still
trying to decipher it.

also checked out wl.java. both (let) and (bind) are quite similar.

is this so?

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: difference between (let) and (bind)

2011-07-27 Thread Edwin Eyan Moragas
Hi Tomas,

On Thu, Jul 28, 2011 at 1:27 AM, Tomas Hlavaty t...@logand.com wrote:
 Hi Edwin,

 roughly speaking, bind is a function while let is a macro.  They differ
 in argument evaluation.  bind is programmable while let is more of a
 syntax thingy.

thank you for this.

thinking about it a bit, i can just do away with one and live with the other?

say, can i just live with (bind)?


 Cheers,

 Tomas
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: difference between (let) and (bind)

2011-07-27 Thread Edwin Eyan Moragas
On Thu, Jul 28, 2011 at 4:48 AM, Tomas Hlavaty t...@logand.com wrote:
 Hi Edwin,

 thinking about it a bit, i can just do away with one and live with the
 other?  say, can i just live with (bind)?

 yes, but it is more convenient to write let in your programs instead of
 the bind with constructing the binding list manually.  However, in
 certain situations, one needs an evaluating version, e.g. when you
 construct code programmatically.  I hit this situation in the wl

reading the docs again after this, (let) evaluates while (bind) does
not. i hope i got that right.

(yes sir, still learning. i'm actually in the process of skinning
minipicolisp to retain the wl functions. what i'm trying to do is
understand the minipicolisp interpreter)

 interpreter (the one written in Java) where I wanted to implement as
 much as possible in pure picolisp (as opposed to Java).  There I needed
 evaluating versions of some functions.  I don't remember off the top of
 my head which cases were those functions but I usually named them with a
 leading dot character to make it obvious they were internal.  When you
 have the evaluating version it becomes easy to implement the macro
 version on top of them.

i see. but i still have to experience them firsthand. looking at the
java.wl, you have (up.) and (if.).

i'll let this stew some. please don't hesitate to shed further
enlightenment on this tho.

thank you.

/e

 Cheers,

 Tomas
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


picolisp on openbsd amd64

2011-08-08 Thread Edwin Eyan Moragas
Hi list,

tried compiling picolisp on an openbsd amd64 install and it seems out of wack.

i tried diddling the gcc flags to no avail. as of now, i don't have
any solution to this.

to make things compile:
-  added '-fPIC' to CFLAGS in the Makefile.
- changed all instances of -m32 to -m64

giving dbg a spin:

eyan@imango $ ./dbg
n/li open: No such file or directory
?

i'm not using and64 full time at the moment, and won't be running
picolisp code in it. someone out there might just have the solution.

best

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: picolisp on openbsd amd64

2011-08-08 Thread Edwin Eyan Moragas
Hi Tomas

On Tue, Aug 9, 2011 at 2:50 AM, Tomas Hlavaty t...@logand.com wrote:
 Hi Edwin,

 tried compiling picolisp on an openbsd amd64 install and it seems out

 - changed all instances of -m32 to -m64

 the -m32 is there for a reason, you can't just replace it and expect it
 to work:-D

i figured as much. haha! was just shooting blindly.


 I suppose you are trying to compile the C version, which is 32 bit only.

ah no. just trying to see if the 32 bit version builds correctly on obsd-amd64.


 Alex implemented the 64 bit version in assembly so it is a different
 program (in src64 directory).  Try to build this one if you are after 64
 bit picolisp.

yeah. :)


 Cheers,

 Tomas
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


evaluating versions (was Re: when to use (prog) or (run))

2011-08-08 Thread Edwin Eyan Moragas
Hi Tomas,

On Tue, Aug 9, 2011 at 2:46 AM, Tomas Hlavaty t...@logand.com wrote:
 Hi Edwin,

 having difficulty knowing when to use (prog) or (run).
 bottomline is, when is it best to use one over the other?

 'run' is more general and evaluating version, i.e. it's a function
 suitable for manipulating programs (aka eval) with other bell and
 whistles like environment control.  'prog' is a macro, i.e. a
 convenience shortcut for writing text of a program by hand.  You can
 build the macro version on to of the evaluating version.

thanks much for the replies.

every time i think i got something, i run into more questions.

i've run across 'evaluating' and 'non evaluating' versions of
functions. not just in this list but also in reading materials. i
haven't experienced the difference between the two yet.

in any case, i guess i'll just have to grow into it. think and program
in the language more. even tho it would be slow. :)

best

/e
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: evList2() in minipicolisp

2011-08-15 Thread Edwin Eyan Moragas
Hi Alex,

thanks for a thorough explanation as always!

cheers

On Tue, Aug 16, 2011 at 5:01 AM, Alexander Burger a...@software-lab.de wrote:
 Hi Edwin,

 need some help. when is evList2() called in minipicolisp?
 i can't decipher when it is called.
 comments are mine.

 if (isNum(foo = car(ex)))
       return ex; /* return numbers as is */

 Right. This is the case where the evaluated list starts with a number,
 e.g. (1 2 3 4), or also (123 a b c).


 if (isCell(foo)) {

 'foo' is the CAR of the list, and it is a list here. We might have a
 call like ((get 'x 'y) 1 2 3), so 'foo' is (get 'x 'y) which - when
 evaluated - is supposed to return a function.


       if (isNum(foo = evList(foo)))
          return evSubr(foo, ex); /* if a list evaluates to a number,
 call a C subroutine */

 Yes. Evaluation of (get 'x 'y) resulted in a number, so a C function is
 called.

       return evList2(foo, ex); /* then... ? */

 'foo' is not a number, so these are the remaining possibilities: It must
 be either a symbol or a list. It might be a symbol if we have e.g. (x 1
 2 3) where the value of 'x' is 'y', which in turn is defined as a
 function (or something else suitable to a recursive invocation of the
 whole 'evList' machinery). Otherwise, it is a list which is taken as a
 function (i.e. (params . body).


 'evList2' is put into a separate function for a single reason: The value
 must be pushed on the stack to be safe from garbage collection (the
 'Push' marcro at the start of 'evList2').

 This problem we have only in the C version, because the compiler
 allocates space in the stack frame for 'c1' on every call to 'evList',
 which is a waste of stack space in most cases, as normal function
 calls don't pass through here.

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


help in deciphering isSymb() macro

2011-08-27 Thread Edwin Eyan Moragas
Hi List,

came across these macros in pico.h:

#define isSym(x)(num(x)WORD)
#define isSymb(x)   ((num(x)(WORD+2))==WORD)

what is the intent of isSymb()? as compared to isSym()?

yes, still on that long path of understanding the C implementation.
:). this is still minipicolisp by the way.

cheers

/e
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Unsubscribe

2011-10-11 Thread Edwin Eyan Moragas
Good bye Edwin Eyan Moragas e...@yndy.org :-(
You are now unsubscribed



-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Subscribe

2014-05-25 Thread Edwin Eyan Moragas
Hello Edwin Eyan Moragas e...@yndy.org :-)
You are now subscribed



-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Unsubscribe

2014-09-17 Thread Edwin Eyan Moragas