Re: Modularization / Shared Libraries

2017-02-08 Thread Erik Gustafson
Thank you. Could you explain this code:

(load
   "@test/src/main.l"
   "@test/src/apply.l"
   "@test/src/flow.l"
   "@test/src/sym.l"
   "@test/src/subr.l"
   "@test/src/big.l"
   "@test/src/io.l"
   "@test/src/db.l"
   "@test/src/net.l"
   "@test/src/ext.l"
   "@test/src/ht.l" )

How is the "@" character being used here?


In this case it is for "home directory substitution". The PL interpreter
remembers the pathname from which it was called and that path can be
referenced using '@'.

Say you have a local PL installation residing in the directory
/home/you/picoLisp and you want to start the interpreter with the HTTP
library loaded. You can just write

  [picoLisp]$ ./pil @lib/http.l +

Instead of

   [picoLisp]$ ./pil /home/you/picoLisp/lib/http.l +

Kind of a convoluted example, maybe.

So all the '@test/...'s from above mean to load different files from the
'test' directory of the particular PL installation that was called.

'@' is a particularly context sensitive symbol in PL. Here's a quick
reference to help you sort out the different uses:

http://picolisp.com/wiki/?AtMark

Best,
Erik


Re: Modularization / Shared Libraries

2017-02-08 Thread Alexander Burger
Hi Christopher,

> Thank you. Could you explain this code:
> 
> (load
>"@test/src/main.l"
>"@test/src/apply.l"
>...
> 
> How is the "@" character being used here? The reference documentation
> mentions the wildcard character in conjunction with match and fill, but
> I'm not clear on what it means here.

This is indeed not obvious.

"@" has special meaning in many different contexts. There is even an article
about them: http://picolisp.com/wiki/?atmark - the above use case is mentioned
under "path names".

The primary documentation is in http://software-lab.de/doc/ref.html#invoc in the
paragraph:

   In any case, the directory part of the first file name supplied (normally,
   the path to "lib.l" as called by 'pil') is remembered internally as the
   PicoLisp Home Directory. This path is later automatically substituted for any
   leading "@" character in file name arguments to I/O functions (see path).

or also in http://software-lab.de/doc/refP.html#path

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


Re: Modularization / Shared Libraries

2017-02-08 Thread Christopher Howard
Thank you. Could you explain this code:

(load
   "@test/src/main.l"
   "@test/src/apply.l"
   "@test/src/flow.l"
   "@test/src/sym.l"
   "@test/src/subr.l"
   "@test/src/big.l"
   "@test/src/io.l"
   "@test/src/db.l"
   "@test/src/net.l"
   "@test/src/ext.l"
   "@test/src/ht.l" )

How is the "@" character being used here? The reference documentation
mentions the wildcard character in conjunction with match and fill, but
I'm not clear on what it means here.

On 02/08/2017 04:47 AM, Mike Pechkin wrote:
> 
> 
> On Wed, Feb 8, 2017 at 3:20 PM, Christopher Howard
> >
> wrote:
> 
> Hi all, picolisp newbie here. I was trying to figure out how to
> "modularize" my code; there doesn't seem to be a module system built in,
> but the reference doc did mention support for shared libraries. A few
> questions:
> 
> 
> ​As I can understand you mix two different functions - load and native
> 
>  
> 
> 
> 1) On Gnu/Linux, how do you put code into a shared library?
> 
> 
> ​Look how builtin tests splits to files:​
> https://bitbucket.org/mmamkin/picolisp/src/e33e90fb0e11aa6cdb8634c8ef73b1dac5c1f60a/lib/test.l?at=default=file-view-default
> 
>  
> 
> 2) Where on the system does picolisp search for shared libraries?
> 
> 
> native searches in dirs from ldconfig -p​
> 
> 

-- 
Christopher Howard, Computer Assistant
Alaska Satellite Internet
3239 La Ree Way, Fairbanks, AK 99709
907-451-0088 or 888-396-5623 (toll free)
fax: 888-260-3584
mailto:christop...@alaskasi.com
http://www.alaskasatelliteinternet.com
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Modularization / Shared Libraries

2017-02-08 Thread Mike Pechkin
On Wed, Feb 8, 2017 at 3:20 PM, Christopher Howard <
christopher.how...@qlfiles.net> wrote:

> Hi all, picolisp newbie here. I was trying to figure out how to
> "modularize" my code; there doesn't seem to be a module system built in,
> but the reference doc did mention support for shared libraries. A few
> questions:
>

​As I can understand you mix two different functions - load and native



>
> 1) On Gnu/Linux, how do you put code into a shared library?
>
>
​Look how builtin tests splits to files:​
https://bitbucket.org/mmamkin/picolisp/src/e33e90fb0e11aa6cdb8634c8ef73b1dac5c1f60a/lib/test.l?at=default=file-view-default



> 2) Where on the system does picolisp search for shared libraries?
>

native searches in dirs from ldconfig -p​


Modularization / Shared Libraries

2017-02-08 Thread Christopher Howard
Hi all, picolisp newbie here. I was trying to figure out how to
"modularize" my code; there doesn't seem to be a module system built in,
but the reference doc did mention support for shared libraries. A few
questions:

1) On Gnu/Linux, how do you put code into a shared library?

2) Where on the system does picolisp search for shared libraries?

-- 
https://qlfiles.net
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe