Re: wiki function: _render

2021-09-11 Thread John Duncan
For one thing, I don’t think NAME is defined on H1-H6 like it is for INPUT
or A.

John

On Sat, Sep 11, 2021 at 05:47 Alexander Burger  wrote:

> Hi Jean-Christophe,
>
> > I'm just exploring my very first lines of picolisp code, and it is going
> to
> > take some time to get something done... :)
>
> Very good! :)
>
>
> > The wiki html seems to be generated by _render, which is defined this
> way:
> >
> > (de _render (C D)
> > ...
> > for the code for html headers is:
> >
> > (case C
> > (("1" "2" "3" "4" "5" "6")  # Heading
> > (_render "h" C)
> > ...
> > with C being equal to the number that was used to define the header
> (wiki syntax: n{Heading}).
>
> Correct.
>
>
> > So, my first idea would be, instead of adding complexity to the wiki
> syntax to specify ID values, to use the value of the heading as the value
> of the ID and output this:
> >
> > My heading
> >
> > That does not guarantee that we have unique ID values, which is a
> requirement
> > in HTML,
>
> Is there a reason not to use   instead?
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>
-- 
John Duncan


Re: compilation error

2021-09-02 Thread John Duncan
Gnu make or Berkeley make? Is this Linux?

On Thu, Sep 2, 2021 at 07:44  wrote:

> I didn’t touch the files in any way. No make clean either.
>
> --
>
>   vuk...@fastmail.com
>
> On Thu, Sep 2, 2021, at 3:08 PM, Alexander Burger wrote:
> > On Thu, Sep 02, 2021 at 02:57:13PM +0400, vuk...@fastmail.com wrote:
> > > yes the latest one.
> >
> > Just to be sure: You did not "make clean" before you built it the first
> time,
> > right? Or modified "src/base.ll" in some other way?
> >
> > Because the error message complains something about base.ll, and this
> file comes
> > pre-built in the tarball for the first bootstrap.
> >
> > ☺/ A!ex
> >
> > --
> > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> >
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>
-- 
John Duncan


Re: compilation error

2021-09-01 Thread John Duncan
I feel you have a stray character or are using the wrong version of make.

On Wed, Sep 1, 2021 at 02:47  wrote:

> llvm is version 12
>
> --
>
>   vuk...@fastmail.com
>
> On Tue, Aug 31, 2021, at 6:50 PM, Alexander Burger wrote:
> > Hi Vid,
> >
> > > I am trying to update picolisp. I dowloaded the rolling release.
> > >
> > > current version: 21.1.25
> > >
> > > when I try to compile I get the following error on my Manjaro box:
> > >
> > > [pil21]$ (cd src; make)
> > > opt: base.ll:1:1: error: expected top-level entity
> > > source_filename = "base.l"
> > > ^
> > > make: *** [Makefile:40: base.bc] Error 1
> >
> > I haven't seen this error, but perhaps the LLVM version is too old? It
> needs at
> > least 7.
> >
> > ☺/ A!ex
> >
> > --
> > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> >
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>
-- 
John Duncan


Re: New blog - "PicoLisp for beginners"

2021-09-01 Thread John Duncan
This is great, thank you so much!

On Wed, Sep 1, 2021 at 06:03 Mia Burger  wrote:

> Hi all,
>
> I'm Mia, one of Alex' daughters, nice to meet you!
>
> I started to play around with PicoLisp a few months ago. So I checked
> the available resources, and after a while I thought it might be good to
> have a little bit more "beginner's level" content, with a low threshold
> and fun to read. Because I feel that a lot of it is already quite
> advanced (or of rather mixed difficulty), which can be quite frustrating.
>
> So we started to put up a blog together. Today I have posted the first
> article, and there will be one post per day for the next few weeks. If
> you're interested, feel free to follow!
>
> - This is the blog homepage: https://picolisp-blog.hashnode.dev/
>
> - And here is the repository with some ideas for structure and content:
> https://gitlab.com/picolisp-blog/structure
>
> I'm always happy about feedback or further inputs - for example, I think
> it would be really nice to feature some community projects, like Nehal's
> mind maps. Always open for your ideas! Also, please let me know if
> something requires further explanation or maybe is even wrong.
>
>
> Wish you a nice rest of the week!
>
> Best regards, Mia
>
>
> PS. Also I have to apologize, obviously most of the content is not
> originally from me but from the community. Sometimes I even copied
> complete sentences if I liked them. Hope that was ok!
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>
-- 
John Duncan


Re: math.l library in picoLisp

2021-05-17 Thread John Duncan
I also didn’t receive email from SJain. Did the mail program abort while
sending some mail?

John

On Mon, May 17, 2021 at 07:26 Alexander Burger  wrote:

> On Mon, May 17, 2021 at 11:38:05AM +0200, Alexander Burger wrote:
> > It is frustrating that E-Mail is so unreliable.
>
> I wonder whether a #picolisp group in Matrix would be better in the long
> range.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>
-- 
John Duncan


Re: Licence Dilemma

2020-11-22 Thread John Duncan
I think it should be fine. Picolisp is distributed as source code. The code
implementing readline can be GPL licensed. The code implementing everything
else can be a less restrictive license if desired. Binaries including
readline can be distributed as GPL, binaries without readline can be MIT.
The README can say, "if you need to use this in an GPL-incompatible way,
you have to leave out the readline support file".

The important thing is that we're talking about binaries and source code. A
single GPL file in a project does not and cannot relicense all the other
files in the project. However, if it is included in the binaries, it
affects the license of the binary.

This should not be a problem for debian distributions, etc.

On Sun, Nov 22, 2020 at 6:24 AM Alexander Williams 
wrote:

> Tomas, you're allowed to relicense the MIT version of PicoLisp you
> received, as GPLv3, as long as you maintain the MIT license text.
>
>
> AW
>
> On Sun, 22 Nov 2020, Tomas Hlavaty wrote:
>
> > what if i don't want to risk going to court because of this?
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


-- 
John Duncan


Re: Bug?

2020-06-22 Thread John Duncan
Ah cool. I’m not familiar with the android bit so wasn’t sure how the UI
works.

On Mon, Jun 22, 2020 at 01:48 Alexander Burger  wrote:

> On Mon, Jun 22, 2020 at 05:27:37AM +, Shaughan Lavine wrote:
> > Does something have to be allowed for forms.l to work? I'm getting
> > '*Get [::1] not allowed'.
>
> That's right. Some global variables used in HTTP transactions need to be
> allowed. But this is done automatically in the first few lines of
> @lib/form.l
> when it is loaded.
>
>
> > And I'm still stumped about '"@doc/form/refD.html" -- Open error:
> Permission denied' without sudo.
>
> Uh, yes. But I really have no clue. Is it possibly an SELinux issue?
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>
-- 
John Duncan


Re: Bug?

2020-06-21 Thread John Duncan
That I don't know. I don't know if you can modify the scanning part of the
reader with picolisp, the examples I've seen all work on atoms. You might
have to read bytes and process it yourself. Or rewrite the scanner in the C
source.

On Sun, Jun 21, 2020 at 3:43 PM Shaughan Lavine 
wrote:

> Thanks for the rapid reply! This is for an android app. I can hardly
> require an end user to supply a decimal point. Of course, I can look for
> one and supply it if missing. I just wondered if, since this must be a
> common use case, there was a better way.
>
>
> Sent from ProtonMail mobile
>
>
>
>  Original Message ----
> On Jun 21, 2020, 12:16 PM, John Duncan < duncan.j...@gmail.com> wrote:
>
>
> Not a bug, this is the design of the reader (symToNum). Can you make input
> include the decimal point?
>
> On Sun, Jun 21, 2020 at 14:34 Shaughan Lavine  > wrote:
>
>> Isn't this a bug?
>> ---
>> :(scl 2)
>> :212
>> 212
>> :212.
>> 21200
>> -
>> Shouldn't 212 be equal to 212. ?
>> If not, how do I force a "." after an integer input by a user? Do I
>> really have to use a string input and look for a "."?
>>
>>
>> Sent from ProtonMail mobile
>>
>>
>> --
> John Duncan
>
>

-- 
John Duncan


Re: Bug?

2020-06-21 Thread John Duncan
Not a bug, this is the design of the reader (symToNum). Can you make input
include the decimal point?

On Sun, Jun 21, 2020 at 14:34 Shaughan Lavine 
wrote:

> Isn't this a bug?
> ---
> :(scl 2)
> :212
> 212
> :212.
> 21200
> -
> Shouldn't 212 be equal to 212. ?
> If not, how do I force a "." after an integer input by a user? Do I really
> have to use a string input and look for a "."?
>
>
> Sent from ProtonMail mobile
>
>
> --
John Duncan


Re: Do free Open Source Foundation's Software Stacks fall under US Export Law?

2020-05-06 Thread John Duncan
Another benefit of llvm is you get their dataflow analysis and optimization
for free, on the myriad ARM and x64 microarchitectures as optimized as you
like. That is harder to do in custom abstract assembly, as you’d have to
maintain a little zoo of targets.

On Wed, May 6, 2020 at 13:08  wrote:

> > On 06.05.20 18:42, John Duncan wrote:
> > Picolisp is interpreted. Even the llvm version is just creating an
> > interpreter. There is no JIT.
> Exactly!
>
> Guido, you should really stop talking about things you so obviously have
> no understanding of.
> There is NO COMPILING when executing program written in PicoLisp. Nowhere

Re: Picolisp is the only language in the world, that can reason about database contents!

2020-05-06 Thread John Duncan
La seguridad por la oscuridad?



On Wed, May 6, 2020 at 12:44 Guido Stepken  wrote:

> Υπάρχουν πάντοτε άνθρωποι που δεν έχουν πρόσβαση. Και δεν ξέρουν καν γιατί
> κάνουν αυτό. Ειδικά σε περιόδους μαζικών πολιτικών αλλαγών. Αυτός είναι
> επίσης ο λόγος για τον οποίο ο Βαρουφάκης παραιτήθηκε. Αλλά είχε δίκιο με
> πολλούς τρόπους.
>
> Am Mittwoch, 6. Mai 2020 schrieb Yiorgos [George] Adamopoulos <
> yiorgos.adamopou...@gmail.com>:
> > Βρίσκω τον τρόπο που γίνεται η συζήτηση αγενή.
> >
> > On Wed, May 6, 2020 at 6:48 PM Guido Stepken  wrote:
> >>
> >> Je ne veux pas faire sursauter trop tôt nos collègues lecteurs des
> États-Unis. Peut-être tu veux attendre quelques semaines de plus jusqu'à ce
> que des choses importantes soient décidées au niveau de l'UE.
> >>
> >> Mais je peux toi assurer que des parties importantes viennent de France.
> >>
> >> Ce sera une grande surprise pour eux.
> >>
> >> Amuse-toi bien!
> >>
> >> > I'm curious, what are those two similar other tools?
> >> >
> >> > Best,
> >> >
> >> > Eric
> >> >
> >> >>> --
> >> >>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> >> >>>
> >
> >
> >
> > --
> > keep raising the bar
> >
> > --
> > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
> >

-- 
John Duncan


Re: Do free Open Source Foundation's Software Stacks fall under US Export Law?

2020-05-06 Thread John Duncan
Picolisp is interpreted. Even the llvm version is just creating an
interpreter. There is no JIT.

On Wed, May 6, 2020 at 12:36 Guido Stepken  wrote:

> Am Mittwoch, 6. Mai 2020 schrieb :
>
> > Read Wikipedia:
> >
> > LLVM allows code to be compiled statically, as it is under the
> traditional GCC system, or left for late-compiling from the IR to machine
> code via just-in-time compilation (JIT)
>
> Wikipedia might have missed the chapter: "Extreme Laziness - Using Compile
> Callbacks to JIT from ASTs".
>
> Since the AST (Abstract Syntax Tree) in any Lisp is changing all the time,
> the JIT engine *has to* post-jit continuously to keep up the full execution
> speed.
>
> That's what will give pil21 a real performance boost over over any 'static
> compiled' implementation.
>
> Means: PicoLisp will continuously check its own AST for changes (diff) and
> then ASAP recompile what's necessary in the background on a second CPU.
>
> But that also means: pil21 "binary" size will become much larger, since it
> will contain the processor specific ASTtoMachine Code parts.
>
> But, indeed, you can also use LLVM and Clang to compile the C version of
> Picolisp as usual, 'statically'. But that's almost pure nonsense, gives you
> no real advantage over e.g. GCC .
>
> You may also compile PicoLisp C version on ployglot (many programming
> languages in one source) GraalVM (Truffle) and observe, how PicoLisp gets
> faster and faster after a certain warm up time. GraalVM (Truffle) is same
> HotSpot post JIT optimization concept.
>
> Have fun!
>
-- 
John Duncan


Re: Do free Open Source Foundation's Software Stacks fall under US Export Law?

2020-05-06 Thread John Duncan
Hey Alex,

Just wanted to tell you how much I appreciate your work. I hope you find a
blowhard like Guido amusing and not too irritating. I get the impression
he’s hardly written a line of code in his life, and that was probably in
Java.

Take care!

John

On Wed, May 6, 2020 at 07:59 Alexander Burger  wrote:

> On Wed, May 06, 2020 at 12:51:33PM +0200, Guido Stepken wrote:
> > Use Mike's DYNASM JIT Engine. Better, faster, smaller (tiny, in
> comparison
> > to LLVM), more portable. He's from Munich.
>
> Useless.
>
> Sigh! How often have I told here that the main purpose of pil21 is
> portability?
> I need it to build PilBox on iOS, and to support RISC-V architectures. In
> fact
> *all* 64-bit architectures, as I got tired of porting pil64.
>
> And I need it NOW!! Not *perhaps* in ten years.
>
> Also, please shut up with WebAssembly. I need something running on POSIX
> for
> server side applications. Something in the browser is as useful for me as
> chewing gum for my cat.
>
> — Alex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>
-- 
John Duncan


Re: Talking about algorithms and their BIG(O) behaviour, efficiency, other JIT IR compilers ...

2020-05-03 Thread John Duncan
I took my algorithms class from one of the inventors of fusion trees. It’s
more of a stunt than anything else. He invented it just to prove the point.
The constant factor of each operation dwarfs the comparison it avoids. But
the big-O is relatively small. They are still impractical.

Pico operates on lists. Its fundamental data structure tends toward linear
algorithms. Trees are also possible where needed. In general, this is not
the fastest, but it’s usually good enough.

On Sun, May 3, 2020 at 16:57 Guido Stepken  wrote:

> Certainly you've heard of Fusion² Trees, Exponential² Trees, Ryabko³
> Trees, Bit Twiddling Hacks⁴ in C ... this is, what i consider the high
> class of programming excellence, every programmer not only should have
> heard of, but also should have implemented on his/her own.
>
> This class of algorithms shows much better BIG(O) behaviour, often
> O(log(log(n)) or O(log₃₂(n)) on 32 bit, O(log₆₄(n)) on 64 bit in searching
> through vasts amounts of data in almost ZERO time.
>
> They're quite rare in e.g. Apache Foundation or Linux Foundation software
> ("pile of shit") packages, since they allow even better search times on a
> $25 Raspberry Pi Zero than on a $100.000 28 Core Intel Dual CPU Xeon
> machine. Of course, this is not in the interest of US industry.
>
> Most interesting for Lisp implementors is the Ryabko aka Fenwick Tree,
> since it easily allows implementing a highly efficient multi generational
> (ageing memory pools) garbage collectors as being found in our German
> version of LLVM, the brilliant LuaJIT DYNASM enginge, which has almost
> everything, that is publically considered as 'state of the art' JIT
> compiler technology.
>
> Of course DYNASM is faster, smaller, better than LLVM and generates
> machine code for even smallest embedded devices (even runs on those!!!),
> has the much superiour "Four Color Multi Color, Multi Generational Mark
> Sweep GC".
>
> That little thing with the long name is far superior to every other
> Garbage Collector, i've seen in my life:
>
> http://wiki.luajit.org/SSA-IR-2.0
> http://wiki.luajit.org/New-Garbage-Collector
>
> Lua is a very Lisp like language, since its smallest data structure is a
> two (cons) cell unit, one data and one pointer to next cell. But comes with
> INFIX notation.
>
> And since Lua Programming Language data structures are so similar to those
> of Lisp, there also is a Lisp port onto that tiny LuaJIT DYNASM engine,
> kind of transpiler, written in - Lua! Piece of cake in terms of LoC
> (compare to pil21):
>
> https://github.com/bakpakin/Fennel/blob/master/README.md
>
> And, of course, you get C speed with that stuff, with far lesss lines of
> code. Maintainable, security reviews can easily be done ... much smaller
> memory footprint, much faster JIT compile times, thanks to DYNASM:
>
> http://luajit.org/dynasm.html
>
> Needless to say, that this stuff is far superior to anything you can find
> made by US Foundations with their billions of lines of unmaintainable bloat
> ...
>
> I am using that stuff now since a while - both the superior algorithms as
> well as some of our own German/EU software stacks and i only can tell you,
> what i've already mentioned:
>
> "Don't use US Software Stacks!!! - Billions of lines of code, millions of
> bugs, thousands of NSA backdoors, hundreds of slow algorithms!!!"
>
> I hope, you regard my "findings" for you quite interesting and convincing,
> see you using next generation of high quality software, that does not fall
> under US software export restrictions, since it's - "Made in Germany"!!! ;-)
>
> Finally you also should have a look into the last link, "Bit Twiddling
> Hacks in C". You will be _very surprised_ what you will find there.
> Needless to say, that this collection of tips and tricks also applies to
> other programming languages, making your code much faster (and much
> less readable and understandable, if you don't put a link into the
> comments)! ;-)
>
> Have fun!
>
> Best regards, Guido Stepken
>
> ¹) https://en.wikipedia.org/wiki/Fusion_tree
> <https://en.wikipediaorg/wiki/Fusion_tree>
> ²) https://en.wikipedia.org/wiki/Exponential_tree
> ³) https://en.wikipedia.org/wiki/Fenwick_tree
> ⁴) https://graphics.stanford.edu/~seander/bithacks.html
> <https://graphics.stanford.edu/~seander/bithackshtml>

-- 
John Duncan


Re: divmod?

2020-05-03 Thread John Duncan
For heavy number crunching, picolisp might not be appropriate. In modern
systems you would probably want something that used the vector
instructions. But if it’s a few divisions here and there, you’d be
surprised how little the efficiency in clock cycles  matters anymore.

On Sun, May 3, 2020 at 14:28 Wilhelm Fitzpatrick  wrote:

>
> >> I'm not finding such a thing in the function reference, but asking on
> the off chance I'm
> >> overlooking it. Is there a way in Picolisp to get a division result and
> remainder as a single
> >> operation?
> > Sure
> > http://ix.io/2kBM
>
> Thanks! But as Alex intuited, I was looking to leverage the underlying
> processor operation that returns both parts of the integer divide in a
> single operation. But if I follow his response correctly, the cost of
> building the memory representation of the answer swamps the actual cost
> of the divide, and that's going to be similar regardless of if the
> divide and remainder wind up being one machine instruction or two.
>
> -wilhelm
>
>
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>
-- 
John Duncan


Re: Digging into Symbols

2020-04-28 Thread John Duncan
It’s hard to predict cache behavior without an actual workload, so i would
recommend using cachegrind with a real program (not a benchmark) to
evaluate the cost of doing things one way or the other.

On Tue, Apr 28, 2020 at 05:24 Guido Stepken  wrote:

> Certainly. But how is it *implemented* internally? Mostly you suffer
> massive performance loss when prepending, because complete linked list gets
> moved to a new place in memory. If internal representaion ist a double
> cell, one value, pointer to next, then you quickly suffer CPU cache misses.
> Wild jumps across memory with upto 18 CPU waitstates for random access.
> Means: Your proud 4 GHz machine gets slower than a 250 MHz embedded ESP32
> ARM CPU. E.g Python dqueue doesn't show any performance loss here.
>
> Have fun!
>
> Am Dienstag, 28. April 2020 schrieb Wilhelm Fitzpatrick :
> > On 4/27/20 2:42 PM, Guido Stepken wrote:
> >
> >> In most Lisp languages, you only can "append" to a list, never
> "prepend".:
> >
> > "Prepend", aka "add to the beginning" seems the natural (and
> non-destructive) operation of Lisp, e.g.
> >
> > (cons 9 (1 2 3)) -> (9 1 2 3)
> >
> > ..perhaps that is what you meant?
> >
> > -wilhelm
> >
> >
> > --
> > UNSUBSCRIBE: mailto:picolisp@software-labde 
> ?subject=Unsubscribe
> >

-- 
John Duncan


Re: Examples of quote usage instead of lambda

2020-02-06 Thread John Duncan
Thanks, and I probably should have said, "car and cdr of a cell" rather
than a list. Oh well ;)

On Thu, Feb 6, 2020 at 1:16 PM Alexander Burger  wrote:

> On Thu, Feb 06, 2020 at 12:41:51PM -0500, John Duncan wrote:
> > Yeah, it's explained in the reference manual:
> > ...
> > In contrast to other Lisp implementations, the symbol LAMBDA itself does
> > not exist in PicoLisp but is implied from context.
> > ...
> > Hope this helps a bit. Alex would probably have a lot more to say.
>
> Thanks John! No, you explained it very well :)
>
>
> One minor note:
>
> > Picolisp is dynamically scoped.
>
> I would not use the term "scoped" here. Scope is about visibility, so
> PicoLisp
> symbols are globally scoped (per namespace, or per file for transient
> symbols).
>
> Instead, symbols in PicoLisp are *bound* dynamically (as opposed to
> statically
> (or lexically) bound symbols in compiled Lisps). In a compiler, the
> distinction
> between scope and binding is blurred, because the symbols are gone in the
> compiled code anyway.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


-- 
John Duncan


Re: Examples of quote usage instead of lambda

2020-02-06 Thread John Duncan
Yeah, it's explained in the reference manual:

https://software-lab.de/doc/ref.html#ev

Picolisp's evaluation strategy treats any list as a function to be
interpreted. If first element of the list evaluates to a lambda expression,
that is interpreted as a function.

a *lambda expression*. A lambda expression is a list, whose CAR is either a
symbol or a list of symbols, and whose CDR is a list of expressions. Note:
In contrast to other Lisp implementations, the symbol LAMBDA itself does
not exist in PicoLisp but is implied from context.

A lambda function would be a no-op in picolisp because there is no
compiling or creation of closures. Picolisp is dynamically scoped.

The dotted pair syntax (a . b) refers to the car and cdr of a list. if a
and b are both atoms, (a . b) is a list whose cdr is an atom. The list (a
b) can be represented as (a . (b . NIL).

So, (quote a) gives you a, (quote (a)) gives you (a).

Hope this helps a bit. Alex would probably have a lot more to say.

John

On Thu, Feb 6, 2020 at 12:20 PM Lawrence Bottorff  wrote:

> I've been a passive observer for a while, but now I'm really trying to
> grok picolisp. So let's start with the FAQ bit about *I cannot find the
> LAMBDA keyword in PicoLisp. *The example is basically syntax sugar for
>
> ((quote (X Y) (+ X Y)) 3 4)
>
> but this can't be made to work in a Common Lisp--or can it and I'm just
> not doing it right? As I understand it, you have a different sort of quote
> than CL, correct? Could you explain or point me to the docs on that? Also,
> when I looked up quote in the ref I see this
>
> *(quote . any) -> any*
> Returns any unevaluated
>
> What does the dotted cons notation mean? I know I have to lengthen my
> comp-sci stride to grok picolisp, but I might be here with a lot of newbie
> questions for a while. . . .
>
> Thanks,
> Lawrence Bottorff
> Grand Marais, MN, USA
>


-- 
John Duncan


Re: Function similar to Scheme 'foldl'?

2018-10-09 Thread John Duncan
Yes, it makes more sense in reducing type languages like scheme and
Haskell, where its operating model is identical to the recursion that would
normally be implemented.

On Tue, Oct 9, 2018, 4:03 PM Johann-Tobias Schäg 
wrote:

>
> > It is quite inefficient, as it needs to build a new list of > all
> arguments on
> > each call:
> Well i see ways how it could be speed up it up in assembly but only by
> adding lots of complexity.
>
>(conc (rest) (cons I))
>
> > and it has no advantage over a direct inline
> > expression of what it does IMHO.
> > Often it is contra-productive to over-abstract things.
>
> T
>
>


Re: Function similar to Scheme 'foldl'?

2018-10-09 Thread John Duncan
You're right, I was wrong :)

John

On Tue, Oct 9, 2018 at 3:07 PM  wrote:

> On Tue, 09 Oct 2018 19:31 +0200, Alexander Burger wrote:
> > On Tue, Oct 09, 2018 at 01:21:07PM -0400, John Duncan wrote:
> > > Yes, you couldn't reuse the same initial value for a data structure
> like
> > > you would in scheme
> >
> > How do you mean that? As I said, this code is completely free of
> destructive
> > side effects. You can use and reuse any initial value.
>
> Indeed.
>
> $ pil
> (de foldl (F I . @)
>(pass
>   mapc
>   '(@
>  (setq I (apply F (conc (rest) (cons I ) ) )
> -> foldl
> : (setq I 0)
> -> 0
> : (foldl '+ 0 (1 2 3 4))
> -> 10
> : I
> -> 0
>
> "Inside" `foldl` there is some "Hulk smash!"ing going on, but not
> outside.  `foldl` owns `I` and smashes on it with impunity; that's not a
> problem.
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


-- 
John Duncan


Re: Function similar to Scheme 'foldl'?

2018-10-09 Thread John Duncan
Yes, you couldn't reuse the same initial value for a data structure like
you would in scheme

On Tue, Oct 9, 2018, 12:15 PM Alexander Burger  wrote:

> > On Tue, Oct 9, 2018, 10:30 AM Mike  wrote:
> >
> > > hi all,
> > >
> > > My demo code to mimic racket's reference:
> > > https://bitbucket.org/mihailp/tankfeeder/src/default/foldl.l
>
> Perfect!
>
>
> On Tue, Oct 09, 2018 at 10:57:43AM -0400, John Duncan wrote:
> > Isn't it destructive to I?
>
> You mean the line (setq I (apply F (conc (rest) (cons I? Not in the
> sense
> "destructive" is used in the context of PicoLisp. Here only the value of
> 'I' is
> modified.
>
> The term "destructive" is used if cell structures are modified as a side
> effect.
> For example, 'conc' in general is destructive:
>
>: (setq A (1 2 3))
>-> (1 2 3)
>
>: (conc A (4 5 6))   # Concatenate lists
>-> (1 2 3 4 5 6)
>
>: A
>-> (1 2 3 4 5 6) # The list in 'A' is destructively modified
>
>
> However, the 'conc' in the above (conc (rest) (cons I)) is all right,
> because it
> modifies only the list returned by (rest), which is a "fresh" list (just
> created
> newly and not referred to by any other place).
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Function similar to Scheme 'foldl'?

2018-10-09 Thread John Duncan
Isn't it destructive to I?

On Tue, Oct 9, 2018, 10:30 AM Mike  wrote:

> hi all,
>
> My demo code to mimic racket's reference:
> https://bitbucket.org/mihailp/tankfeeder/src/default/foldl.l
>
> (mike)
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>


Re: Function similar to Scheme 'foldl'?

2018-10-08 Thread John Duncan
Yeah, all foldl does in scheme or haskell is encapsulate this pattern. In
haskell and scheme they like it for being able to compose functions. For
example:

sum = foldl + 0

Perhaps not as useful in Picolisp, which is not exactly a functional
language in the same sense.

On Mon, Oct 8, 2018 at 5:13 PM Alexander Burger  wrote:

> On Mon, Oct 08, 2018 at 08:50:09PM +, Mike wrote:
> > >
> > > Is there a PicoLisp function similar to the Scheme 'foldl'?
> > ...
> > There is no foldl. This is too general and not required in core.
> > What you intent to do ?
> >
> > Truly, I cant imagine when somebody needs it, because
> >
> > (foldl cons '() '(1 2 3 4)) is (reverse)
> > and
> > (foldl + 0 '(1 2 3 4)) is (sum)
>
> Right. And for a general case, you can do
>
>(let Res 
>   (mapc '(@ (pass process-args 'Res))
>  Lst1
>  Lst2
>  Lst3 )
>   Res )
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


-- 
John Duncan


Re: Slides and notes from my Picolisp presentation

2018-09-25 Thread John Duncan
Good presentation. Did you do a ground-up rewrite or did you move
functionality in stages somehow? I know it's a small system.

On Tue, Sep 25, 2018 at 10:46 PM  wrote:

> “Money” bullet:
>
> “Yes, computers can store and handle almost unlimited amounts of code
> today. But what about you?”
>
>
>

-- 
John Duncan


Re: exit case body/prog/function

2017-01-19 Thread John Duncan
I think 'unless' with 'or' might be what you're looking for.

(unless
  (or
(cond1 ...)
(cond2 ...)
(cond3 ...))
  (call1 ...)
  (call2 ...))

'or' is short-circuited, so the conditions will be evaluated in order. If
one of the conditions is true, NIL will be returned. All the calls will be
executed if the conditions are false, and the value of the last call will
be returned.

On Thu, Jan 19, 2017 at 10:05 AM, dean  wrote:

> Hi Alex
> Thank you for confirming no return and the alternative.
> Best Regards
> Dean
>
> On 19 January 2017 at 14:44, Alexander Burger  > wrote:
>
>> Hi Dean,
>>
>> > I'd like to do this but am not sure if it's possible
>> >
>> > ( case 
>> >#= start of match clause
>> >(
>> >(prog
>> >(if () (EXIT THIS MATCH CLAUSE/PROG))
>> >(otherwise you'll execute this statement)
>> >)
>> >   )
>> >   #= end of match clause
>> >   .
>> >   .
>> >   .
>> > I also wonder if there's a similar... (if (T) (EXIT FUNCTION))
>>
>> If I understand you right, you are looking for an exit out of a nested
>> expression, like a 'return' statment in C or Java.
>>
>> Such a return does not exist, there is catch/throw for that
>>
>>(catch 'something
>>   (for (..)
>>      (if (..)
>> (throw 'something)
>> (elseStuff)
>> ..
>>
>> Catch/throw is more general then 'return', but the latter can be emulated
>> with
>> it.
>>
>> ♪♫ Alex
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>
>


-- 
John Duncan


Re: how to specify *.txt as an argument to ls

2017-01-14 Thread John Duncan
s/lunch/libc

On Jan 14, 2017 6:01 PM, "John Duncan"  wrote:

> Wildcard expansion in UNIX is performed by the shell, so to experiment
> with arguments it is probably better to specify a directory as an argument
> and see the result. You can use a native call to the glob(3) lunch function
> if you want pattern matching lookup like the shell, or use the output of
> find(1).
>
> On Jan 14, 2017 5:19 PM, "dean"  wrote:
>
>> To help work out how to call pdftohtml with arguments I thought I'd try
>> to do "ls *.txt" in the form of (call 'ls "*.txt") but I've got something
>> wrong.
>> I have seen * specified as @ as in
>> '`(chop "@.PDF")
>> and that worked fine with match but not with ls.
>> BTW what's the difference between the two leading ticks (I recognise
>> apostrophe as quote macro).
>> Any help much appreciated.
>>
>


Re: how to specify *.txt as an argument to ls

2017-01-14 Thread John Duncan
Wildcard expansion in UNIX is performed by the shell, so to experiment with
arguments it is probably better to specify a directory as an argument and
see the result. You can use a native call to the glob(3) lunch function if
you want pattern matching lookup like the shell, or use the output of
find(1).

On Jan 14, 2017 5:19 PM, "dean"  wrote:

> To help work out how to call pdftohtml with arguments I thought I'd try to
> do "ls *.txt" in the form of (call 'ls "*.txt") but I've got something
> wrong.
> I have seen * specified as @ as in
> '`(chop "@.PDF")
> and that worked fine with match but not with ls.
> BTW what's the difference between the two leading ticks (I recognise
> apostrophe as quote macro).
> Any help much appreciated.
>


Re: how to append an element with nested parens and an evaluated centre

2016-12-23 Thread John Duncan
I think using (list 'a (list (list V))) is idiomatic and clear.

John

On Dec 23, 2016 4:02 AM, "dean"  wrote:

> I noted that '  let you write as many nested parens as you wanted but
> precluded any evaluation in the middle. V was just there to ensure that
> EVALUATION was required to get at "some_str" i.e. to test any solution.
> Irrespectivethank you for 'fill
>
> On 23 December 2016 at 08:46, Joh-Tob Schäg  wrote:
>
>> What is the purpose of the symbol V? Is seems like dead code to me.
>> Please check your code for correctness before asking question. The first
>> line does not make any sense for another reason.
>>
>> If you want to have a the list (a (("String"))) use:
>> (setq L (append L '((("String")
>>
>> I assume you wanted to have the value of V in there instead of a constant
>> "String". Have a look at 'fill in this case.
>>
>> 2016-12-22 21:09 GMT+01:00 dean :
>>
>>> What is the right way to do this...
>>> (setq V "some_str")
>>> (setq L '(a))
>>> (setq L (append L ???))
>>> --> (  a   ((some_str)))
>>> i.e. I can do '((some_str))
>>> but wonder if there's an easy way to use '(()) AND have an evaluated
>>> value in the middle
>>> i.e quote makes specifying any level of parens easy but doesn't let my
>>> use an evaluated value in the middle.
>>> Sorry if this is a dumb question
>>>
>>
>>
>


Re: Loosing elements in a sorted list

2016-12-16 Thread John Duncan
If they become unreachable, they will be collected.

On Fri, Dec 16, 2016 at 1:28 PM, Bruno Franco 
wrote:

> Hi John, Alex,
>
> Thank you for your explanations, I think I now understand how sort works:
> So, for example, in
>
> : (setq A (3 1 2 4 5 6))
> -> (3 1 2 4 5 6)
> : (setq B (sort A))
> -> (1 2 3 4 5 6)
> : A
> -> (3 4 5 6)
> : B
> -> (1 2 3 4 5 6)
>
> The symbol A points to the first cell of the list (3 1 2 3 4 5 6), and
> each cell
> points to the next cell in the list. When sort is applied, the pointing
> order of the cells
> is changed so that each cell is in the right order in the list. But, A is
> still pointing to
> the same cell as before, and if that cell has moved, then A ends up
> pointing to the
> middle of the list.
>
> In the case above, A points to the cell with CAR 3, and when that cell is
> moved, A ends
> up pointing to the 3rd element of the list. And so, the list that is built
> as the value of A
> starts at the 3rd element.
>
> My follow up question is, what happens to those first 2 cells, if they're
> not assigned to
> anything? Do they just stay there? Or are they deleted, perhaps by the
> garbage collector?
>
> P.S.
> I also wanted to apologise. When I reread my first mail I realised it was
> arrogant of me to
> imply that a feature of the language might be a bug.
> You have put a lot of effort into this language, and it shows Several
> design decisions that
> first surprised me turned out to be awesome, because they let me write
> code that was
> shorter, easier to read, and prettier. And because they lead to a more
> consistent language.
>
> Thank you for all your effort Alex. I like a lot the language you've made.
>
>
>
> On Thu, Dec 15, 2016 at 8:30 AM, Alexander Burger 
> wrote:
>
>> Hi Bruno,
>>
>> > But that might be because with 'by, the operation is not destructive.
>>
>> This is correct. 'sort' is destructive, and 'by' is not, because it
>> builds a
>> fresh, private list.
>>
>>
>> > Is this normal operation of picolisp? I assumed its not, because I
>> didn't
>> > catch any reference to it in the documentation.
>>
>> Every destructive function should be marked as such in the reference Let
>> us
>> know when you find a case where this is missing.
>>
>> - Alex
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>
>


-- 
John Duncan


Re: Loosing elements in a sorted list

2016-12-14 Thread John Duncan
This is because A still points at the cons that was the head of the list
before sorting. If you want to update it, you have to set A to the result
of sort.

On Dec 14, 2016 8:37 PM, "Bruno Franco" 
wrote:

> Hi list, I have a problem.
>
> Whenever I sort a list stored in a symbol, some elements are erased
> from the original list. Look:
>
> : (setq A (3 2 5 4 1 1 1 1 0 1 2 4 5 ))
> -> (3 2 5 4 1 1 1 1 0 1 2 4 5)
> : (sort A)
> -> (0 1 1 1 1 1 2 2 3 4 4 5 5)
> : A
> -> (3 4 4 5 5)
>
> The pattern that I've noticed is that any element that is smaller than the
> CAR of the original list is lost in the sorting.
>
> Its not limited to numbers either:
>
> : (setq A '(a 3 2 5 4 1 1 1 1 0 1 2 4 5 ))
> -> (a 3 2 5 4 1 1 1 1 0 1 2 4 5)
> : (sort A)
> -> (0 1 1 1 1 1 2 2 3 4 4 5 5 a)
> : A
> -> (a)
>
> If its used with 'by, there is no loss:
>
> : (setq A '(a 3 2 5 4 1 1 1 1 0 1 2 4 5 ))
> -> (a 3 2 5 4 1 1 1 1 0 1 2 4 5)
> : (by > sort A)
> -> (0 1 1 1 1 1 2 2 3 4 4 5 5 a)
> : A
> -> (a 3 2 5 4 1 1 1 1 0 1 2 4 5)
>
> But that might be because with 'by, the operation is not destructive.
>
> Is this normal operation of picolisp? I assumed its not, because I didn't
> catch any reference to it in the documentation.
>
> I'd quite appreciate any help, and if you have any questions let me know
>
> P.S.
> I'm using version 16.6.0, on Ubuntu 16.04
>


Re: How to use PWM?

2016-01-21 Thread John Duncan
Glad I could help

On Thu, Jan 21, 2016 at 12:42 PM, Jake  wrote:

> Thanks John, I had to wiggle the % around. I think I ended up with 10 and
> 3, but it spins the same speed both ways. Thanks :)
>
> On 19/01/16 19:18, John Duncan wrote:
>
> You have a cycle that is 21.7ms (t) in length, with 1.7ms on and 20ms off.
> The frequency is 1/t or 46Hz. The duty cycle is the amount of time on
> divided by the length of the cycle, 1.7/21.7 or 8%. I'm rounding to the
> nearest integers.
>
> On Tue, Jan 19, 2016 at 1:53 PM, Jake  wrote:
>
>> I can't test those numbers as I don't have a power supply at home. I'm
>> curious how your work out hte duty cycle as a percentage?
>> Thanks.
>>
>> On 19/01/16 18:32, John Duncan wrote:
>>
>> Just a guess, you probably need to consider the whole 21.7ms or 21.3ms to
>> be your period (46Hz or 47Hz) and then your duty cycle will be 8% or 6%
>> respectively.
>>
>> On Tue, Jan 19, 2016 at 10:32 AM, J B < 
>> k1llfre...@hotmail.co.uk> wrote:
>>
>>> I'm trying to use the PWM module to control a parallax servo I
>>> purchased. I'm trying to get it to spin both ways as I need it for a
>>> project, I have tried to spin the servo both clockwise and anti clockwise
>>> but I do not know how to set a 20ms gap between each pulse, I need 1.7ms to
>>> go anti clockwise with a 20ms gap and 1.3ms with a 20ms gap to spin
>>> clockwise. I've converted the ms into frequency but it doesn't change the
>>> direction. When I plug the data cable into any pin on the entire board the
>>> servo spins clockwise, even when plugged into PWM0 and (pwm-stop 0) being
>>> called.
>>>
>>> On another point is there a dedicated ground pin? I plugged the PWM0
>>> port into an oscilloscope and it was littered with static, according to my
>>> electrical engineering tutor there is a bad ground and I need to earth it.
>>>
>>> Another another point, my LCD display still doesn't work and I don't
>>> know what to do about it.
>>>
>>> The attachment is a datasheet for the servo I bought.
>>> Thanks.
>>>
>>
>>
>>
>> --
>> John Duncan
>>
>>
>>
>
>
> --
> John Duncan
>
>
>


-- 
John Duncan


Re: How to use PWM?

2016-01-19 Thread John Duncan
You have a cycle that is 21.7ms (t) in length, with 1.7ms on and 20ms off.
The frequency is 1/t or 46Hz. The duty cycle is the amount of time on
divided by the length of the cycle, 1.7/21.7 or 8%. I'm rounding to the
nearest integers.

On Tue, Jan 19, 2016 at 1:53 PM, Jake  wrote:

> I can't test those numbers as I don't have a power supply at home. I'm
> curious how your work out hte duty cycle as a percentage?
> Thanks.
>
> On 19/01/16 18:32, John Duncan wrote:
>
> Just a guess, you probably need to consider the whole 21.7ms or 21.3ms to
> be your period (46Hz or 47Hz) and then your duty cycle will be 8% or 6%
> respectively.
>
> On Tue, Jan 19, 2016 at 10:32 AM, J B  wrote:
>
>> I'm trying to use the PWM module to control a parallax servo I purchased.
>> I'm trying to get it to spin both ways as I need it for a project, I have
>> tried to spin the servo both clockwise and anti clockwise but I do not know
>> how to set a 20ms gap between each pulse, I need 1.7ms to go anti clockwise
>> with a 20ms gap and 1.3ms with a 20ms gap to spin clockwise. I've converted
>> the ms into frequency but it doesn't change the direction. When I plug the
>> data cable into any pin on the entire board the servo spins clockwise, even
>> when plugged into PWM0 and (pwm-stop 0) being called.
>>
>> On another point is there a dedicated ground pin? I plugged the PWM0 port
>> into an oscilloscope and it was littered with static, according to my
>> electrical engineering tutor there is a bad ground and I need to earth it.
>>
>> Another another point, my LCD display still doesn't work and I don't know
>> what to do about it.
>>
>> The attachment is a datasheet for the servo I bought.
>> Thanks.
>>
>
>
>
> --
> John Duncan
>
>
>


-- 
John Duncan


Re: How to use PWM?

2016-01-19 Thread John Duncan
Just a guess, you probably need to consider the whole 21.7ms or 21.3ms to
be your period (46Hz or 47Hz) and then your duty cycle will be 8% or 6%
respectively.

On Tue, Jan 19, 2016 at 10:32 AM, J B  wrote:

> I'm trying to use the PWM module to control a parallax servo I purchased.
> I'm trying to get it to spin both ways as I need it for a project, I have
> tried to spin the servo both clockwise and anti clockwise but I do not know
> how to set a 20ms gap between each pulse, I need 1.7ms to go anti clockwise
> with a 20ms gap and 1.3ms with a 20ms gap to spin clockwise. I've converted
> the ms into frequency but it doesn't change the direction. When I plug the
> data cable into any pin on the entire board the servo spins clockwise, even
> when plugged into PWM0 and (pwm-stop 0) being called.
>
> On another point is there a dedicated ground pin? I plugged the PWM0 port
> into an oscilloscope and it was littered with static, according to my
> electrical engineering tutor there is a bad ground and I need to earth it.
>
> Another another point, my LCD display still doesn't work and I don't know
> what to do about it.
>
> The attachment is a datasheet for the servo I bought.
> Thanks.
>



-- 
John Duncan


Re: Mizar32 - What order do functions have to appear?

2015-12-03 Thread John Duncan
yeah, you would either need a machine with a serial port or a usb-serial
adapter and serial cable.

On Thu, Dec 3, 2015 at 9:15 AM, J B  wrote:

> I got termite but I don't know how to connect it up, don't I need the
> rs232 board as well? Right now I only have the base Mizar32B with the usb
> cable.
>
> Sent from my iPhone
>
> On Dec 3, 2015, at 2:08 PM, John Duncan  wrote:
>
> You could try Termite
>
> http://www.compuphase.com/software_termite.htm
>
> On Thu, Dec 3, 2015 at 7:25 AM, J B  wrote:
>
>> Thanks for the quick reply. I'm not using Linux, my Mizar lives at
>> college where I am building my project for college. The college PC's are
>> using Win 7 and I don't think they have any terminal software installed on
>> them, although HyperTerm is installed by default, it's probably blocked as
>> I can't find it. I may be able to get hyperterm unblocked or bring in a
>> portable terminal emulator on a usb stick, but I'm not sure. Do I need any
>> special cables for the emulator or is it just the USB power cable? Also,
>> once that's set up how do I invoke Picolisp? Thanks.
>>
>> --
>> From: ramangopa...@gmail.com
>> To: picolisp@software-lab.de
>> Subject: Re: Mizar32 - What order do functions have to appear?
>> Date: Wed, 2 Dec 2015 03:30:10 +0100
>>
>>
>> Dear JB, greetings!
>>
>> > So I started creating a little program to act as a digital counter
>> > with the blue led flashing at each change of logic state, it came to
>>
>> Perfect way to begin!
>>
>> > my attention very quickly that there is some hidden format that the
>> > code has to be in and some rules that I can’t find written. It seems
>>
>> Actually, nothing is hidden or implicit at all. :) So, let's fix your
>> problem for you.
>>
>> > to me that you can’t set a pin direction unless you are going to use
>> > it in the immediate program and I personally can’t seem to get
>> > smaller functions of “sethigh” and “setlow” to ever work.
>>
>> You can set the direction of a pin in any context in PicoLisp. The
>> code you have in autorun.l must set its direction. Here's how it
>> works. Think of it as the default state of the pin. Some pins can be
>> high by default; some can be low This is MCU specific - This
>> particular device works this way. The same code on an LM3S8962 Texas
>> Instruments Cortex clone behaves the other way.
>>
>> # Will set the dir of PB_29 and turn the blue LED "on"
>> # automatically.
>> (pio-pin-setdir *pio-output* 'PB_29)
>>
>> # Will turn the blue LED "off".
>> (pio-pin-sethigh 'PB_29)
>>
>> So, your function should be:
>>
>> (de high (pin)
>>(pio-pin-setlow pin) )
>>
>> > Is there like a comprehensive list of the way I need to be writing
>> > these programs?
>>
>> It's regular PicoLisp. No different. Just that it runs on the MCU. :)
>>
>> > I experiment a lot and I do not have the vga board so I have no
>> > console on screen, I’m kinda running blind and need all the heads up
>> > I can
>>
>> Oh! This is quite easy. Can you please use a serial terminal emulator?
>> I use minicom. It's a nice tool. In case you don't have it, please get
>> it (or another of your choice) and configure it for 115200 baud, 8N1
>> and no hardware flow control. So, assuming an Ubuntu GNU/Linux and
>> minicom:
>>
>> $ sudo apt-get install minicom
>> $ minicom -D /dev/ttyACM0
>>
>> The above should get you the Hempl shell. Invoke PicoLisp directly
>> from the shell. You can then type away interactively - like you would
>> with regular PicoLisp. You can also edit PicoLisp files on your SD
>> card using iv, the vi clone.
>>
>> Hempl# iv /mmc/autorun.l
>> Hempl# picolisp /mmc/autorun.l
>>
>> Please let me know if this helps you. Good luck!
>>
>> R
>>
>> On 1 December 2015 at 23:08, J B  wrote:
>>
>> So I started creating a little program to act as a digital counter with
>> the blue led flashing at each change of logic state, it came to my
>> attention very quickly that there is some hidden format that the code has
>> to be in and some rules that I can’t find written. It seems to me that you
>> can’t set a pin direction unless you are going to use it in the immediate
>> program and I personally can’t seem to get smaller functions of “sethigh”
>> and “setlow” to ever work. Is there like a comprehensive list of the way I
>> need to be writing these programs? I experiment a lot and I do not have the
>> vga board so I have no console on screen, I’m kinda running blind and need
>> all the heads up I can. Thanks.
>>
>>
>>
>
>
> --
> John Duncan
>
>


-- 
John Duncan


Re: Mizar32 - What order do functions have to appear?

2015-12-03 Thread John Duncan
You could try Termite

http://www.compuphase.com/software_termite.htm

On Thu, Dec 3, 2015 at 7:25 AM, J B  wrote:

> Thanks for the quick reply. I'm not using Linux, my Mizar lives at college
> where I am building my project for college. The college PC's are using Win
> 7 and I don't think they have any terminal software installed on them,
> although HyperTerm is installed by default, it's probably blocked as I
> can't find it. I may be able to get hyperterm unblocked or bring in a
> portable terminal emulator on a usb stick, but I'm not sure. Do I need any
> special cables for the emulator or is it just the USB power cable? Also,
> once that's set up how do I invoke Picolisp? Thanks.
>
> --
> From: ramangopa...@gmail.com
> To: picolisp@software-lab.de
> Subject: Re: Mizar32 - What order do functions have to appear?
> Date: Wed, 2 Dec 2015 03:30:10 +0100
>
>
> Dear JB, greetings!
>
> > So I started creating a little program to act as a digital counter
> > with the blue led flashing at each change of logic state, it came to
>
> Perfect way to begin!
>
> > my attention very quickly that there is some hidden format that the
> > code has to be in and some rules that I can’t find written. It seems
>
> Actually, nothing is hidden or implicit at all. :) So, let's fix your
> problem for you.
>
> > to me that you can’t set a pin direction unless you are going to use
> > it in the immediate program and I personally can’t seem to get
> > smaller functions of “sethigh” and “setlow” to ever work.
>
> You can set the direction of a pin in any context in PicoLisp. The
> code you have in autorun.l must set its direction. Here's how it
> works. Think of it as the default state of the pin. Some pins can be
> high by default; some can be low. This is MCU specific - This
> particular device works this way. The same code on an LM3S8962 Texas
> Instruments Cortex clone behaves the other way.
>
> # Will set the dir of PB_29 and turn the blue LED "on"
> # automatically.
> (pio-pin-setdir *pio-output* 'PB_29)
>
> # Will turn the blue LED "off".
> (pio-pin-sethigh 'PB_29)
>
> So, your function should be:
>
> (de high (pin)
>(pio-pin-setlow pin) )
>
> > Is there like a comprehensive list of the way I need to be writing
> > these programs?
>
> It's regular PicoLisp. No different. Just that it runs on the MCU. :)
>
> > I experiment a lot and I do not have the vga board so I have no
> > console on screen, I’m kinda running blind and need all the heads up
> > I can.
>
> Oh! This is quite easy. Can you please use a serial terminal emulator?
> I use minicom. It's a nice tool. In case you don't have it, please get
> it (or another of your choice) and configure it for 115200 baud, 8N1
> and no hardware flow control. So, assuming an Ubuntu GNU/Linux and
> minicom:
>
> $ sudo apt-get install minicom
> $ minicom -D /dev/ttyACM0
>
> The above should get you the Hempl shell. Invoke PicoLisp directly
> from the shell. You can then type away interactively - like you would
> with regular PicoLisp. You can also edit PicoLisp files on your SD
> card using iv, the vi clone.
>
> Hempl# iv /mmc/autorun.l
> Hempl# picolisp /mmc/autorun.l
>
> Please let me know if this helps you. Good luck!
>
> R
>
> On 1 December 2015 at 23:08, J B  wrote:
>
> So I started creating a little program to act as a digital counter with
> the blue led flashing at each change of logic state, it came to my
> attention very quickly that there is some hidden format that the code has
> to be in and some rules that I can’t find written. It seems to me that you
> can’t set a pin direction unless you are going to use it in the immediate
> program and I personally can’t seem to get smaller functions of “sethigh”
> and “setlow” to ever work. Is there like a comprehensive list of the way I
> need to be writing these programs? I experiment a lot and I do not have the
> vga board so I have no console on screen, I’m kinda running blind and need
> all the heads up I can. Thanks.
>
>
>


-- 
John Duncan


Re: low level VM and disassemble

2015-08-26 Thread John Duncan
I think, Erik, you should review the PicoLisp Reference about evaluation.
In PicoLisp, everything is interpreted except primitive functions which are
either implemented in C (32-bit) or assembly (64-bit). So the source you
see in the lisp files is the same as what the compiler will execute, except
that data structures are built and symbols resolved during (read).

The relevant part of the manual is here:
http://software-lab.de/doc/ref.html#ev

John

On Wed, Aug 26, 2015 at 1:00 AM, Alexander Burger 
wrote:

> Hi Erik,
>
> > I imagine something like CL's 'disassemble' that, given an arbitrary lisp
> > expression, returns the sequence of VM instructions the expression maps
> to.
>
> To extend a little what Tomas and Andreas said:
>
> I think it is not so very useful to look at the generated native ASM
> code, as it more or less maps 1:1 to the PicoLisp assembly, and the
> latter is more readable.
>
> Still, you can easily disassemble the executable:
>
>$ objdump -S bin/picolisp |view -
>
>
> When looking at the sources with 'vi', e.g. extending Andreas' example
>
>$ pil +
>: (vi 'vi)
>
> you can navigate by moving the cursor to some identifier and hit Shift-K.
> Then
> vi will jump to *that* source. This will give access to all Lisp and ASM
> code
> reachable from that point.
>
> In case of the 'vi' code above, you may press Shift-K on 'call', then move
> down
> to 'execArgsE_SXZ' and press Shift-K again
>
> With Shift-Q you can pop back.
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>



-- 
John Duncan


Re: error message line numbers

2011-09-07 Thread John Duncan
cygwin does (or used to) have a fork(2) that is supposed to have copying
semantics like unix. I haven't used it in a long time so I don't know if it
was successfully upgraded along with windows.

On Wed, Sep 7, 2011 at 6:20 AM, Alexander Burger wrote:

> Hi Randall,
>
> > > Indeed, this looks quite similar. The 'select' in "winsock2.h" seems to
> > > be modeled closely to the POSIX version.
> >
> > Yes, select() is basically the same as for POSIX, but ONLY for sockets.
> > It won't work on files or the keyboard under MS-Win. There are ways
> > around this, but it usually involves breaking out of select, polling the
> > keyboard, and going back to select. Ugh!
>
> Hmm, another killer :(
>
>
> > The PicoLisp family of processes could easily be achieved under Windows
> > using mmap-ed shared memory, IPC, and spawn()s to get it all started. It
> > is just a different model than the old fork() mechanism of UNIX. It
> > might be worth looking into for PicoLisp as a future enhancement, then a
> > PicoLisp family of processes could be shared between separate
> > computers, a la Erlang.
>
> Yes, that's interesting. I don't want to care about Windows (Windows is
> obsolete in all interesting segments, remaining only on the desktop),
> but in fact I was experimenting with mmap'ed versions of PicoLisp in the
> past.
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>



-- 
John Duncan
University of Georgia College of Veterinary Medicine
Class of 2012
SCAVMA Treasurer Emeritus
VBMA President Emeritus


Re: Building picolisp on Oneiric ?

2011-09-07 Thread John Duncan
One note: i presume the reason for having the "gcc" command be specified by
the variable LD-MAIN is because it can be nice to swap out the version of
gcc, such as when cross-compiling or when an older version of gcc is
required. If there's only one target that runs the linker, it's no problem
to change it there, but if more than one linked target comes along, it'd be
nice to have to change it only in one place. Typically, to handle this the
linker is specified with two or three variables, one for the link command
and one with the list of libraries that has to be appended to the command.

Just food for thought.

John

On Tue, Sep 6, 2011 at 11:58 AM, Alexander Burger wrote:

> Hi Renaud,
>
> > Hi Alex, and thanks for your answer...
>
> No problem. I'm glad for your input.
>
>
> > -ldl is present in the Makefile, and also in the "complaining" invocation
> of
> > gcc :
> > gcc -m64 -rdynamic -lc -lm -ldl -o ../bin/picolisp x86-64.linux.base.o
>
> Hmm, looking at that, it occurs to me that the order of arguments to
> 'gcc' might be relevant: If it first processes "-ldl", and _then_
> "x86-64.linux.base.o", it might be too late to detect that certain
> functions from the library are needed.
>
> But if so, why did it work under Debian?
>
>
> Anyway, could you help me with a test? Change in Makefile
>
> 1. The line in the "Linux" condition
>
>  LD-MAIN = gcc -m64 -rdynamic -lc -lm -ldl
>
>   to
>
>  LD-MAIN = -m64 -rdynamic -lc -lm -ldl
>
>
> 2. The line in the "$(bin)/picolisp:" target
>
>  $(LD-MAIN) -o $(bin)/picolisp $(ARCH).$(SYS).base.o
>
>   to
>
>  gcc -o $(bin)/picolisp $(ARCH).$(SYS).base.o $(LD-MAIN)
>
>
> If it works with these changes, then we must also fix the corresponding
> LD-SHARED lines.
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>



-- 
John Duncan
University of Georgia College of Veterinary Medicine
Class of 2012
SCAVMA Treasurer Emeritus
VBMA President Emeritus


Re: help in understanding picolisp implementation

2011-02-25 Thread John Duncan
Yes, I think you have it. In lisp, to evaluate a number is simply to return
that number. To evaluate a symbol is to return its value. Otherwise, it is a
procedure call. If you haven't read how picolisp handles procedures, you
should look into the documentation.

John

On Fri, Feb 25, 2011 at 3:01 PM, Ana Zgombic  wrote:

> Hi John,
>
> *thank you*.
>
> now things make more sense.
>
> next question:
>
> the EVAL C macro.
>
> #define EVAL(x) (isNum(x)? x : isSym(x)? val(x) : evList(x))
>
> that's in src/pico.h:212
>
> my attempt:...
>
> i looked at isNum() and it calls num() and... i broke down after that.
>
> so, i'll try to put that into pseudocode first.
>
> if (isNum(x)) {
>x
> } else {
>   if (isSym(x)) {
>  val(x)
>   } else {
> evList(x)
>   }
> }
>
> again. try... if x is a number, then x.
> otherwise
> if x is a symbol, then get the value of x
> else... x is a list! phew. go forth and evaluate.
>
> now burn me.
>
> Ana
>
> On Sat, Feb 26, 2011 at 3:42 AM, John Duncan 
> wrote:
> > "fun" is the name created by that typedef. It is the type of pointers to
> > functions from "any" to "any".
> >
> > "any" is defined on line 56 of pico.h as a pointer to struct cell.
> > John
> > On Fri, Feb 25, 2011 at 2:20 PM, Ana Zgombic  wrote:
> >>
> >> Hi list,
> >>
> >> i'm looking at the picolisp implementation in C. i hope you don't mind
> >> me asking here every so often since my C chops is only good for app
> >> development and not good enough for language implementations.
> >>
> >> here's the line:
> >>
> >> > typedef any (*fun)(any);
> >>
> >> as i understand it, it says typedef "any" to a "function returning a
> >> pointer which takes an argument 'any'". and "any" is defined as a
> >> typedef to a pointer to a"struct cell".
> >>
> >> did i get that one right?
> >>
> >> Ana
> >>
> >> --
> >> http://nybl.info
> >> --
> >> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
> >
> >
> >
> > --
> > John Duncan
> > University of Georgia College of Veterinary Medicine
> > Class of 2012
> > SCAVMA Treasurer Emeritus
> > VBMA President Emeritus
> >
>
>
>
> --
> http://nybl.info
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>



-- 
John Duncan
University of Georgia College of Veterinary Medicine
Class of 2012
SCAVMA Treasurer Emeritus
VBMA President Emeritus


Re: help in understanding picolisp implementation

2011-02-25 Thread John Duncan
"fun" is the name created by that typedef. It is the type of pointers to
functions from "any" to "any".

"any" is defined on line 56 of pico.h as a pointer to struct cell.

John

On Fri, Feb 25, 2011 at 2:20 PM, Ana Zgombic  wrote:

> Hi list,
>
> i'm looking at the picolisp implementation in C. i hope you don't mind
> me asking here every so often since my C chops is only good for app
> development and not good enough for language implementations.
>
> here's the line:
>
> > typedef any (*fun)(any);
>
> as i understand it, it says typedef "any" to a "function returning a
> pointer which takes an argument 'any'". and "any" is defined as a
> typedef to a pointer to a"struct cell".
>
> did i get that one right?
>
> Ana
>
> --
> http://nybl.info
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>



-- 
John Duncan
University of Georgia College of Veterinary Medicine
Class of 2012
SCAVMA Treasurer Emeritus
VBMA President Emeritus


Re: Wikipedia

2010-01-11 Thread John Duncan

Alex,

Have you tried discussing the issue nicely on the talk (Diskussion)  
page? There hasn't been any talk in German, which is very strange for  
an article that has been marked for deletion.


One problem that I see is that, generally, wikipedians should not be  
writing about their own stuff. I'm sure it happens more frequently in  
other areas that don't have pedants running the show, but I think it  
is important for people to write the article like an encyclopedia  
article.


Wikipedia can be annoying in this way because there are some editors  
who are full of themselves and they don't like appeals. But there is a  
lot of software on there that is of minimal notability but the  
articles are not marked for deletion.


It might be true that it would be better to put picolisp in another  
article, but I don't think one exists that is good for it. Perhaps it  
could be merged into an article about various lisp implementations  
such as BEE Lisp and the like, making Picolisp and BEE Lisp a  
redirection to these pages.


(I'm just picking on BEE Lisp because it is referenced from the lisp  
page and doesn't seem very notable to me.)


John

On 11 Jan 2010, at 1:49 AM, Alexander Burger wrote:


Hi Henrik,

So in the spirit of promoting the language I made the reply into  
its own

post on my blog:
http://www.prodevtips.com/2010/01/09/on-picolisps-wikipedia-woes-and-the-process-of-promoting-a-language/


Thanks Henrik!


When it comes to secondary sources and references and such I  
propose a new
section in the Wikipedia article called something like "Impact"  
with a link

...


At the moment I don't want to any further changes. Last week I had  
added
two references to the German version (which started the trouble),  
one to

your prodevtips, and one to an article in the renowned German c't
magazine, but they were immediately removed (reverted).

But thank you very much for your input!

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


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


Re: www.picolisp.org created

2009-11-26 Thread John Duncan

Cross-posted to hacker news (news.ycombinator.com).

On 26 Nov 2009, at 7:57 AM, Javier wrote:

Hello, we have created www.picolisp.org, which is pretended to be  
the main point of interchange and developing of PicoLisp.
There is a forum, an article section, a forum, and of course we are  
creating a book, too.


Please, have a look and put your suggestions in the forum.
--
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


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


Re: Probably solved [Was: picoLisp under MacOS/X 10.6 SIG-N

2009-11-22 Thread John Duncan

Cool. Would have checked it myself if I had snow leopard.

John

On 22 Nov 2009, at 10:12 AM, cle wrote:




John Duncan wrote:
> Is it necessary to declare the functions extern in the header file?
 > The default linkage for functions is external.

To speak the truth: I don't know! Let me see ...

No! Declaring functions extern is not necessary. Only the variables  
have to be! I guess, as I *do* declare functions extern in my own  
code, I was going wild during the declaration orgy. Sorry for  
that! :-}


(...)

Ciao,
Cle.


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


Re: Probably solved [Was: picoLisp under MacOS/X 10.6 SIG-N

2009-11-22 Thread John Duncan
Is it necessary to declare the functions extern in the header file?  
The default linkage for functions is external.


John

On 22 Nov 2009, at 4:54 AM, cle wrote:




Alexander Burger wrote:

> Hi Cli,

Hi Alex,

 (...)

> So that means, that you fixed also the problems with loading dynamic
 > libraries, which was a major trouble during recent months.

I guess I did ... :-)

> As I'm on a trip until Monday evening, having only sporadic time and
 > network access, I'll look at it more thoroughly early next week.
 >
 > -DYNAMIC-LIB-FLAGS = -dynamiclib -undefined dynamic_lookup +
 > DYNAMIC-LIB-FLAGS = -dynamiclib -undefined dynamic_lookup -m32
 >
 > So this was the culprit for the "*.so" loading problem ;-)

This was *one* problem, however. Those solutions play a bit  
together :-)


 > main.c: +/* Globals declared in pico.h */ +int Signal, Chr, Slot,
 > Spkr, Mic, Hear, Tell, Children, ExtN; +char **AV, *AV0, *Home; ...
 >
 > pico.h: /* Globals */ -int Signal, Chr, Slot, Spkr, Mic, Hear,  
Tell,

 > Children, ExtN; -char **AV, *AV0, *Home;
 >
 > Funny! This is how it was some time ago. I'd changed it to have the
 > globals and the prototypes in "pico.h" only, to avoid redundancy. I
 > didn't expect that this could cause problems on some compilers!

This was the second part of the problem. It seems that defining the  
variables in more than one place cause trouble in MacOS/X as e.g.  
io.c gets its own set of them. And they seem not to be properly  
handled (i.e. resolved) as one and the same variable by the linker.


So the correct solution (I believe as stated in the C standard)  
should be, to declare them extern in pico.h and define them once in  
one and only one compilation unit i.e. main.c in our case. Then no  
linker/loader should have any problem to resolve them correctly.


 > -  (task (port T ) (eval (udp @))) -  (udp "localhost"
 >  '(setq *B 4)) +  (task (port T 4445) (eval (udp @))) +
 > (udp "localhost" 4445 '(setq *B 4))
 >
 > Does port  produce any conflict?

Yeah, if running in scope of the whole test suite. As the tests in  
test/src/net.l also use port , it seems that the port was not  
released back to the OS yet, when test/lib.l was running. Therfore  
it was still be used and couldn't be bound again.


Running the test/lib.l on its own works. Or -- as I did -- simple  
changing of the port to e.g. 4445 :-)


>> I hope, I did not break your coding style too much via the patch
 >> ...
 >
 > Not at all! I'm very happy that you found it out!

So I am, cause now I can begin to investigate picoLisp for my  
problem domain :-D


 > Many thanks!

I have to thank *you* for making such a fine tool available to the  
public ...


 > Cheers, - Alex

Ciao,
Cle :-)



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


Re: Pico build problem on Mac OS X 10.6

2009-09-07 Thread John Duncan

I think what may be happening is gcc is trying to build a universal =20
executable and can't find any ia64 stuff.

Try this change in Makefile:

from:

ifeq ($(shell uname), Darwin)
OS =3D Darwin
PICOLISP-FLAGS =3D -lc -lm -ldl

to:

ifeq ($(shell uname), Darwin)
OS =3D Darwin
PICOLISP-FLAGS =3D -lc -lm -ldl -arch i386

John

On 6 Sep 2009, at 4:48 PM, Jon Kleiser wrote:


Hi,

I've just installed Mac OS X 10.6, aka "Snow Leopard", on a =20
partition on
my Mac (Intel Core 2 Duo, which probably means 32 bit only), and I was
curious to see what the consequences might be for Pico Lisp. I =20
downloaded
the ongoing dev. version of Pico Lisp and did the usual "(cd src; make
picolisp)". The results weren't too nice, but I'm not sure what the
problem is:

$ (cd src; make picolisp)
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' main.c
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' gc.c
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' apply.c
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' flow.c
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' sym.c
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' subr.c
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' big.c
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' io.c
io.c: In function =91doEcho=92:
io.c:2072: warning: =91op=92 may be used uninitialized in this =

function

io.c: In function =91doCommit=92:
io.c:3224: warning: =91note=92 may be used uninitialized in this =

function

gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' net.c
gcc -c -O2 -m32 -pipe -falign-functions -fomit-frame-pointer
-fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat
-Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE  -=20
D_FILE_OFFSET_BITS=3D64
-D_OS=3D'"Darwin"' tab.c
mkdir -p ../bin ../lib
gcc -o ../bin/picolisp -lc -lm -ldl main.o gc.o apply.o flow.o sym.o
subr.o big.o io.o net.o tab.o
ld: warning: in main.o, file is not of required architecture
ld: warning: in gc.o, file is not of required architecture
ld: warning: in apply.o, file is not of required architecture
ld: warning: in flow.o, file is not of required architecture
ld: warning: in sym.o, file is not of required architecture
ld: warning: in subr.o, file is not of required architecture
ld: warning: in big.o, file is not of required architecture
ld: warning: in io.o, file is not of required architecture
ld: warning: in net.o, file is not of required architecture
ld: warning: in tab.o, file is not of required architecture
Undefined symbols:
 "_main", referenced from:
 start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [../bin/picolisp] Error 1

I also tried building Pico Lisp 2.3.5, but got the same as above. =20
However,
running the Pico Lisp 2.3.5 that I built using Mac OS X 10.5.x, went =20=



fine,
including my OpenGL Chinese Checkers.

Snow Leopard does bring some changes re. gcc. Some info may be found =20=



here:


/Jon

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


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


Unsubscribe

2008-12-01 Thread John Duncan
Good bye John Duncan <[EMAIL PROTECTED]> :-(
You are now unsubscribed


Changing my address!

John

-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Subscribe

2008-12-01 Thread John Duncan

Hello John Duncan <[EMAIL PROTECTED]> :-)
You are now subscribed


Changing my address!
Please subscribe this one: [EMAIL PROTECTED]

--
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: closures

2008-10-30 Thread John Duncan
I thought Chicken's approach seemed novel, but I don't understand it  
well enough to explain it. From what I gather, they use the C stack as  
the "new" heap and collapse it when the garbage collector copies.

John

On 30 Oct 2008, at 3:56 AM, Alexander Burger wrote:
>
>> class continuations like scheme does.  Have you thought about using
>> the picoLisp heap instead of the traditional C stack?
>
> Yes, I experimented with that, but did not find a better solution. The
> hardware stack seems optimal for certain things. On the other hand, it
> is always worth to explore other possibilities.
>
> Cheers,
> - Alex
> -- 
> UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: Status of 64 picoLisp

2008-10-15 Thread John Duncan
On 15 Oct 2008, at 9:11 AM, Alexander Burger wrote:

> It is a complete rewrite. Even the implementation language changed.
> Instead of C it is written in a generic assembler (which in turn is
> written in PicoLisp :) that generates GNU assembler code (currently
> there is only a x86-64 generator, but other CPUs are possible).

Hmm. Beware of the second-system effect. :)

John

-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: Asyncronous IO

2008-10-10 Thread John Duncan
If the socket is set not to block, then the socket will read as much  
data as is available and the underlying read call will return the  
number of bytes read, right? So the poll will still be useful in an  
nbio world.

John

On 10 Oct 2008, at 12:36 PM, Alexander Burger wrote:

> Hi Tomas,
>
>> The comment is a bit misleading as it does not prevent blocking
>> really.  The data might be available but the 'read' function might
>> still block.
>
> Yes, all those comments regarding non-blocking (also in the way Konrad
> used it) mean that during normal operations (i.e. not hanging in an
> error condition) everything will go smoothly. It does not mean
> "non-blocking" in the technical sense. But for those "normal"
> operations, it goes surprisingly well when messages observe the  
> PIPE_BUF
> limit. So the *application* is non-blocking, not the underlying
> protocol. Without *Run and (poll) the input would always block even  
> on a
> single input channel.
>
> Cheers,
> - Alex
> -- 
> UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: Subscribe

2008-10-01 Thread John Duncan

--Boundary_(ID_0i1pLLSumxnIAcUHaroTzw)
Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-transfer-encoding: 7BIT

Thanks, Henrik!

I wish I'd known about your website earlier. Perhaps Alex can link to  
it so it's more googleable?

John

On 1 Oct 2008, at 12:03 AM, Henrik Sarvell wrote:

> Hi Eugene.
>
> 1.) Why a secret? I once asked the same thing and Alex's answer was  
> simply that he hadn't spent much time promoting, I suppose he has  
> enough clients using Pico that he survives anyway :-). I'm trying  
> though to bring it out in the open more, as well as trying to make  
> it less daunting for newbies, my efforts starts here: 
> http://www.prodevtips.com/2008/03/28/pico-lisp/
>
> 2.) With regards to other alternatives than the web GUI, AFAIK this  
> is the only discussion about this on the mail list so far: 
> http://www.mail-archive.com/picolisp@software-lab.de/msg00198.html
>
> Cheers,
>
> /Henrik


--Boundary_(ID_0i1pLLSumxnIAcUHaroTzw)
Content-type: text/html; charset=US-ASCII
Content-transfer-encoding: quoted-printable

Thanks, =
Henrik!I wish I'd known about your website earlier. =
Perhaps Alex can link to it so it's more googleable? John =
On 1 Oct 2008, at 12:03 AM, Henrik Sarvell =
wrote:Hi Eugene.1.) Why a secret? I =
once asked the same thing and Alex's answer was simply that he hadn't =
spent much time promoting, I suppose he has enough clients using Pico =
that he survives anyway :-). I'm trying though to bring it out in the =
open more, as well as trying to make it less daunting for newbies, my =
efforts starts here: http://www.prodevtips.com/2008/03/28/pico-lisp/";>http://www.prodev=
tips.com/2008/03/28/pico-lisp/ 2.) With regards to other =
alternatives than the web GUI, AFAIK this is the only discussion about =
this on the mail list so far: http://www.mail-archive.com/picolisp@software-lab.de/msg00198.html=
">http://www.mail-archive.com/picolisp@software-lab.de/msg00198.html =
Cheers,/Henrik=

--Boundary_(ID_0i1pLLSumxnIAcUHaroTzw)--
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: 'date' and 'time'

2008-08-19 Thread John Duncan
(list (dat$ (date T)) (tim$ (time T) T))
-> ("20080819" "10:55:59")

The T argument to (date) returns UTC, and the T argument to (time)  
returns the time at the call to date. If (date) was called with the T  
argument, the time will be in UTC.

The T argument to (tim$) returns a string with seconds. Without it,  
the seconds are left off.

Hope this helps,
John

On 19 Aug 2008, at 6:28 AM, Andrei Ivushkin wrote:

> Guys, please clarify:
>
>>> (date)
>>> When called with a T argument, the current Coordinated Universal  
>>> Time (UTC) is returned.
>
>>> (time)
>>> When called with a T argument, the time of the last call to date  
>>> is returned.
>
> I need to obtain current UTC not only for date but also for time.  
> How do I?
> Thanks
> -- 
> UNSUBSCRIBE: mailto:[EMAIL PROTECTED]
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: Pico, handling requests from jQuery

2008-05-27 Thread John Duncan
The + shows up in post data too, when the default "application/x-www- 
form-urlencoded" content type is used and there are spaces in a value.

On 27 May 2008, at 5:16 AM, Alexander Burger wrote:

> Hi Jon,
>
>> properly. I get the "+" in Pico Lisp. Therefor I cannot know whether
>> a "+" in Pico Lisp originated as a "+" or a space. I think the
>> plus-to-space decoding has to be done at the same time as the %xy
>> decoding. Or ...
>
> OK, I understand.
>
> As the %xy decoding happens in 'ht:Pack', you could redefine it
> somewhere in your program:
>
>(redef ht:Pack (Lst)
>   (ht:Pack (replace Lst "+" " ")) )
>
> Then you get:
>
>: (ht:Pack (chop "A+B%2BC%20D"))
>-> "A B+C D"
>
>
> Strange, however, that spaces end up encoded as '+' in your case. This
> happens usually only in query-strings (?).
>
> Cheers,
> - Alex
> -- 
> UNSUBSCRIBE: mailto:[EMAIL PROTECTED]
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


Re: Pico, difficulty with circular lists

2008-04-10 Thread John Duncan

Only simple circular lists seem to work properly.

'(a b . (c d e .))

is equivalent to

'(a b c d e c d e ...)

: (de X . (a b .))
-> X
: X
-> (a b .)
: (de X . (a . (b c .)))
# X redefined
-> X
: (cdr X)
-> (b c .)
: X
-> (a b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c  
b c b c b c b c b c b c b c b c b c
b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b  
c b c b c b c b c b c b c b c b c b

c b c b c b c b c b c b c b c b c b c b c b c b c

and so on forever.

John

On 10 Apr 2008, at 3:35 AM, Jon Kleiser wrote:


Hi Alex,

After you made me aware of the circular list in lib/form.l, I  
changed my 'ifwarn' function to skip circular lists by putting in  
the (nT (length Prg)) test, like this:


(de ifwarn (Prg)
(when (and (lst? Prg) (nT (length Prg)))
(when (and (= (car Prg) 'if) (<> (length Prg) 4))
(println Prg) )
(mapcar ifwarn Prg)
NIL) )

However, this fix may not be the ultimate, because in lib/misc.l  
there's a tougher problem, that can be illustrated by this ...


(length '(de *Day . (Mon Tue Wed Thu Fri Sat Sun .)))

.. which I'm not able to abort with Ctrl-C or Ctrl-D. Ctrl-Z does it.

Why does 'length' have such problems here?

/Jon


PDF Functionality

2008-04-07 Thread John Duncan

Hi all,

Does pico have PDF functions? I was considering implenting something in 
that area.


John




Also, I am still having problems getting the PDF function working 
properly (i.e., finding useable fonts other than Courier).


Subscribe

2008-04-03 Thread John Duncan

Hello John Duncan <[EMAIL PROTECTED]> :-)
You are now subscribed


Hi!

I'm interested in this implementation. Please subscribe me.

John