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

Topics - ale870

#1
newLISP newS / Compiled newLisp Android
July 11, 2014, 12:24:07 AM
Hello,

I wanted to use newLisp on my Levono IdeaPad A10 (great PC to work similarly as a normal notebook).

But the problem I haven't a Linux installation and I'm not so good to work with Linux in general. So I wanted to know if you could put in DOWNLOAD area a compiled version of newLisp for Android, like already existing versions for Windows, Mac, etc...

Thank you so much for your help!
#2
Hello,

I updated my newlisp dll with the one supplied with the latest distribution.

The problem is I cannot open it any more using Blitzmax and "LoadLibraryA()" (standard windows function).

If I try to register the dll using regsvr32 newlisp.dll I get the error:



The module newlisp.dll was loaded but the entry-point DllRegisterServer was not found.

Make sure that "newlisp.dll" is a valid DLL or OCX file and try again.





Can you help me?

Thank you!





EDIT: I'm using Windows 7 32bit edition
#3
Hello,

I need to read/write newlisp lists using an external program (like dll), so since I don't want to pass back and forth an entire list, can I read it using memcpy or similar?

I already read/write strings  and numbers (float and int) but lists....



Thank you!
#4
Hello,



is there any way to eliminate (or disable) some I/O functions from newLisp?



I wish to embed newLisp scripts inside some files downloaded from internet: imagine when you download an HTML page from internet, which contains Javascript. Well i want to create some specific pages containing newLisp code (to be executed on a local computer), but I I need to eliminate the possibility that someone may write some "dangerous" newLisp code. So I use newLisp as library, but I need to disable functions regarding read/write files, sockets, etc...



Is it possible? Can I use a trick?

Thank you for your help!



EDIT:


If I "erase" all "dangerous" functions using "constant" function

E.g.:

(constant 'write-file nil)



Is there any way, for an attacker, to restore the original value, or to write another, similar function to achieve the same behaviour? In practice, is there any way to write a function to read/write files without using the functions (write-file)?



Thank you
#5
Hello,

after several months of absence, I restarted to work with newLisp. In this time I made a lot of experience making 2D and 3D games.

Now I wanted to make "a big step": I'm working to create a program to make GUI and 2D games using newLisp as scripting language.

I'm working also to create an IDE to work with it and, maybe, I will restart to make the fancy editor I started in the past (ZuQu Editor).



I have a couple of questions:



1) Can I sell the environment for a cheap price (e.g.: 5 euro)? There are some problems to sell my complete environment regarding newLisp license? Am I obliged to publish the source code of my game engine if I use newLisp (due to its license)? Can I include newLisp DLL in the distribution or I only need to supply the web address so the people can download newLisp? I wanted to sell the game just to get some funds to maintain the site, the tools I bought, and to get some money (I could even accept some donations or sponsors).



2) Do you think it could be an interesting product?



Consider that I already made several tests, and I already made some optimizations and, it is FAAAAST!

Can you give me some comments, suggestions, etc... about it?



Thank you!
#6
Hello,



I wish to use newLisp in Linux, to access to Oracle database on a remote machine.

Currently I do this in Windows, using ODBC.

Can you give me hints, guidelines, or an example how to do that in Linux (I use Ubuntu server 10).

I wish to migrate newLisp Apache CGI programs in Linux environment.



Thank you for your help!
#7
Whither newLISP? / newLisp without collateral effects
December 16, 2010, 01:46:06 AM
Hello,



after some time I restarted to use newLisp! I love this language.



Now I wanted to try to use it implementing code to avoid the "famous" collateral effects. Since newLisp supports dynamic scope, it introduces them, but I can use some techniques to avoid it.



For example:


> (define (myFunc b)(println "SUM:" (+ a b)))
(lambda (b) (println "SUM:" (+ a b)))

> (setq a 10)
10

> (myFunc 5)
SUM:15
15
>


As you can see I introduced an external variable, so I "introduced" a collateral effect. I can simply avoid this by making the program in this way:


> (define (myFunc a b)(println "SUM:" (+ a b)))
(lambda (a b) (println "SUM:" (+ a b)))

> (myFunc 1 5)
SUM:6
6
>


Well, now see the following code:


> (setq counter 0)
(map
  (fn(x)
    (inc counter)
    (println "Value " counter " --> " x) )

  '("A" "B" "C") )

Value 1 --> A
Value 2 --> B
Value 3 --> C
("" "" "")
>


The problem is the variable "counter" introduces a collateral effect, but I cannot find a way to avoid it. Can you help please?

I'm very interested to solve this class of problems!



Thank you!
#8
newLISP newS / New site for newLisp and Live Code
December 15, 2010, 03:36:13 PM
I like two programming languages: newLisp and "Runtime Revolution" (now Live Code). So I decided to revamp my "old" sites and join them, in this new site.

"Live Code" and newLisp will be the central point of this blog, but they will be linked to other programming experiences also.

Even if these languages (and the programming environment) are so different, they have several common points:



   1. Both of them are cross-platform

   2. They are scripting languages

   3. newLisp is console-oriented, and" Live Code" is more graphics-oriented (GUI). So they can be combined to create amazing programs. They are two different faces of the same coin.

   4. These scripting languages are very different from the most common programming environments (like C, Java, Basic, Python, Pascal, PHP, etc...). In fact, newLisp is a functional language, and "Live Code" has a scripting-syntax very similar to the spoken English. Furthermore they are complete, flexible and fast!

   5. I like both of them :-)

   6. More and more (follow me and you will discover them by yourself!)



A newLisp developer can quickly create GUI interfaces to newLisp applications using "Live Code", and a "Live Code" user can get unique benefits using newLisp (distributed computing, simple interfacing to external libraries, etc...).



This is the link:

http://runrevwidgets.com/applications">//http://runrevwidgets.com/applications



So, get ready for this new exciting travel!



(Cheers)
#9
Hello,



lisp dialects work with the concept of "symbol": well, practically speaking, what's the difference between newLisp and Python?

Ok, ok, I know the difference (I use newLisp from several years ;-), but, maybe, I'm not able to "get" some key-differences.

I mentioned Python, but the concept is similar for other scripting languages.

See the following code:


(setq newlisp-code '(println "Hello world!"))

Well, I can evaluate it and I get:



>> (eval newlisp-code)
Hello world!
>>


I can do the same using (almost) any other script language:



a = "print 'Hello world'"
eval(a)


So, I know that in the second case the code is a string, instead in newLisp the code inside the list are symbols. But practically speaking, in the real-world, what's the real difference? Why newLisp is "better" than another script language?



In both languages I wrote some code then I evaluated it (and real-time parsing and "compilation" was required). Ok, we can talk about the "contexts" where the code is executed, but the main concept is the same.



(I don't know if my question is clear, but I hope so).



Thank you!
#10
newLISP in the real world / URL Encode / decode
April 06, 2010, 06:01:14 AM
Hello,

I need to apply URL encoding on a text (see: http://www.blooberry.com/indexdot/html/topics/urlencoding.htm">//http://www.blooberry.com/indexdot/html/topics/urlencoding.htm).

I know I can use several replace functions to accomplish the job, but is there any function to make it faster and with less code (maybe using MAP or something similar).



Thank you!
#11
Hello,



I need to read a list, but I want to get more than one value per loop cycle. This is an "abstract example":



(dolist ( (i j k) '(1 2 3 4 5 6 7 8 9) ) (println (i "-" j "-" k)))



Well, I could get something like:

1-2-3

4-5-6

7-8-9



In fact, at every loop I could "load" the variables with three values.

Is it possible with a specific function?



Thank you for your help!



(Hello to everyone, since it is some time I do not frequent this forum!)
#12
Hello,



I was reading an article on an italian magazine, and I found the following code:



(defun foo (n)
   (lambda (i) (incf n i)))


Well, this is an accumulator, and it returns another function that takes another number "i" and return "n" increased by "i".



Can you help me?



Thank you!
#13
Hello,



I found a problem: I need to create a string with "".



See here:


> (setq a (string "1" {} "2"))
"1\2"


Well, I tried in many ways, but I get an error, or I get a string with a double "\" instead a single "". I need it to create a Windows network path:



\myservershared_dirmyfile.txt



It seems incredible, but I cannot find a way, in windows (but I even made some tests in Liunux and the results are similar) to compose that string.



Please can you help me?



Thank you!
#14
Dear all,



I just released a prototype version of the new editor I'm creating: ZuQu.

It is an editor with some original features, like:



1) Innovative graphics interface

2) Originally designed to manage newLisp files

3) Create plugins using newLisp

4) It is not the best editor in the world (it is not its final target). Instead it will be a very flexible editor, containing specific features that you cannot find in other editors.

5) Much more!



Well, I released a prototype version either for Windows and for Linux (I have a Mac version too, but I cannot check it since I haven't a Mac!).



You can find more information and a small guided tour on my blog:



http://newlisp.wordpress.com/zuqu/">//http://newlisp.wordpress.com/zuqu/

http://newlisp.wordpress.com/2009/08/25/zuqu-editor-version-0-1/">//http://newlisp.wordpress.com/2009/08/25/zuqu-editor-version-0-1/
#15
Whither newLISP? / Insteresting challenge for us!
August 13, 2009, 03:07:20 AM
Hello,

I'm a newLisp fan, but I even like Java language, so I always check new features, improvements, planned features, etc...

Today I found "lambdaJ", a java library to implement, in java, some features of functional languages...



Well, this is my challenge proposal:

Look at LambaJ home page: http://code.google.com/p/lambdaj/">//http://code.google.com/p/lambdaj/



There are some examples about this library. They show how easily can be implemented some jobs using it. For a java developer it seems really interesting.

Well, I want to rewrite those examples in newLisp, but they must be:



1) Light and clear. Our newLisp language must implement the proposed algorithms better (code more readable ) than the one implemented in java.



2) newLisp code must be basically equivalent to java code (as length) or even shorter.



My final target is demonstrating that a real functional language like newLisp is better than any "simulation" built inside an imperative one!!!  :-)

I'm joking, but I think this is a good test to compare an imperative languaqe implementing some functional-like features, and a real functional language.

What's newLisp limitations? And java limitations?

Is the final code more clear and readable? Is it shorter? Is it faster? etc...
#16
Hello,



I just discovered a problematic behaviour in newLisp.



I installled newLisp on a Linux and on a Windows computer.



If I use the function (now) on Linux it supply the correct offset values:


> (now)
(2009 8 6 15 32 0 826945 218 5 -120 0)


Instead on Windows I receive a strange result:


> (now)
(2009 8 6 15 26 39 844033 218 5 2089937716 3473408)


Please note that Windows and Linux time works well (show the correct date/time).



Where is the problem in Windows environment?



Thank you!
#17
newLISP in the real world / newLisp as web server
July 31, 2009, 11:18:45 AM
Hello,



sorry but I have another question about newLisp as web server (using -http flag).

Well, I'm working with (command-event) function (and it works as expected), but I cannot get POST data. I tried to insert the code shown in the manual -using (device) and (read-buffer) - but it seems it does not work.

How can I get POST information from (command-event)? Is it possible? Else? How can I use post data without creating a real CGI?



Thank you again for your support!
#18
newLISP newS / Small error in an output message
July 31, 2009, 02:42:33 AM
Lutz, during newLisp web-server usage, if I call a non-existing page, I get:



> (get-url "http://127.0.0.1:4701/prova.ex">http://127.0.0.1:4701/prova.ex")

"ERR:404 File or Dirctory not found: prova.exrn"



As you can see the word "Directory" is not correct  :-)



Cheers
#19
Hello,

I'm working on Linux, and I don't know if that is a problem even in WIndows.



Well, I'm creating a network (now on my PC for testing...) in this way:

SERVER:


(command-event (fn (c)
  (println (string "COMMAND IS: " c) )))


I execute server with this command:

newlisp check-port.lsp -c -d 4702



CLIENT:



alessandro@alessandro1 ~ $ newlisp
newLISP v.10.1.1 on Linux IPv4, execute 'newlisp -h' for more info.

> (net-eval "127.0.0.1" 4702 {(+ 3 4)})
"COMMAND IS: [cmd]nnnilnnilnCOMMAND IS: (+ 3 4)(exit)nnnilnnERR: symbol expected : " IS: (+ 3 4)(exit)\n"n"
> (net-eval "127.0.0.1" 4702 {(+ 3 4)})
"COMMAND IS: [cmd]nnnilnnilnCOMMAND IS: (+ 3 4)(exit)nnnilnnERR: symbol expected : " IS: (+ 3 4)(exit)\n"n"
> (net-eval "127.0.0.1" 4702 {(setq a 1)})
"COMMAND IS: [cmd]nnnilnnilnCOMMAND IS: (setq a 1)(exit)nnnilnnERR: symbol expected : " IS: (setq a 1)(exit)\n"n"
>


I'm becoming mad!

* Sometimes the client hangs: lock prompt as if the server is "sleeping" (in this case if I stop the server then the client comes live again).

* Sometimes I simply get, as result, the string "[cmd]" (6 chars). Nothing else. Even if I insert many input commands.

* Sometimes I get the result you can see above.



What is happening? I think I'm doing something wrong, but where?

NOTE: If I eliminate the function (command-event) then everything is correct.



I need to use that function since I'm creating a centralized job scheduler. I have several PC, and I use a central unique server to schedule some activities. In the "client" computers I have newLisp as server (wait for "net-eval").

When in the central server an event happen, then it send the proper job to the client. I implemented some security features, but I need to use (command-event) to check the command that reach the PC clients, to avoid PC abuse.



Can you help me?



Thank you!
#20
Hello,



I think it could be useful adding an option (or creating a new function) to append some strings by automatically adding spaces. For example:



(append "my" "name" "is" "ale") --> "my name is ale"



Second request:

A function to perform more sophisticated upper-case/lower-case activities:

1) only capitals.

2) Only the first letter after a specific characteer (e.g.: ".").



Thank you.