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

#16
yes, sometimes some features of newlisp make me confusion.



for instance, in-place modification

(define (myinc)
    (inc 0))

(myinc) => 1
myinc = > (lambda () inc 1)
(myinc) => 2
myinc => (lambda () inc 2)


of course, this feature be really good.  Just I've never seen in other languages.



i am learning newlisp in effort.



thanks all.





by the way,



1) i knowns win32demo.lsp. but is there win32gui module written using newlisp FOOP?



deal with BUTTON,TEXTBOX,LISTBOX,MENU,LISTVIEW,TREEVIEW control,etc



2) how to uncompress http gzip stream in memory with zlib? who has complete example of it. code of newlisp, not c/c++



i want to extract HTTP headers, such as Cookie..., and HTTP Body, but "get-url" cannot do it for me. I had to write my own one.



but i don't know how to do :(





in xmlhttp,we can do



getResponseHeader

getAllResponseHeaders



make things so simple.



Does any suggestion?  more detail more well.



thanks in advance.
#17
(setq a 2) => 2

(setq 'a 3) => 3

(eval a) => 2

(eval 'a) => 2

(eval ''a) => a



(setq a 2) equivalent to (set 'a 2)

(setq 'a 3) equivalent to (set ''a 3)?

but result is:

(set ''a 3) =>

ERR: symbol expected in function set : ''a
#18
Quote from: "rickyboy"

(define (is-attr-list? THING)
  (and (list? THING)
       (= '@ (first THING))))


(define (deep-clean PREDICATE LIST)
  (if (not (list? LIST))
      LIST
      (map (curry deep-clean PREDICATE)
           (clean PREDICATE LIST))))


> [cmd]
(deep-clean is-attr-list?
    '("dl"
      (@ ("class" "codebox"))
      ("dt" "Code: " ("a" (@ ("href" "#") ("onclick" "selectCode(this); return false;"))
        "Select all"))
      ("dd" ("code" "(find-all '(bananas *) data)"))))
[/cmd]
("dl" ("dt" "Code: " ("a" "Select all")) ("dd" ("code" "(find-all '(bananas *) data)")))
>




to rickyboy:



Thank you very much for your reply.



I tried it. It works perfect.



Also once again thanks to ralph.ronnquist for your enthusiastic.
#19
Quote(find-all '(bananas *) data)


Very well!



This is exactly what I want! I didn't expect so simple.



Thanks for ryuo and ralph.ronnquist .



But how about to remove all attribute-list in different level of SXML?



This is more difficult, right?



What better way to do.
#20
I waited three days, no one answered me. This forum is too deserted.



okay, another question:



(set 'data '((apples 123) (bananas 123 45) (bananas 123 678) (pears 7)))
(assoc 'bananas data)


gets


(bananas 123 45)

how to 'assoc' the second 'bananas' list?



the question is, like this

(  (li "listitem 1")
   (li "listitem 2")
   (p "some text")
   (li "listitem 3")
   (p "some text")
   (li "listitem 4")  )


how to 'assoc' the nth 'li'?



is there a function can gets a collection of 'li' list?



anybody know? please help me. thanks
#21
when a xml document has been converted to SXML, and how to remove all attribute-list of it? these attribute-lists inside diference level of SXML.