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 - statik

#1
newLISP and the O.S. /
May 01, 2006, 12:22:51 AM
Why not use /Applications/Utilities/Terminal.app ?



Am I missing something?
#2
Anything else we might add? /
April 02, 2006, 09:17:01 PM
That's fine and all, but how does one handle files that are loaded via (load)? How do those file determine where they are?
#3
Anything else we might add? /
April 01, 2006, 10:25:44 PM
Does anyone know how I can get the cwd of the file being executed, or a way to get the cwd of any given process?



My problem is that realpath shows the working directory from where newlisp was started.



Example:



$ pwd
/home/statik/
$ cat code/test.lsp
(println (real-path))
(exit)
$ newlisp code/test.lsp
/home/statik/
$


I'd like a way to find the current working directory of the script being executed. Any ideas?
#4
Anything else we might add? /
April 01, 2006, 07:55:56 PM
I didn't realize you had implemented realpath into the latest dev... I'll check it out. Thanks.
#5
Anything else we might add? /
April 01, 2006, 02:46:27 AM
Any idea when (cwd) is gonna make into newlisp? Next release? Release after that? Eventually?



Also, PWD is an environtment variable, and you can clearly see that by doing the following at the command line:



$ set


Is there a reason why (env) does not utilize ALL available environment variables?
#6
Anything else we might add? / newLISP + FCGI
March 06, 2006, 11:32:24 PM
I read a few older threads here and while newlisp + fcgi was mentioned as being used or toyed with, I never could find anything that hinted at it's success...



If someone here has successfully gotten newlisp to work with fastcgi (and lighttpd would be nice too) please let me know how you managed to do so.



Or is there any ideas how it might be accomplished?



Thanks guys.
#7
newLISP newS /
February 13, 2006, 05:33:07 PM
Proof that people will find anything and everything to complain about.
#8
I am wondering what the easiest, or most efficient way is to search a string for all occurances of X and populating a list with each occurance. I've come up with a few solutions to this, but I am not sure that they are as fast or easy as they could be. I'd like to do a (find) with some regex on a string and throw each found occurance into a list.



Any ideas?



NOTE: In addition, I could use some mad regex fu. I need to scoure html source for all links and throw them into a list. Has anyone solved this problem already?
#9
newLISP in the real world /
February 13, 2006, 12:08:59 PM
Yes, you were correct in assuming a typo. Thanks for the help, that clarifies a lot for me.
#10
Anything else we might add? /
February 13, 2006, 12:03:54 PM
That is so awesome :-)
#11
newLISP in the real world / Contexts and Symbols
February 11, 2006, 04:48:39 PM
What would you suggest I mold into a habit?



Using a context prefix:

(context 'MYCONTEXT)
(define (myfunc , )
  (println MAIN:a)
)

(context 'MAIN)
(setq a 10)
(MYCONTEXT:myfunc)


or passing the value of a symbol when calling a function from another context:



(context 'MYCONTEXT)
(define (myfunc value , )
  (println myfunc)
)

(context 'MAIN)
(setq a 10)
(MYCONTEXT:myfunc a)


Is there anything I should keep in mind when using them?
#12
newLISP in the real world /
February 10, 2006, 12:31:53 AM
Is there a work around, or can we impliment a change? Does it work this way for a reason?
#13
newLISP in the real world / (case) evaluation
February 09, 2006, 03:12:19 PM
Can anyone tell me why the following is true:



(setq a 1)
(setq b 2)
(setq c 3)
(setq d 1)

(case d
   (a (do-this))
   (b (do-that))
   (c (do-something))
   (true)
)

=> nil


I understand that the comparative values in my case are unevaluated. When switched out for an (eval) the case still doesn't work.



(setq a 1)
(setq b 2)
(setq c 3)
(setq d 1)

(case d
   ((eval a) (do-this))
   ((eval b) (do-that))
   ((eval c) (do-something))
   (true)
)

=> nil


What don't I understand?
#14
newLISP in the real world /
February 01, 2006, 10:40:32 PM
Nah, I actually did this on OBSD. But regardless, your solution was perfect. Thanks :)
#15
newLISP in the real world / Dealing with binary data...
January 31, 2006, 05:33:39 PM
I can do the following in perl:



$ perl -e 'print "xcan"'
Ê
$


And as you can see the xca result is the Ê character. If I wanted to duplicate this very thing in newlisp, how would I do it?