| Hello Arcists,
I'm pretty new to Arc and Lisp-Programming at all, and try to learn by doing. So based on blog.arc I try to make a small Chat for the local network. It's going pretty well, thanks to the great libraries and the documentation. But there are some things I really can't see a solution: As it's supposed to be a chat it needs autorefreshing(or?). But in a way that it loads the current (new) Posts, but keeps intact the text currently typed in the textarea(Or is there another way you see?). The corresponding code is this: (mac textpage body
`(chatpage
(center
(widtable 600
(tag b (link blogtitle* "chat"))
(br 2)
(if (no user) (do (pr "Not logged in")(br)(link "Login" "mylogin"))
(do (pr "Logged in as "user)(br)(link "Logout" "mylogout") ))
(load-posts)
(br 2)
,@body ;So here is post-page displayed I think...
(br 3)
(if (and user)
(aform ;And that is the textarea, which has to be not refreshed
[let u (get-user _)
(post-page u (addpost u (arg _ "t") (arg _ "b")))]
(tab (row "Say it:")
(row (textarea "b" 10 60))
(row (submit))))
(do(pr "For writig please ")(link "login" "mylogin")))))))
and it's called (for example) here: (def post-page (user p) (textpage
(for i 0 7
(awhen (posts* (- maxid* i))
(display-post user it)
(br)))))
This is all working, but if refreshed, it also refreshes the textarea. How can that be changed? With Frames? By Iteration? By some special feature? Or am I to split textpage into two macros? I really have no Idea here, advice would be very appreciated. If you want I post the full sourcecode.Another question: Is the Arclanguage forum or HN (or something similiar) open-source? I'd like to take a look on how it manages logging in, as I have problems to change the hello-page. Edit:
This is a very nice forum I have to say, great edititing and automatic code recognition! Never seen something as good as that. |