Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - BDunbar

#1
This looks interesting ...



http://lisplets.sourceforge.net/">http://lisplets.sourceforge.net/


QuoteLisplets are Java Servlets that forward their requests, and gather their response headers, using s-expressions over sockets. They enable easy integration of Common Lisp or Scheme into a Java-based web environment.



The library consists of a single Java class which implements HTTPServlet. It packages the request header, parameters, cookies, session, application, and user info into an s-expression and sends it over a TCP socket that can be read from Lisp using read. The Lisp process returns status, headers, session and application state as an s-expression, followed by the document content. This servlet should work with any servlet container, such as Tomcat, Resin, Jetty, JRun and many others.


Reading between the lines it looks like Rich Hickey popped this out, then went out and released Clojure a year later.  If a google query is anything to go by it looks as if no one has really used it since.
#2
If you prefer a different default directory from $HOME upon start of newLISP-GS, edit the hidden $HOME/.newlisp-edit.conf



Exactly what was wanted - thanks!



I'll poke around with the hibernation settings.
#3
OS X - 10.6.8

newLISP-GS 1.44

newLISP version


Quote#  newlisp -v

newLISP v.10.3.3 on OSX IPv4/6 UTF-8.


Scenario:



- Open newLISP-GS

- enter some code

- save/execute that code

- Do some actual paying work for a while

- Close the laptop and go home

- Open the laptop hours later at home - I can no longer save, execute code, or do anything with newLISP-GS other than close.  Sometimes I have to kill the proc.



Is there some way I can avoid this?  It's not a killer - I like emacs for actual coding - but it sure is annoying.





Another question while I'm here



When I save-as it defaults to $HOME.  But then the next time I save-as - even the same file - it defaults to $HOME not the directory I last saved.



Is this by design?
#4
I have a need to authenticate and authorize users to an application.



Assume Application FOO.

Users Bob, Carol, Deke.



FOO will allow Bob, Carol, and Deke to login.

FOO will allow anyone to see stuff.



Bob can edit anyone's stuff.

Carol and Deke can write stuff, but only edit their own posts.



(I notice that I've just defined a blogging application.  Blogs are the new Hello World, I guess.)



So what I need, I guess, is a way to authenticate a user, and then to authorize them to do 'stuff'.



"Write your own" is a perfectly valid response.  But if someone else has done it already then I'd feel foolish re-inventing the wheel.



Also: tips, hints, or etc are welcome.  And thanks in advance.
#5
QuoteHmm, I don't remember seeing the error before.


OS X 10.6.8

Installed using the package



Nothing out of the ordinary about the system or what I've done to it, that I can think of.


QuoteHowever can you add the pathname for the newlisp executable in your repl.


So I can!

$ cat uppercase.lsp
:: uppercase.lsp - Link example
(println (upper-case (main-args 1)))
(exit)
$ which newlisp
/usr/bin/newlisp
$ newlisp /usr/share/newlisp/util/link.lsp
newLISP v.10.3.3 on OSX IPv4/6 UTF-8, execute 'newlisp -h' for more info.

> (link "/usr/bin/newlisp" "uppercase" "uppercase.lsp")
original newlisp executable:/usr/bin/newlisp
new executable:uppercase
source:uppercase.lsp
true
> (exit)
$ chmod +x uppercase
$ ./uppercase foo
FOO
$


Doing it the above way is probably 'newlisp-ier' and more optimal given that I'm trying to _learn_ something.  I already know how to make bash scripts.
#6
I lifted uppercase.lsp from the docs - but I don't think it's the problem?


$  cat uppercase.lsp
:: uppercase.lsp - Link example
(println (upper-case (main-args 1)))
(exit)
$
#7
$ ls
uppercase.lsp
$ newlisp /usr/share/newlisp/util/link.lsp
newLISP v.10.3.3 on OSX IPv4/6 UTF-8, execute 'newlisp -h' for more info.

> (link "newlisp" "uppercase" "uppercase.lsp")
original newlisp executable:newlisp
new executable:uppercase
source:uppercase.lsp

ERR: array, list or string expected : (file-info orgExe)
called from user defined function link
#8
New to NewLISP.  Also new to writing code that needs to be compiled and linked [1]



From the manual, '23. Linking newLISP source and executable" I find that to compile/link I need a copy of link.lsp and newlisp in the same directory.  Experimenting, I see symbolic links will serve the same purpose.



Now, before I hack up a bash script to create symbolic links in any given directory I want to compile in .. is there a better way to get 'link.lsp' and newlisp to the directory where the code is?  An already existing script?



~brian



[1] Last time I did anything like compiling and linking  [2] was with Clipper Summer of '87, in 1991.  Which was an extension language for dBase III.  So we're talking a super-long time ago.



[2] Not counting using gcc to compile and etc another's code.