← Back to team overview

ooc-dev team mailing list archive

Re: Fwd: OOC best practices

 

2010/6/2 Iván Hernández <ivanhv77@xxxxxxxxxxx>

> Hi. I've been interested in clojure lately and I didn't follow ooc
> evolution.


Ahah! Guilty of Clojureness =)


> It's been a long gap from j/ooc 0.3 up to rock 0.9. I wan't
> to try it in some real project, but I have no time now. I'd like to try
> to program a Java to ooc translator (just to have some fun trying to
> port SWT to ooc language, like it was done with D)
>

That would be interesting - they really did it that way with D? Seems quite
complicated. (Especially since the foreign interfaces of D/Java look
different)

>
> Concerning the topic, I'd rather favoring C style comments instead of
> bash style ones. Just as an exception, a program that starts with #!
> should skip parsing it's first line.
>

Yes, I agree with that.

>
> I like Ada or Lua comments a lot: just two minus signs as in
>  -- this is a comment
>
> I would vote for this, as they fit well in the language.
>

Well - even though they look nice, why add them since we already have '//'
?

>
> Sharp as macros are not (in my opinion) a good idea. A macro symbol
> should look like any other regular symbol in the language. The reason is
> that when doing macro programming you would achive ugliness with ease.
> Lots of sharps within the code are not the most aesthetically programs
> you'd be reading.
>

That's true but it would be potentially easier to read/to understand
like "what is it he's calling here? is it a function? a macro?"


> I think # would be useful as an operator (overridable if possible, can
> an operator in ooc be overriden?). Also, using it for building regular
> expressions from strings (like in clojure) as syntactic sugar would be
> great. You could write:
>   #"^abc"     instead of     Regex new("abc");
>
> Or we could just have a proper regexp literal syntax, e.g. /abc/


> Finally, # is a symbol noisy enough just to serve as a "compiler
> directive" symbol, like "#pragma" in C compilers. You could for instance
> disable optimization in source code with
>   #optimization(false)
>
> Here is my point of view about #.
>

Yeah I'm not sure about pragmas - what would they really be used for? I
mean, most settings can be controlled with compiler command-line flags, so..
I don't know.

Amos

P.S: Hit 'Reply All' next time, your answer was only sent to me.

Follow ups

References