Arc Forumnew | comments | leaders | submit | vrk's commentslogin
1 point by vrk 6076 days ago | link | parent | on: Poll: Where are you from ?

Finland.

-----

1 point by vrk 6093 days ago | link | parent | on: Suggestion: constructors

This reminds me of Perl 6, where you can return "undef but true" (to indicate a nil value that still evaluates to true in boolean context, roughly speaking), or Haskell Maybe monad. Don't ask me more about those; I don't really understand monads.

-----

2 points by vrk 6095 days ago | link | parent | on: Kicking up more fuss about modules

This is exactly what Scheme's letrec does. Try it in mzscheme, which you will have installed if you're playing with arc1:

  (letrec ((foo (lambda (x) (bar x))) 
           (bar (lambda (x) (+ 1 x)))) 
    (foo 5))
(As an aside, it's beginning to be obvious how many redundant parentheses Scheme and most other Lisps have.)

-----

1 point by cchooper 6095 days ago | link

letrec won't work for non-function definitions, for example:

  (letrec ((x 5)
           (y x))
    y)
For this, you need let-star (not sure how to write that in markdown), but let-star doesn't give you forward reference, so nothing is quite right.

-----

5 points by shiro 6095 days ago | link

Oh, if you want that, check out letrec*.

http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_id...

-----

1 point by cchooper 6095 days ago | link

That's it, perfectly!

-----

4 points by pg 6095 days ago | link

You can just write let* so long as there is a space after the asterisk.

-----

1 point by cchooper 6095 days ago | link

Ah, the problem was I had a comma after it. Thanks.

-----

1 point by andreyf 5784 days ago | link

let*, huh?

-----

2 points by vrk 6095 days ago | link | parent | on: premature optimizations in Arc

Pardon the tangent, but in Perl 5 what you call the instance of the class is up to you. Conventionally it's $self, and the constructor is often new(), but these can be whatever you want. Unless you use a special CPAN module that does the work for you, the common idiom in declaring methods is

  sub method {
    my $self = shift;
    ...
  }
You could name it $myself, $this, or even $the_object if you wanted.

-----

3 points by vrk 6096 days ago | link | parent | on: acond for Arc

You could get rid of one nesting level by using with and uniq:

  (with (cl1 (car clauses)
         g (uniq))
     `(let ,g...
This will make the resemblance even stronger, since the Arc with is basically the same as CL let, sans extra parentheses.

-----

1 point by vrk 6097 days ago | link | parent | on: Modules : a proposition

Most module system proposals so far suffer from the same problem: macros won't work properly. However, this is not my conclusion, but what many people have stated. It's not entirely clear to me what the exact problems are. Could someone elaborate?

-----

5 points by soegaard 6097 days ago | link

Matthew Flatt.

"Composable and Compilable Macros: You Want it When?".

International Conference on Functional Programming

(ICFP'2002)

http://www.cs.utah.edu/plt/publications/macromod.pdf

And you are right, making modules and macros work together turns out to be harder than most people realize. Schemers have thought long and hard about the problem. It would be wise to look at the papers at

    http://library.readscheme.org/page5.html
before designing a module system.

-----

6 points by vrk 6097 days ago | link | parent | on: Really using git

Talk about ultimate hacker language: every hacker has his own version. Not a bad idea to try, though.

-----

3 points by vrk 6097 days ago | link | parent | on: Strings as lists, generic regexes

It doesn't matter how they are implemented (they can even be cons cells implemented as closures), as long as you can use the ordinary list functions to manipulate them. But this is the direction Arc is headed to anyway.

-----

3 points by vrk 6098 days ago | link | parent | on: Templating language or MVC-style arc?

I agree with both points of view!

- If you get the layout, including both how it should look and how things should work, from an external source, or if there is substantial external input, use templates. It will save time and headache.

- If you are just about the only one responsible for the layout but support skins (for lack of a better word; the CSS part), use the HTML tag functions and macros embedded in Arc.

Since Arc is at this point targeted for exploratory programming, the former is an unlikely case.

What I would like to see, though, is a templating engine akin to HTML::Template [1] in Perl 5. It has the minimum of control structures and extra syntax on top of standard HTML, just enough to make it possible to use the template for dynamic content. All templating frameworks suffer from the same fault, though: they define a new but severely restricted embedded language that's mixed in an unpleasant way with the HTML source. The language embedded in Arc is a much cleaner way to do things.

[1] http://search.cpan.org/~samtregar/HTML-Template-2.9/Template...

-----

2 points by tel 6098 days ago | link

Bingo.

Complex designed websites are pretty much impossible using Arc's current library. Well, unless you're a programmer/designer with a high pain threshold.

When Arc is no longer classified by whatever greek letter comes before alpha, it might be worth investing into a nice way to separate out some MVC/MTV/VH1/&c.

-----

3 points by vrk 6099 days ago | link | parent | on: Community

I would like to see the CPAN of Arc.

-----

More