Search found 123 matches

by jopython
Sun Apr 21, 2013 1:18 pm
Forum: newLISP in the real world
Topic: Multiprocess map - Parallel Map
Replies: 2
Views: 1057

Re: Multiprocess map - Parallel Map

Thanks cormullion. This looks like a implementation of mapreduce before spawn was introduced in newlisp.
by jopython
Fri Apr 19, 2013 10:17 pm
Forum: newLISP in the real world
Topic: Multiprocess map - Parallel Map
Replies: 2
Views: 1057

Multiprocess map - Parallel Map

Is there a Parallel version of map (which internally uses spawn) where we can control the number of procs used and timeout?

Something like

Code: Select all

(parallel-map func seq max-procs timeout)
This is for utilizing multiple processors instead of the regular map which is sequential.
by jopython
Fri Mar 29, 2013 9:17 pm
Forum: newLISP in the real world
Topic: Propositional logic example in Newlisp documentation
Replies: 2
Views: 1110

Propositional logic example in Newlisp documentation

I was looking at the newlisp manual today, and this caught my eye. I want to take this example a step further. Will it be possible to insert a function in the 'rules' database, so that i can make a query as follows? (query '(einstein minor)) See code below. (set 'facts '( (socrates philosopher) (soc...
by jopython
Sat Mar 09, 2013 3:11 pm
Forum: newLISP in the real world
Topic: module search path
Replies: 1
Views: 889

module search path

How to I add/edit the module search path?
The default is "/usr/share/newlisp/modules/csv.lsp"
by jopython
Wed Jan 09, 2013 1:42 pm
Forum: Whither newLISP?
Topic: How to get newLISP popular?
Replies: 11
Views: 7673

Re: How to get newLISP popular?

Cormullion,
The last time i heard GPL licensed apps are not allowed in the appstore.
by jopython
Sat Jan 05, 2013 7:54 pm
Forum: newLISP newS
Topic: libevent2
Replies: 6
Views: 6114

Re: libevent2

I wonder what this means for newLisp?
Does this mean we don't have to spawn a separate newlisp process for each http request because we have events?
by jopython
Mon Dec 31, 2012 9:53 pm
Forum: newLISP in the real world
Topic: -=((( HAPPY NEW YEAR 2013 )))=-
Replies: 8
Views: 2118

Re: -=((( HAPPY NEW YEAR 2013 )))=-

Happy New Years to y'all newLisper's.
Special thanks goes to Lutz and Cormullion. Both of them always seem to be perpetually available.
This is the best language community I have ever been part of.
Love you all.
Regards.
Jo
by jopython
Thu Dec 27, 2012 7:39 pm
Forum: Anything else we might add?
Topic: wish i could enter multiline expressions by default
Replies: 10
Views: 3610

Re: wish i could enter multiline expressions by default

But it broke readline capabilities.
Things i take for granted , Ctrl-A, Ctrl-E, Ctrl-P stopped working.
There should be a way to retain those features.
by jopython
Wed Dec 12, 2012 1:42 am
Forum: newLISP in the real world
Topic: Use map to process list of lines from stdin?
Replies: 4
Views: 1425

Re: Use map to process list of lines from stdin?

Nothing wrong with that.
But map is for transforming a list into a different one based on the function you apply.
You are throwing away the transformed list by just using a print function.
by jopython
Sat Dec 08, 2012 12:33 pm
Forum: newLISP in the real world
Topic: list to values
Replies: 4
Views: 1255

Re: list to values

HPW,

This is not possible if myvalues has a 'unknown' number of elements.
by jopython
Sat Dec 08, 2012 2:20 am
Forum: newLISP in the real world
Topic: list to values
Replies: 4
Views: 1255

list to values

Lets say I have a function which accepts 2 strings and three integers e.g (myfunc "str1" "str2" 3 4 5) However I have a list which contains these integer values. (setq myvalues '(3 4 5)) How can I convert the content of myvalues list to a set of values so that i can pass them to "myfunc" as argument...
by jopython
Thu Dec 06, 2012 12:55 pm
Forum: newLISP in the real world
Topic: Is there the name conflict of lambda in newlisp?
Replies: 11
Views: 2560

Re: Is there the name conflict of lambda in newlisp?

Thank you.
Maybe "def-static" should become a newlisp 'builtin'
by jopython
Thu Dec 06, 2012 2:26 am
Forum: newLISP in the real world
Topic: Is there the name conflict of lambda in newlisp?
Replies: 11
Views: 2560

Re: Is there the name conflict of lambda in newlisp?

Lutz,

Is it possible to use the def-static with lambda-macro?
by jopython
Mon Dec 03, 2012 1:05 pm
Forum: newLISP in the real world
Topic: formatting 'nil'
Replies: 9
Views: 1796

Re: formatting 'nil'

Thanks bairui and cormullion.
by jopython
Mon Dec 03, 2012 2:18 am
Forum: newLISP in the real world
Topic: formatting 'nil'
Replies: 9
Views: 1796

formatting 'nil'

I want the formatted output to look like follows for a csv file apple,,,peach But I get an error. > (setq fruits '("apple" nil nil "peach")) ("apple" nil nil "peach") > (format "%s,%s,%s,%s" fruits) ERR: data type and format don't match in function format : nil How to tell format to deal with an emp...
by jopython
Fri Nov 30, 2012 1:26 am
Forum: newLISP in the real world
Topic: Variable name clashes
Replies: 6
Views: 1535

Re: Variable name clashes

Lutz, The NEW macro.lsp has the same variable clash issue when I use default functors. newLISP v.10.4.5 on Linux IPv4/6 UTF-8 libffi, execute 'newlisp -h' for more info. > (load "http://www.newlisp.org/code/modules/macro.lsp") MAIN > > (macro (square-sum:square-sum X Y) (letn ((First X) (Second Y) (...
by jopython
Thu Nov 29, 2012 1:03 am
Forum: newLISP in the real world
Topic: Variable name clashes
Replies: 6
Views: 1535

Re: Variable name clashes

Lutz,

Thank you for the 'context' solution.
I also accept your advice for using macros.lsp for one liners only in future.
by jopython
Thu Nov 29, 2012 12:55 am
Forum: newLISP in the real world
Topic: Variable name clashes
Replies: 6
Views: 1535

Re: Variable name clashes

Thanks for the reply. I should have worded my question appropriately.

How to use variables/symbols in macros, so that in future these don't interfere with the user defined variables? In these case it is the 'First' and 'Second' variables.
by jopython
Wed Nov 28, 2012 9:45 pm
Forum: newLISP in the real world
Topic: Variable name clashes
Replies: 6
Views: 1535

Variable name clashes

> (module "macro.lsp") MAIN > (macro (square-sum X Y) (letn ((First X) (Second Y) (Sum (+ First Second))) (* Sum Sum))) (lambda-macro (X Y) (expand '(letn ((First X) (Second Y) (Sum (+ First Second))) (* Sum Sum)))) > (let ((First 9)) (square-sum 1 First)) 4 > Instead of getting a 100 , i get a 4. ...
by jopython
Sat Nov 17, 2012 1:34 pm
Forum: newLISP in the real world
Topic: what is the difference between let and letex
Replies: 3
Views: 941

Re: what is the difference between let and letex

Rickyboy, thank you for the explanation. I get it now.

Code: Select all

> (letex (x 1 y 2) '(x y))
(1 2)
> (let (x 1 y 2) '(x y))
(x y)
> 
I have to incorporate this to the way I think.
Can 'letex' be compared to 'C' macros?
by jopython
Sat Nov 17, 2012 1:39 am
Forum: newLISP in the real world
Topic: what is the difference between let and letex
Replies: 3
Views: 941

what is the difference between let and letex

Both look the same and behave the same:

Code: Select all

> 
(letex ((x 2) (y 3))
   (+ x y))

5
> 
(let ((x 2) (y 3))
    (+ x y))

5
> 
by jopython
Fri Nov 16, 2012 1:30 pm
Forum: newLISP in the real world
Topic: Sublime Text
Replies: 3
Views: 1451

Re: Sublime Text

What's wrong with emacs?
by jopython
Fri Nov 16, 2012 2:14 am
Forum: Anything else we might add?
Topic: Fun with MAP
Replies: 23
Views: 13967

Re: Fun with MAP

I didn't know there were so many variations of map.
Mindblowing, even though this thread is 6 years old.
by jopython
Thu Nov 15, 2012 2:27 am
Forum: Whither newLISP?
Topic: define-macro, letex and expand
Replies: 1
Views: 3301

define-macro, letex and expand

define-macro, letex and expand The examples in the code patterns book don't do any justice to these special forms. For someone like me who has come from run of the mill languages like Perl/Python these concepts seems to be far away. Correct me I am wrong. From what I learnt so far, these forms rese...