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

#1
newLISP newS / Re: We are hiring newLisp programmers....
September 16, 2016, 11:58:39 AM
wow! Job in newlisp, nice to see!
#2
Hi folks, have you seen rosalind.info, the website with bioinformatics problems and drills? I think those problems are a good food for newLISP. Look at statistics in top100 or by countries: which languages people use. Lisp is a rare bird there :-(
#3
Hi again, folks!



Tried to find the info in documentation and other forum topics but couldn't.



The question is about load function.



Say I have three files: main.lsp, lib/a.lsp, lib/b.lsp



How do I load file b.lsp into a.lsp if i load a.lsp into main.lsp?



This doesn't work:



; main.lsp:
(load "lib/a.lsp")

; a.lsp:
(load "b.lsp")


because current directory is defined by the directory where main.lsp resides, not the file being loaded.

I don't want to write absolute path as all files il lib directory can constitute a single library, and the lib directory can take arbitrary location in the local filesystem.



Is there some way to load b to a, however?
#4
the same effect happens with this function:



> (define (pp x) (push x '()))
(lambda (x) (push x '()))
> (pp 1)
(1)
> pp
(lambda (x) (push x '(1)))
> (pp 3)
(3 1)
> pp
(lambda (x) (push x '(3 1)))


For some reason the function creates a closure for its literals? (sounds sane? :-) )
#5
Some strange behavior:



(set 'lst '("23" "hello" "3.14"))
(float (lst 1))
; -> "3.14" instead of nil


Why so?
#6
newLISP newS / Re: new documentation revisions
November 05, 2012, 09:33:56 AM
-Joejoe, this time manually, with help of InDesign.
#7
newLISP newS / Re: new documentation revisions
October 28, 2012, 11:56:39 PM
Hi! I have made a pdf version for "Code Patterns in newLISP". Sometimes I like reading away from computer having text on the paper, so I have made it for my own use. But maybe it will be useful for someone else too.



http://files.rusvegia.com/newlisp/Newlisp%20code%20patterns.pdf">//http://files.rusvegia.com/newlisp/Newlisp%20code%20patterns.pdf
#8
Whither newLISP? / Re: online help
March 30, 2012, 02:27:48 AM
to jamesqiu's code I have added

(replace "?" func-name "p")

before regexping, to be able to detect also such functions as zero? or null?
#9
Ahha, thanks! I see there are a lot of threads related to my question.

Also notion of .init.lsp was new for me, great!
#10
Good european morning, folks!



Could anyone advice me how to make colored output in REPL (in Linux)?



Also I thought it would be good to have something like:

> (help curry)
Syntax: (curry func exp)

Transforms func from a function f(x, y) that takes two arguments into a function fx(y) that takes a single argument.  curry can be used on all functions taking two arguments.

Examples:
(set 'f (curry + 10))  → (lambda () (+ 10 (args 0)))
(map (curry list 'x) (sequence 1 5)) →  ((x 1) (x 2) (x 3) (x 4) (x 5))


for more comfortable learning of the language in the interactive mode. Plus it could be not only built-in functions, but also user-defined functions with help information somewhere around:



(define (my-func)

"...help information..."

....



or

# formatted help information

(define (my-func)

...
#11
newLISP in the real world / Re: "double symbol"
March 14, 2012, 04:57:52 AM
Oh, true. Thanks, cormullion!

Needed this to analyze what macroses get in the (args). Complex cases happen when macro calls another macro. Maybe I go in wrong way, but for the moment current the question how to detect the form (type) of argument is relevant :-)
#12
newLISP in the real world / "double symbol"
March 13, 2012, 04:32:36 AM
Hi! Maybe a simple question, but why double symbol is not detected as symbol?



(symbol? ''a) ; -> nil
; but
(symbol? (eval ''a)) ; -> true


What type of object is ''a (or e.g. '''''''''''''''''''''a) then?
#13
Thanks, cormullion. Seems I missed this topic while doing search in the forum.

Interesting, the issue also was raised by a person from Russia..

In my problem I need to know image size, as it is required in css styling, when using background image. It happens in a number of cases in the design of html layouts.
#14
I wonder if someone worked on some newlisp library that operates .jpg, .png, and .gif formats. I need to read width and height of an image. It would be great to have uniform interface, that will automatically detect a format of the image file (given as parameter) and read data common for all these formats.
#15
newLISP newS / Re: Artful Code
November 14, 2011, 01:27:54 PM
Wow, I like this discussion! Last months I touched Ruby on Rails and Django, but now I am thinking more and more about to come back to my idea of "lispization" and finally try to do something with that.

What I would say about HAML... Why not to go further and think on content that our browser gets from the server not as the page with header, title, body and footer but something more diverse and abstract? After all page metaphor appeared when internet was a bunch of text files with pictures tied together by hyperlinks. Yes, just like pages in the book or magazine, but not linearly ordered. Why should we limit ourselves by this metaphor only? In many cases I like more to see the content I get, like GUI layout, where each element/block acts separately. Then it is not so much about titles and paragraphs, tags and texts, as for something about blocks layout description, and description of interrelations of the blocks. Maybe there is also some third and fourth paradygm... Not only book's page. ...While HAML still is thinking in a page way.