Source language: Translate to:

LISP plugin for Neobook

Questions about NeoBook PlugIns

Moderator: Neosoft Support

LISP plugin for Neobook

Postby fkapnist » Thu Apr 27, 2017 7:50 am

I am trying a program called "newLISP-GSv.1.63" (I downloaded it from http://newlisp.org) It has a demo folder (guiserver) with some useful sample .lsp scripts.

I am also using the "hpwNewLisp 2.35" Plug-in for Neobook and the "OpenNbNewLisp" 1.0 Plug-in.

As yet, I haven't a clue what LISP is about, but I want to experiment. Can't I just paste a sample script from newLISP into the Neobook nbNewLispCall Properties text box? All I need are a few simple working examples to get the hang of it (I hope)...

:?:

.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: LISP plugin for Neobook

Postby HPW » Thu Apr 27, 2017 8:20 am

Hello,

hpwNewLisp come with a demo-Pub.
Page 1 has a list-box with several one-liner demo calls. By choosing a oneliner it gets copied into the textentry left of the "call Lisp" button.
Then press the button. The return value and the call are shown below in the text entry log.

The other pages Show more compex sample with code from file and interaction with hpwImage.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: LISP plugin for Neobook

Postby fkapnist » Fri Apr 28, 2017 3:26 am

HPW wrote:Hello,

hpwNewLisp come with a demo-Pub.
Page 1 has a list-box with several one-liner demo calls. By choosing a oneliner it gets copied into the textentry left of the "call Lisp" button.
Then press the button. The return value and the call are shown below in the text entry log.

The other pages Show more compex sample with code from file and interaction with hpwImage.

Regards



OK. I tried the one-line LISP commands.
Most of them return "ERR: invalid function"

The following one-line commands turn the cursor on and off

(ShowCursor 0) ;Off
(ShowCursor 1) ;ON

This one-line displays a messagebox that is different from Neobook's
(MessageBoxA 0 "This is the body" "Caption" 1)

So how do I paste entire scripts from neoLISP into Neobook? I was told that LISP handles lists better than most programming languages....

:idea:
.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: LISP plugin for Neobook

Postby HPW » Fri Apr 28, 2017 11:37 pm

Hello,

One-liner means not that you can use it alone, it is called one after the other.
So in the demo are samples where some lines belong together.
So read the context first and then try them in correct order.

So in your use you want to call a Win Api function 'ShowCursor' from the Windows system-dll's
So you have to first call the Import command:
Code: Select all
(import "user32.dll" "ShowCursor")

Then the 'ShowCursor' gets a valid function in the newlisp interpreter.

This one-line displays a messagebox that is different from Neobook's


This one calls the Windows Api messagebox and not the neobook's own messagebox.
Using the Windows Api is powerfull but you need a knowledge and documentation about it.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: LISP plugin for Neobook

Postby fkapnist » Sun Apr 30, 2017 12:24 pm

HPW wrote:Hello,

One-liner means not that you can use it alone, it is called one after the other.
So in the demo are samples where some lines belong together.
So read the context first and then try them in correct order.

So in your use you want to call a Win Api function 'ShowCursor' from the Windows system-dll's
So you have to first call the Import command:
Code: Select all
(import "user32.dll" "ShowCursor")

Then the 'ShowCursor' gets a valid function in the newlisp interpreter.

This one-line displays a messagebox that is different from Neobook's


This one calls the Windows Api messagebox and not the neobook's own messagebox.
Using the Windows Api is powerfull but you need a knowledge and documentation about it.

Regards


I spent a few days trying your HPW plugins. The pdScript plugin worked well for me, and I was able to run some newLISP scripts with it. The AutoIt3 plugin is also very useful with lots of scripts available. I am curious to learn how the Pure Basic DLL works, how do PB scripts find the DLL ? Is there maybe a plugin for Lazarus Pascal? I am still trying to understand the newLISP language and its lambda functions etc....


:idea:
.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: LISP plugin for Neobook

Postby HPW » Sun Apr 30, 2017 10:57 pm

I am curious to learn how the Pure Basic DLL works, how do PB scripts find the DLL ? Is there maybe a plugin for Lazarus Pascal?


Purebasic and Powerbasic samples were provided with hpwDllCall.
This early plugin show how to communicate with Dll's that follow one calling convention using a pchar calling Parameter with a pchar return value.
You can use any programming enviroment as long it can produce this Kind of win32 dll.

Code: Select all
hpwDllCall "[PUBDIR]test.dll" "test" "[TextEntry1]" "DllRetvar"

The pubdir-variable tells the plugin where to find the called dll.

There was a diskussion and plugin template for freepascal here:
viewtopic.php?f=3&t=19962&hilit=freepascal&start=15

The pdscript plugin (and standalone) is special and unique, since you can do dynamic GUI-Scripting. Embedding newlisp is only one of ist powerfull possiilities.

And when we are on languages, you can also take a look at hpwRuby.

My most used scripting-dialects are neoscript itself and newlisp. Plus Delphi for compiled Tools.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: LISP plugin for Neobook

Postby fkapnist » Mon May 01, 2017 3:42 am

It seems the Lazarus plugin is no longer available

But NeoPlugin npPasc 34/58 is "a very complete Pascal language interpreter"

https://www.davidesperalta.com/neoplugins

David also has a thinBasic plugin.

:idea:
.

I also looked at the HPW Ruby plugin. Ruby is popular for C and C+ extensions but it seems a bit too "top heavy" for me. I find mountains of documentation (for web-based Ruby apps) everywhere on the web but I cannot find enough example scripts (called "gems") that actually work...
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: LISP plugin for Neobook

Postby HPW » Mon May 01, 2017 9:00 am

Hello,

So as always: Your choice!
Credo: Use the right tool to get the Job done.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: LISP plugin for Neobook

Postby reinier maliepaard » Mon May 01, 2017 12:10 pm

reinier maliepaard
 
Posts: 30
Joined: Sat Jan 17, 2009 2:53 pm

Re: LISP plugin for Neobook

Postby fkapnist » Thu May 04, 2017 2:25 am




Thank you for this. I will study the newLISP material for Neobook. It seems to be good for artificial intelligence programming.

:)
.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: LISP plugin for Neobook

Postby fkapnist » Thu May 04, 2017 2:38 am

HPW wrote:Hello,

So as always: Your choice!
Credo: Use the right tool to get the Job done.

Regards


You won't know the right tool unless you try them all.

I thought it would be very easy to use newLisp scripts like this:

newlisp.exe demo.lsp

But they get blocked by Windows Firewall. I don't think the average user is willing to change their firewall settings just to run some LISP scripts... And there is the matter of network commands like java -jar 47011 guiserver.jar which I still haven't figured out.... The universe is run on a grid of computers? :idea:

.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: LISP plugin for Neobook

Postby HPW » Thu May 04, 2017 9:03 am

Hello,
newlisp.exe demo.lsp

Not sure what is blocked for you, can only be dependent from the Content of Demo.lsp
For me it is so easy, for Tasks where I Need no GUI.

I does not like the Hype over AI and Lisp's, since this might be the case of the big Players in the Common Lisp playground.
I do use Autolisp for customise AutoCAD and newLisp for a lot of other Scripting Tasks.
They helped me to get the Job done. And yes, you have to try different Tools to know what they do best.
So therefor I tried other enviroments when I can get my Hands on it.
Years ago I tried LispWorks and Corman Lisp. Was an expensiv experience.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: LISP plugin for Neobook

Postby fkapnist » Fri May 05, 2017 12:46 pm

HPW wrote:I do use Autolisp for customise AutoCAD


3D printing will replace traditional manufacturing
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece


Return to PlugIn Discussions

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron