Arc Forumnew | comments | leaders | submit | jsgrahamus's commentslogin

Why does your example return (list (a)) instead of (list a)?

Steve

reply

3 points by akkartik 2 days ago | link

Rest arg :)

reply

2 points by jsgrahamus 1 day ago | link

???

reply

3 points by akkartik 1 day ago | link

  (mac test a `(list ,a))
vs

  (mac test (a) `(list ,a))
Does that help?

reply

2 points by jsgrahamus 39 days ago | link | parent | on: Interested in being an Arc tutor?

lojic - What did you end up using Racket for?

-----

3 points by lojic 39 days ago | link

I've mainly just been learning the language. Working through some tutorials, reading books/articles, coding, etc. Did a few Project Euler problems, and now I'm working through SICP.

I burned a lot of time looking for my (not "the") perfect language, and finally settled on Racket for the dynamic language and OCaml for the statically typed language.

Now I'm trying see which problems are best suited to each of them.

Clojure has a lot of good things, but I've never been able to get past the dependency on the JVM, lack of tail calls, etc., but it's pretty darn concise.

The Racket community is incredibly strong IMO.

-----

3 points by jsgrahamus 41 days ago | link | parent | on: Interested in being an Arc tutor?

https://news.ycombinator.com/item?id=8906375

-----


My Android phone gave me a security alert on the apk.

-----

2 points by c-a-smallwood 50 days ago | link

It's not signed. Feel free to compile it from source :)

-----

2 points by jsgrahamus 67 days ago | link | parent | on: OT: Contract jobs

I've been contracting for the last few years. Hope to continue.

-----

2 points by jsgrahamus 67 days ago | link | parent | on: OT: Contract jobs

Thanks.

-----

1 point by jsgrahamus 73 days ago | link | parent | on: DrRacket(Libs) and Arc

Can anyone refer me to the method of accessing the underlying mzscheme or racket functions?

Thanks, Steve

-----

1 point by akkartik 73 days ago | link

You mean in Nu? % on Nu is like $ on anarki. Does that answer your question?

-----

3 points by jsgrahamus 73 days ago | link

I didn't specify. Could you give an example in each of them? Thanks, Steve

-----

2 points by akkartik 73 days ago | link

To call racket functions in anarki:

  arc> ($.pair? '(1))
  #t
In Nu:

  > (%.pair? '(1))
  #t

-----

2 points by jsgrahamus 72 days ago | link

Thanks, Akkartik. Is there a way to do such from arc itself?

-----

1 point by akkartik 72 days ago | link

No, you'll have to add it. The simplest way to do this is probably aw's original hack: http://hacks.catdancer.ws/ac.html

You'll need to add one line to ac.scm, and then:

  arc> (ac-scheme.pair? '(1))
  #t
Feel free to rename ac-scheme to $ or % if you think you'll use it often enough.

If you start using this you'll start finding the need for some of the other functions in that link, which transform data back and forth to the way racket or arc likes it. Come back and ask us more questions when you run into errors like this:

  arc> (ac-scheme.length '(1 2 3))
  Error: "length: contract violation\n  expected: list?\n  given: '(1 2 3 . nil)"

-----

3 points by Pauan 71 days ago | link

I would just like to point out that Arc/Nu is fully compatible with Arc 3.1, and it doesn't need conversions between Racket and Arc, so it's the easiest way to deal with Racket in Arc programs.

-----

2 points by jsgrahamus 87 days ago | link | parent | on: Mtl-arc - A new Arc implementation

Problem in building

  cc -o mtl-arc -std=c11 mtl-arc.c
  mtl-arc.c: In function ‘new_sym’:
  mtl-arc.c:46:2: warning: implicit declaration of function ‘strdup’ [-Wimplicit-function-declaration]
    symname(result) = strdup(sym);
    ^
  mtl-arc.c:46:18: warning: assignment makes pointer from integer without a cast [enabled by default]
    symname(result) = strdup(sym);
                    ^
  mtl-arc.c: In function ‘new_string’:
  mtl-arc.c:59:20: warning: assignment makes pointer from integer without a cast [enabled by default]
    stringval(result) = strdup(string);
                      ^
  mtl-arc.c: In function ‘new_builtin’:
  mtl-arc.c:118:15: warning: assignment makes pointer from integer without a cast [enabled by default]
    help(result) = strdup(doc);
                 ^
  mtl-arc.c: In function ‘char_to_token’:
  mtl-arc.c:170:2: warning: return makes pointer from integer without a cast [enabled by default]
    return strdup(cbuf);
    ^
  mtl-arc.c: In function ‘split_string’:
  mtl-arc.c:194:20: warning: assignment makes pointer from integer without a cast [enabled by default]
      *(result + i++) = strdup(token);
                      ^
  mtl-arc.c: In function ‘buf_to_string’:
  mtl-arc.c:212:2: warning: return makes pointer from integer without a cast [enabled by default]
    return strdup(buf);
    ^
  mtl-arc.c: In function ‘read_expr’:
  mtl-arc.c:327:4: warning: passing argument 1 of ‘split_string’ makes pointer from integer without a cast [enabled by default]
      char **nums = split_string(strdup(token), '/');
      ^
  mtl-arc.c:181:8: note: expected ‘char *’ but argument is of type ‘int’
   char **split_string(char *a_str, const char a_delim) {
          ^
  /tmp/ccMru0iN.o: In function `builtin_cos':
  mtl-arc.c:(.text+0x3b0e): undefined reference to `sin'
  /tmp/ccMru0iN.o: In function `builtin_expt':
  mtl-arc.c:(.text+0x3bd2): undefined reference to `pow'
  /tmp/ccMru0iN.o: In function `builtin_log':
  mtl-arc.c:(.text+0x3c53): undefined reference to `log'
  /tmp/ccMru0iN.o: In function `builtin_rand':
  mtl-arc.c:(.text+0x3db2): undefined reference to `floor'
  /tmp/ccMru0iN.o: In function `builtin_sin':
  mtl-arc.c:(.text+0x3e46): undefined reference to `sin'
  /tmp/ccMru0iN.o: In function `builtin_sqrt':
  mtl-arc.c:(.text+0x3ec7): undefined reference to `sqrt'
  /tmp/ccMru0iN.o: In function `builtin_tan':
  mtl-arc.c:(.text+0x3f48): undefined reference to `tan'
  /tmp/ccMru0iN.o: In function `builtin_trunc':
  mtl-arc.c:(.text+0x3fc9): undefined reference to `trunc'
  collect2: error: ld returned 1 exit status
  make: *** [all] Error 1

-----

2 points by c-a-smallwood 84 days ago | link

I apologize, I must admit I am terrible at creating Makefiles... I'll make fixing it top priority.

Among other things, I recently added a prototype curly-infix reader, which has been kind of fun coding with, because it makes math bearable, and it makes certain things easier to read. Along with variable negation, it seems quite handy.

examples:

(def isa (a b) {type.a is b}) => (def isa (a b) (is (type a) b))

{caar = [car car._]} => (= caar (fn (_) (car (car _))))

{1 + 2 + 3 - 4 - 5} => (- (+ 1 2 3) 4 5)

-----

2 points by c-a-smallwood 83 days ago | link

It should build now

-----


Brendan?

-----

3 points by malisper 325 days ago | link

javascript

-----

1 point by jsgrahamus 418 days ago | link | parent | on: Hacker News Down

Thanks, zck

-----

More