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

#76
Sorry, I have test my code.



Thanks a lots.
#77
As manual said:
QuoteSlices or rest parts of lists or arrays as used in implicit resting or slicing cannot be substituted at once using setf, but would have to be substituted element by element.
.



If I want replace a piece of list to a element:


(set 'lst '(a b c d e f)
(replace-slice (slice lst 2 3) 'g)
lst --> '(a b g f)


I use:
(append (nth '(0 1) lst) 'g (nth 5 lst))

If have any other simple way to get result?
#78
I am exciting to get the reply of designer of newLISP.



Thanks Lutz!
#79
I use Vim to write newLISP code, but I like use newLISP-GS to run code, When I edit and save in Vim, Only way to refresh the content in newLISP-GS is to re-open a tab.



If have any setting option to make it auto-refresh?
#80
I use Perl write a Common Programming language Parser, But it is too complex to maintain and extend.



I try this project with Ruby, Lua, till I study Lisp.



After study Common Lisp, Clojure and Racket, I found only newLISP is suited for this project.



Thanks Latz, newLISP is best suitable language to write a common Programming Language Parser and Transfer.
#81
I think must have a type of data structure -> 'lazy-list' in newLISP, which would not be evaluted when passed into function as argument. most of list processing function would return a 'lazy-list'.
#82
newLISP in the real world / List or quoted List
May 29, 2014, 04:36:12 PM
function map accept a quoted list as its seconds arguments:



     (map inc '(1 2 3 4 5))



but above expression returned a list? or a quoted list? I think its should be a quoted list, because it could used with second map:



     (map inc (map inc '(1 2 3 4)))



I don't know if it is a macro with map, but the expression with map is evaluted with some delay.



How to know a primitive function is macro or common function?



The evaluted order about primitive function? I know `eval` is first should be evaluate than `println`.
#83
(rotate (copy "string"))
=> ?

(rotate "string") => "gstrin" ;; it is ok
(copy "string") => "string" ; it is ok too


version: newLISP v.10.6.0 32-bit on Win32 IPv4/6 UTF-8 libffi,

Platform: Winxp sp3
#84
Thanks cormullion nice reply.
#85
When I use with newlisp-GS:


(load "module-xxx.lsp")

on WIndows xp, Only valid path is $HOME.



Could I set many directory to load module without prefix directory name?
#86
As the manual said:


i for PCRE_CASELESS
m for PCRE_MULTILINE
s for PCRE_DOTALL
x for PCRE_EXTENDED


If I want use all this option together, How to write code?


Quote# Perl style

qr/a b .*? d/xms


If it should like:


(regex "^a b+ c .*? d$" "abbcnr123d" (+ 2 4 8))
#87
Thanks above nice reply.



I understand that Tail Call Optimization and literal of (Array 1 2 3) or (Hash 'a 1 'c 2) could slove by programmer-self use the framework of newLISP(macro or context).
#88
Hello everyone,



I found it is same that array literal with list literal, but they are different datatype.



    (list? (array 3)) => nil

    (array 3) => (nil nil nil)

    '(nil nil nil) => (nil nil nil)

    (list? '(nil nil nil) => true



other question, When I run:


    >[cmd](define (fibonacci n)
    (if (< n 2)
    1
    (+ (fibonacci (- n 1))
    (fibonacci (- n 2)))))
[/cmd]
>(fibonacci 100)


My comuter could not print result in ten minutes.



I like recursion, newLISP Hav not Tail Call Optimization?