Re: : Google Chrome extension for TryClojure (tr y-clojure.org)

2010-06-03 Thread Sina K. Heshmati
Heinz N. Gies wrote: > On Jun 1, 2010, at 22:26 , Sina K. Heshmati wrote: >>> "Heinz N. Gies" said: >>> >>> The DNS is fixed, try-clojure.org is now working too :) >> >> Not anymore! I was actually using it. I missed C-a C-k though. > >

Re: "special form" vs. "macro"

2010-06-01 Thread Sina K. Heshmati
alux wrote: > no special form at all? Cool, I'll have a look. > > Chapter 4.1 and 4.2 actually sit on my desk already since yesterday - > I just didnt read it. I hope I get a chance in the next days. If you have the time and motivation, go for it. Please note that, the wizard book had better be

Re: : Google Chrome extension for TryClojure (tr y-clojure.org)

2010-06-01 Thread Sina K. Heshmati
"Heinz N. Gies" said: > The DNS is fixed, try-clojure.org is now working too :) Not anymore! I was actually using it. I missed C-a C-k though. SinDoc -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

Re: "special form" vs. "macro"

2010-06-01 Thread Sina K. Heshmati
"alux" said: Hey alux, > what an interesting discussion! Whoo! ;-) > > Many thanks four your comment. > >> So, if you have lazy-eval, there's no need for special-forms. > > This is obviousely correct for if / cond. > > Looking into the other special forms ( http://clojure.org/special_forms >

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
Hi Meikel, Meikel Brandmeyer wrote: > On Mon, May 31, 2010 at 07:34:24AM +0200, Sina K. Heshmati wrote: > >> > (defn make-module >> > [] >> > (let [state (atom 0) >> > say-hello (fn [] (println "Hello")) >> >

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
Meikel Brandmeyer wrote: > On May 31, 3:15 pm, "Sina K. Heshmati" wrote: > >> True but my main concern is security of a running application. >> It could very well be that B is just a bunch of interactions, >> in which case B can enter A's namespace. >

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
Problem solved, see below. Meikel Brandmeyer wrote: > On May 31, 1:46 pm, "Sina K. Heshmati" wrote: > >> Here's my concern: >> >> - My program (A) is running. >> - B is running on the same VM. >> - B accesses the state of A. >> - B alters

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
"Meikel Brandmeyer" said: > On May 31, 10:58 am, "Sina K. Heshmati" wrote: > >> foo.datatype-01 => (reset! state 13) > ^^^ > > Again: of course you can! You are in the same namespace! In Clojure > the "unit" is a namespace

RE: "special form" vs. "macro"

2010-05-31 Thread Sina K. Heshmati
"Sina K. Heshmati" said: > "alux" said: > >> I got a very basic question about the concept of "special form". What >> is correct, multiple selections allowed: >> >> [ ] A special form is what can be implemented by a macro. > >

RE: "special form" vs. "macro"

2010-05-31 Thread Sina K. Heshmati
"alux" said: > I got a very basic question about the concept of "special form". What > is correct, multiple selections allowed: > > [ ] A special form is what can be implemented by a macro. Wrong. Macros cannot remove the need for special-forms, at least not in a real interpreter. In a metaci

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
"Meikel Brandmeyer" said: > On May 31, 9:37 am, "Sina K. Heshmati" wrote: > >> The atomic 'state' doesn't seem to be visible to the datatype methods. The >> question is why? >> >> (defprotocol prot-a >>   (op-a [self x y])

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
Sina K. Heshmati wrote: > Meikel Brandmeyer wrote: >> Am 30.05.2010 um 16:39 schrieb Sina K. Heshmati: >> > I'll later try to see if I can export datatypes from within a closure. The atomic 'state' doesn't seem to be visible to the datatype methods. The

Re: Datatype Usage Examples

2010-05-30 Thread Sina K. Heshmati
Hi Meikel, Meikel Brandmeyer wrote: > Am 30.05.2010 um 16:39 schrieb Sina K. Heshmati: > >> [2] >> http://github.com/sindoc/algorithms/blob/master/src/test/clojure/whiteboard/y2010/hide-adt-state-using-closure.clj > > I'm almost sure, that this code does not what

Re: Datatype Usage Examples

2010-05-30 Thread Sina K. Heshmati
"Adrian Cuthbertson" said: >> That said, I'd rather make sure that my low-level data structures are being >> operated on by only one implementation. > > You could use closures to encapsulate the refs/atoms ... > > (let [car-mem (ref nil)] > (defn set-car-mem [new-car-mem] > (dosync (ref-

Re: Datatype Usage Examples

2010-05-29 Thread Sina K. Heshmati
Krukow wrote: > Sina K. Heshmati wrote: > [snip] >> The only member data _I'm_ able find are the ones that are passed to the >> default >> constructor, namely at the time that the abstraction is reified. What if I'd >> have >> to give create a mem

Re: Datatype Usage Examples

2010-05-28 Thread Sina K. Heshmati
Hi Krukow, Krukow wrote: > SinDoc wrote: >> I was wondering if someone could point me to recent usage examples of >> deftype, defrecord, and reify. Reading [1] helped a lot but it wasn't >> particularly easy to find it since it's not linked from the sidebar. > > Blog: http://blog.higher-order.net

Re: Datatype Usage Examples

2010-05-28 Thread Sina K. Heshmati
Hi Meikel, Meikel Brandmeyer wrote: > SinDoc wrote: >> I was wondering if someone could point me to recent usage examples of >> deftype, defrecord, and reify. Reading [1] helped a lot but it wasn't >> particularly easy to find it since it's not linked from the sidebar. >> >> Specifically, what I'd