Arc Forumnew | comments | leaders | submit | jgrahamc's commentslogin
1 point by jgrahamc 5924 days ago | link | parent | on: Interface to SQLite in 23 lines of Arc

OK. I guess I can use the new Unicode support to change ! to X

Oops. I guess this forum doesn't support Unicode. That final character is a Unicode upside down !

-----


I find the use of . ugly here. It might be nice for structure access, but cut.s.i.j looks ugly to me. Why not (cut s i j)?

-----

3 points by mdemare 5924 days ago | link

I wanted to make Arc's examples as short as possible, but you're right - I've changed it now.

-----

1 point by jgrahamc 5924 days ago | link | parent | on: Interface to SQLite in 23 lines of Arc

It could be even shorter, db> doesn't need to be so complex. There's a bug in write which causes it to not flush output to a port and hence the need to flush directly, and I should be able to append the \r\n directly without doing writec. Was just getting a little tired when I got there :-)

Credit goes to Arc, and also to the C API for SQlite.

-----

3 points by jgrahamc 5924 days ago | link | parent | on: Detailed Arc "foundation" documentation

Very handy. Thanks.

-----

5 points by jgrahamc 5924 days ago | link | parent | on: Interface to SQLite in 23 lines of Arc

I'll jump right on that OR mapping with an implementation of ActiveRecord in Arc.

While I'm at it I'm planning to change (prn a) to (System.out.println a.toString) for readability.

-----

5 points by jgrahamc 5924 days ago | link | parent | on: New version

Also, it would be really nice to have the ability to connect to a remote TCP port. Something like:

(xdef 'connect-socket (lambda (host port) (let-values ([(in out) (tcp-connect host port)]) (list in out))))

-----

10 points by jgrahamc 5924 days ago | link | parent | on: New version

Cool.

Am I right in saying that write always flushes stdout instead of the port it's passed?

(xdef 'write (lambda args (if (pair? args) (write (ac-denil (car args)) (if (pair? (cdr args)) (cadr args) (current-output-port)))) (flush-output) 'nil))

-----

4 points by offby1 5924 days ago | link

I do believe you're right; I think I fixed that in the ac.scm available at git://git.nex-3.com/arc-wiki.git

-----

8 points by pg 5924 days ago | link

Oops, will fix.

-----


Wouldn't

(fn foo (a b (c 1)) <body> )

be even cleaner?

-----

6 points by rkts 5925 days ago | link

No: parameter lists in Arc are destructuring.

-----


Speaking as someone who's done a lot with GNU Make... don't make indentation significant!

-----

2 points by lisper 5920 days ago | link

And speaking as someone who is actually a Python fan, I agree: making indentation significant is a big mistake IMHO. Parens are a feature, not a bug.

-----


I have a web server in the UK which has space on it. I'd be willing to configure Apache as a reverse proxy into an Arc script of your choosing. You can have a little bit of space for free, if that's what you are looking for. If you start killing my server then you'll need to look for something non-free.

-----

More