Arc Forumnew | comments | leaders | submit | jsgrahamus's commentslogin
1 point by jsgrahamus 2 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

reply

1 point by akkartik 2 days ago | link

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

reply

3 points by jsgrahamus 2 days ago | link

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

reply

2 points by akkartik 2 days ago | link

To call racket functions in anarki:

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

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

reply

2 points by jsgrahamus 1 day ago | link

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

reply

1 point by akkartik 1 day 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)"

reply

1 point by Pauan 27 minutes 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.

reply

2 points by jsgrahamus 16 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 12 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)

reply

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

It should build now

reply


Brendan?

-----

3 points by malisper 254 days ago | link

javascript

-----

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

Thanks, zck

-----


For a perpetual newbie in Lisp/Scheme/etc, they have been very helpful to me.

-----

1 point by hk_mars 446 days ago | link

I would also design a hackable lang. in the very-soon future. Now I have to work and live. hayhay... I like Paul. :)

-----

2 points by jsgrahamus 546 days ago | link | parent | on: What I learned from Icon

Unicon (http://unicon.sourceforge.net/) is the successor to Icon. Both languages had/have good support in terms of experienced people willing to answer questions.

-----


My Portuguese is a bit rusty. How about some background: Motivation, OS, hardware, reception by users, length of use, etc?

Thanks, Steve

-----

5 points by marcvs 590 days ago | link

hi, steve

I've been working at big newspapers/news companies here in Brazil for many years, but I'm not that happy with these companies strategies, so I decided to try some side project...

I don't know much about programming, so I decided to try something that was really simple. I'm a reader of Hacker News, discovered it's open source, and started looking for how to set up a clone. São Paulo is a really large city (11,32 million people live here), but we lack hubs to connect all these people (I think our news companies aren't doing that very well). So, I came up with this idea of applying the HN concept to a local news project.

To be honest, my main goal here is to learn more about programming and other technical stuff, so, it's been an awesome experience. The site runs on Amazon Linux AMI, and the majority of users are still my friends and the friends of my friends. (I finished the translation work yesterday). :P

It will be a pleasure to share more data with you in the following weeks! And thanks for all the help and support I found here.

PS.: "Espaço" can be translated as "Space", or a generic place. It's a common word in portuguese.

-----

3 points by jsgrahamus 589 days ago | link

Hi, Marcos.

Congratulations on all you've done starting even as a non-programmer. I'm impressed. Although I've been programming for decades, I have little experience in Arc or Lisp and have found the folks on this forum to be friendly and helpful.

Many years ago I lived in Brasil for about 2 years. Part of that time I spent in Sao Paulo: Pinheiros, Jacana, Santa and Jabaquara. Still have good memories of that time.

Ate logo.

-----

1 point by marcvs 589 days ago | link

thanks! e até logo! :)

-----


And for the successor of Icon: http://unicon.sourceforge.net/

-----


Here is a link from the originating site for Icon: http://www.cs.arizona.edu/icon/

-----


I've used this language off and on for decades. And Unicon is the successor (http://unicon.sourceforge.net/).

-----

2 points by akkartik 646 days ago | link

Care to do a mini-review? :)

-----

More