newLISP-TK examples

Q&A's, tips, howto's
Locked
CaveGuy
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio
Contact:

newLISP-TK examples

Post by CaveGuy »

I propose we as a group put together some example programs for newLISP.

When I looked there were no examples of a scrolling text window for the simple display of text. I would like to suggest that a newLISP-TK example be generated that expands the POP3 example into a simple mail viewer.
Bob the Caveguy aka Lord High Fixer.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

That is a great idea, we could put a new section "source code" or "examples" in http://newlisp.org/news/ like there is a "Tips&Tricks" section right now, where we could put all that stuff, or we could put a "contributions" directory in http://newlisp.org/download/ or both.

Or we could publish stuff here on the board first, discuss, cleanup, improve it and then move it over to News or download/contributions directory

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I also would like to see more examples with demo-code for possible interfaces with tk from newlisp! Learning from others code is the most productive way of learning. I had bought the tk-book from Welsch, which you have recommended.

>What is missing here would be a layer in newLISP providing a more
>LISPier way of doing GUI stuff.

This would also be a nice improvment!

By the way, is there a plan to upgrade tk to 8.4 which has some interface improvements for tk (more widgets)?
Hans-Peter

CaveGuy
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio
Contact:

Your call as where to park it/them

Post by CaveGuy »

Lutz wrote:That is a great idea, we could put a new section "source code" or "examples" in http://newlisp.org/news/ like there is a "Tips&Tricks" section right now, where we could put all that stuff, or we could put a "contributions" directory in http://newlisp.org/download/ or both.

Or we could publish stuff here on the board first, discuss, cleanup, improve it and then move it over to News or download/contributions directory

Lutz
I like both ideas. We shake it out here in the forum, then when completed move it off to a more permanent static location.

When completed the message thread can be chopped up and edited into a design justification that could be easily used as learning tool.
I have often found the best comments are not about what the code is doing, but why the author chose to do it that way. The very act of justification often reveals forces and motives that are often not apparent in the original specification.
Bob the Caveguy aka Lord High Fixer.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

yes, the process getting to the final 'static' result is probably the most interesting part.

Also it doesn't need to be always some big fullblown program, it could just be some piece or function solving something interesting.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Move to 8.4 Tcl/Tk

Post by Lutz »

HPW wrote:I also would like to see more examples with demo-code for possible interfaces with tk from newlisp! Learning from others code is the most productive way of learning. I had bought the tk-book from Welsch, which you have recommended.

>What is missing here would be a layer in newLISP providing a more
>LISPier way of doing GUI stuff.

This would also be a nice improvment!

By the way, is there a plan to upgrade tk to 8.4 which has some interface improvements for tk (more widgets)?
I will upgrade to 8.4 as soon as freewrap has a version out. At the moment they only have one based on a beta of 8.4. But I guess a stable version will be there by the end of the year. I am not making it myself but use always the published one at http://freewrap.sourceforge.net

Lutz

CaveGuy
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio
Contact:

What people want are usefull working examples and good Doc

Post by CaveGuy »

Having contributed heavily to the early days of the
AutoCAD variables and expressions feature through the birth of AutoLISP, believe me when I tell you that the best examples are simple solutions to real world problems.

In 1984 "Programming AutoCAD" had to be self publishing because no real publisher would even think of publishing anything to an audience that small.
It was several years before New Riders published Bill Kramers AutoLISP Concepts first book on AutoLISP ever commercially published.

Back in the mid 80's Bill Kramer and I coauthor a 2 day boot camp and took it on the road for several years.
"AutoLISP the Long and Short of it" (Bill is 6'7" and I am 5'5") or the "Bill and Bob Show" as we referred to it, consisted of 4 3+ hour secessions. Using a tag team stand up comedy format with 4 slide trays full of examples each with a story, We preached the fundamentals of PUDDERing (Programming Under Deliberately Difficult Environmental Requirements). Cadence Magazine sponsored the first round of cities and promoted it (about a year) We took over and did
it ourselves for a while until it got old, by then many of our students had gone on to teach classes of their own. By then New Riders had Published AutoLISP
Concepts, the text book of choice for most of those classes.

I was just thinking of One navel officer sent from Washington to audit the class "it was like standing on the bridge of a destroyer in a 50 knot Gail with a funnel in your mouth".
The format worked well, we indoctrinated well over a thousand educators and engineers in small working groups of 6 to 25 from city to city.
We made hundreds of hard core converts over the years.
It is most rewarding when a student comes back later and shows you an application built from an old example that now solving a real world problem, or better yet producing something tangible.

If you want people to start talking about and using your language, you have to make it fun and easy to learn. Real world useful examples that people can begin hacking at and modifying to better suit their needs
works. You have a good start with the Demo Set.
Our most useful and most hacked examples were the short simple to the point solutions to problems that everyone could understand my not have themselves but could relate to. We have been known to have dreamed up a plausible sounding problems just to give meaning to an example :)

I admit it does help to know who your audience is, it was much easier with AutoLISP, we were dealing with engineers, structural, architectural, electrical,
mechanical, and manufacturing to name a few. They all had one thing in common.
An in depth knowledge of their discipline, and the ability to identify and work out solutions to real world problems.
What they needed was a understanding of how to translate their expertise into this strange new language that had been forced upon them by their supervisors or in some cases fate.

Kinda like the TK interface, it is here now, its all we have, so lets figure it out and use it, till something better evolves :)

Attracting converts is easy, keeping them active and producing is a bit harder.
Real world applications that promote the use of a language are always winners at attracting, good application examples keep them.

Here is a Good Hint. The distribution of Vertical AutoLISP applications did not begin until a method of "Protecting" the underlying LISP code that represented the "Process" from the causal hacker or irate employee.

If you have never been involved in automating a production or manufacturing process, against the wishes of the "Old Timers" and or the Union people,
conceder yourself lucky. There are many good reasons to lock up code besides keeping potential competitors from getting a jump start on duplicating a process.

Back to my Rat Killen..
Bob the Caveguy aka Lord High Fixer.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Very interesting your experience teaching AutoLisp and it pretty much sums up what my thoughts are about teaching: real world examples solving a real world problem, small enough to be 'hackable' and adaptable to your own flavor of the problem.

I never had the chance to learn AutoLisp but know that a lot of AutoLisp people have picked up newLISP (another big group is ex muLisp useres).

Apropos code locking: there is such a method in newLISP, see the file "link.lsp" in the source distribution, it also works with the Win32 version of newLISP and is one of the things Steve (adamss3 on this board) has inspired. It links the newLISP executable to an encrypted user lisp-source file, creating one executable containing everything necessary. This was also one of the reasons, we wanted a single Win32 newLISP binary without the need of Cygwin libraries. Read the header of link.lsp on how to use it.

But back to teaching, I think one of the advantages of newLISP is, that it is easier teachable than other LISPs. I simply relies on lesss concepts you have to learn, less CS theory etc.. and more of the kind of functions you need for solving real world problems, like string processing, regular expressions, network functions etc..

I think we have a pretty high powered group here together. As far as I know, all members in this group (and there are some ho haven't registered on the new forum) seem to be computer professionals, who do coding for a living, most of us are familiar with several computer and scriptiong languages and have done real world stuff with newLISP.

I think if just everybody goes through his/hears archives we will find a lot of interesting stuff.

But there is also another less experienced user of newLISP. Sometimes I get large numbers of downloads from some CS courses at some educational institutions somewhere, looking for an easy to learn LISP. What these people want are examples of typical AI-textbook examples, but in newLISP (i.e. Hanoi.lsp) . I have had this as a project on my ToDo list for a long time (having an AI and CS education myself), but never cam around doing it, perhaps I would need some partner at some *.edu institution.

Anyway lets got to work ...

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Really very interesting. As one of the people of the autolisp fraction I asked on the old forum for emulatiing autolisp (where Lutz makes the example with "repeat" and "foreach") and on the other hand for emulating/translation for DCL (Dialog command language) from autodesk which is similar to the TK concept. When we could do the things like in that good old tools, we would get much people to look at it. I would be a big advantage to read a DCL and translate it to TK with the callbacks intact.

Just some thought/dreams!

PS: I am hacking Autolisp over the hole day for living.
Hans-Peter

CaveGuy
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio
Contact:

Post by CaveGuy »

I agree there are a number of "nice" functions to be Riped from AutoLISP/Xlisp. I miss (setq a 1 b 2 c 3 ...)
the most. As for the Dog Chow Language last I looked it was a propriatory extension to AutoCAD and AutoLISP.
That reminds me we had better begin using AutoCAD(R)
and AutoLISP(R) before the autocops diss us for using their trademark improperly :)

I understand the investment you have in DCL, but I am not convinced that it is any better than TK and it would be a whole lot more effort to get working. The origional DCL code took a lot of work to shake out and get working. It had a 6 digit budget, not to mention a real nice employment package for the programmer who authored it.

There are and have been several AutoLISP clones floating around, I think the Russian boys did a nice job
with their compiler. I am not sure if the world reaily needs one more.

What we are working with here is an Open Source effort that has evolved around one persons primary efforts with little or no budget to work with.

More on this subject later, I do not expect it to go away :)
Bob the Caveguy aka Lord High Fixer.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Actually 'set' with multiple arguments and a builtin 'setq' (now as a macro in init.lsp), is something I wanted to add for a long time. I think I can do this with a minumum of additional code for the next version.

A typical case for this would be http://newlisp.org/mandelbrot.html which is full of potential multiple args 'set'.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Lutz, it nice that you are open for improvments in that direction's. Thanks for that. (I liked the setq makro, but a native support is always better)

CaveGuy, of course you are right with your points about a true DCL-emulation, I was just loud thinking/dreaming. But it might be possible to take it as a modell which we want to reach with TK. So a lispy sort of easy setting up an interface and defining all needed callbacks for the interface. When this would be very similar to the way it is done in alisp, it would be easier to port some logik.

And to your point with the alisp-clone: I do not mean a clone, because a clone would have to run in autocad as the enviroment. I mean something which is near enough to general alisp-logik, but has no intention to the grafik/cad-related commands.

Just my 2 cents ;-)
Hans-Peter

CaveGuy
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio
Contact:

Post by CaveGuy »

HPW wrote: And to your point with the alisp-clone: I do not mean a clone, because a clone would have to run in autocad as the enviroment. I mean something which is near enough to general alisp-logik, but has no intention to the grafik/cad-related commands.

Just my 2 cents ;-)
There have been, several OtherCADs with LISP interfaces.
At one point a few years back I worked with Bentley Systems testing an AutoLISP compliant LISP
for Microstation. The project was canceled by the Legal Department.
I beta tested an early copy of FelixCAD, it came out of the Father-land from an AEC firm, Grabert
or something like that, it has now become PowerCAD. I have no Idea of what happened to CADkey
but I know of at least one version that had both a LISP and ADS interface. The first group out of the old USSR, became KGB Software out of England, that is who AutoDESK purchased the original AUTOLISP compiler. A second group from the old USSR, moved to Pennsylvania and commercialized the LISP compiler and took kit for AutoCAD calling it VitaLISP, they ended up selling out to AutoDESK and became VisualLISP.
It seems so long ago, in another life, when I look back at it. This was all started happening about the time, The Wall came down, John moved to CheeseLand to avoid the IRS, and Autodesk Development Group Europe took control.

It is my opinion, based on personal observation. Any attempt to duplicate the Dog-Chow-Language will be meet by a 400 pound gorilla in the form of AutoDESK's legal department.
If I was young and stupid with nothing to loose, I might conceder doing it, and just to piss them off, then then sell out to them in the end. Na, dont think so :)
Bob the Caveguy aka Lord High Fixer.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

But I hope that you do not mean that a command like setq, foreach and repeat is under copyright protection of the 400 pound gorilla? ;-)
Hans-Peter

CaveGuy
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio
Contact:

Post by CaveGuy »

HPW wrote:But I hope that you do not mean that a command like setq, foreach and repeat is under copyright protection of the 400 pound gorilla? ;-)
(setq (foreach .... were all based on Dave Betz's(sp?) original code ,that is what JohnW started with. Dave created xLISP on a National Science Foundation Grant which put it in the Public Domain.

It is only the "NEW" stuff, mostly having to do with internal data formats, including DCL, that Autodesk is protecting.

Question, Have you got a handle on TK yet ? It is making my brain hurt, trying to make a form look like I think it should.

What I need is the example, I am attempting to write this weekend. :(

I have some general questions for all who are still following these rantings?

Is it just the three or four of us ?
Does anyone else have an opinion?
How many AutoLISPers are there in this group?

How about, Why are you still reading this thread ?
Bob the Caveguy aka Lord High Fixer.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I think with 6 members on this new forum there are not to much autolisper here in the moment. But if we would get some substantial to work it will be a matter of time to get more autolisper interested in newlisp.

I have had a look on the old xlisp-stuff from David Betz, because I was interested in the roots of the today tools. So good to know it is public domain.

My TK knowledge starts with Lutz demo-files and I bought the book from Brent B.Welch which Lutz had recommeded in another thread. I am diving into the book in the moment, but have not something worked out for my own. When Lutz talked about a more lispy way of doing the TK-stuff, I thought it would be good to listen to his ideas regarding the TK-stuff.
Hans-Peter

Locked