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

BTW I just got a chance to look at this tonight. I changed it a little so that $ would work with '!' and '.'

Again thanks for the help! T.

  (define (has-ssyntax-char? string i)
    (and (>= i 0)
         (or (let ((c (string-ref string i)))
               (or (eqv? c #\:) (eqv? c #\~) 
                   (eqv? c #\&)
                   (eqv? c #\$)                
                   ;(eqv? c #\_) 
                   (eqv? c #\.)  (eqv? c #\!)))
             (has-ssyntax-char? string (- i 1)))))


  (define (expand-ssyntax sym)
    ((cond ((or (insym? #\: sym) (insym? #\~ sym)) expand-compose)
           ((or (insym? #\. sym) (insym? #\! sym)(insym? #\$ sym)) expand-sexpr)
           ((insym? #\& sym) expand-and)
     ;     ((insym? #\_ sym) expand-curry)
           (#t (error "Unknown ssyntax" sym)))
     sym))

  (define (expand-sexpr sym)
    (build-sexpr (reverse (tokens (lambda (c) (or (eqv? c #\.) (eqv? c #\!)(eqv? c #\$)))
                                  (symbol->chars sym)
                                  '()
                                  '()
                                  #t))
                 sym))


  (define (build-sexpr toks orig)
    (cond ((null? toks)
           'get)
          ((null? (cdr toks))
           (chars->value (car toks)))
          (#t
           (list (build-sexpr (cddr toks) orig)
                 (cond ((eqv? (cadr toks) #\!)
                        (list 'quote (chars->value (car toks))))
                       ((eqv? (cadr toks) #\$)
                        (list 'sym (chars->value (car toks))))
                       ((or (eqv? (car toks) #\.) (eqv? (car toks) #\!)(car toks) #\$))
                         (err "Bad ssyntax" orig))
                       (#t (chars->value (car toks))))))))

-----

2 points by thaddeus 5869 days ago | link | parent | on: Arc + Arduino + ARM

This is very cool stuff. Thanks for the posts.

I've ordered a sheevaplug and am waiting for it to get here already!

To start I'd like to see if I can even get arc up and running as you have, but after I'd also like to see if I can then hook up a touchscreen mimo using displaylink...

http://www.mimomonitors.com/products/mimo-720-S

http://plugcomputer.org/plugforum/index.php?topic=343.msg303...

the notion of having a monitor fed off the sheeva plug, without a video card, is really cool...

not sure what I will do with it, but I will figure that out later.

T.

-----

2 points by kens 5869 days ago | link

Now that Arc runs on mzscheme 4.x, it's really easy to run Arc on a SheevaPlug; it's just the same as any other Linux box.

I had tried running Arc on the SheevaPlug in the mzscheme 372 era, but that was a disaster. Mzscheme 372 isn't available for the ARM processor, so I tried compiling it myself, but the ARM FFI support wasn't there yet, so the compile broke, and I tried to work around that but ended up in a maze of compilation errors. But now you can just install the mzscheme 4.x package and you're set.

As for the MIMO USB-based monitor, also see the thread at http://plugcomputer.org/plugforum/index.php?topic=379.0 It seems easier to just buy a computer with video in the first place, but maybe that's just me :-)

-----

1 point by thaddeus 5869 days ago | link

I was thinking along the lines of automation lines/robotics or remote location web services running automation..... ie. you could walk up to one of many remote sheevas then hook up a portable mimo monitor to interface with it.

Arc having an interpreter where the program can dynamically be updated should be huge! potentially no downtime to optimize an algorithm running a production line - would save big $$$$.

-----

2 points by thaddeus 5876 days ago | link | parent | on: Arc hosting providers?

or you could roll your own on linode.

http://www.linode.com/

a little more expensive, but it's working well for me. T.

-----

1 point by zck 5876 days ago | link

Of the VPSs I was looking at, I was considering http://vpslink.com/ubuntu-vps/ , as it's only $8/mo. for their lowest level. But that can wait until I need it, as right now I'm not even sure what I'm going to do with my app other than show people. Thanks for the recommendation.

-----

2 points by thaddeus 5877 days ago | link | parent | on: Decimal numbers vs. rational numbers

I shouldn't make posts when I'm that tired :) I did mean to say : format numbers as a decimal rather than the fractional.

Num does the trick. I was looking for it at arcfn under "math" and "type", don't know why I didn't think of "strings".

Thanks! T.

-----

2 points by thaddeus 5879 days ago | link | parent | on: World's smallest Arc server

What new features do we want to hound/beg/plead pg for in Arc.next ... I'm sure he will love us for that ;)

  1. Keyword Arguments
  2. Image Manipulation (ImageMajik)
  3. FFI 
  4. More, More, More special syntaxes :)
etc etc...

-----


I avoid using anarki - after finding numerous problems running code that works with the official pg branch. And trying to understand what anarki is doing to my code when there's little documentation - it's like having a brain seizure - noob style ;).

As a per example: http://arclanguage.org/item?id=6383 ssyntax breaks 'exit-on-eof' ?

Anyway - I always try paruse anarki to learn from it since there are great code examples, but I am hesitant to jump on the anarki bandwagon.

Hoping I learn more by working through the code and trying to understand what's happening.

Thanks for the pointer though... T.

-----

1 point by rntz 5882 days ago | link

There's a reason anarki has a stable branch. Of course, it's horribly out of date now, which is why I'm (still) working on porting some of the old arc2 anarki's more useful features to arc3, without the cruft. (The delays have mostly been caused by me dithering on what the best way of handling CatDancer's idea of keeping hacks separate is; I have most of the actual features I wanted to port done already.)

-----

2 points by thaddeus 5882 days ago | link

Agreed, but if I was using anarki stable - I wouldn't have access to ssyntax.

My intent was not to disregard anarki or the work (which I know most appreciate) rather just to highlight my experiences.

-----


That's great - thank you.

It'll take me a while to step through this, but I appreciate the guidance.

T.

-----


yep - It was just me. ugh.

Silly me - I decided to add version nums to my arc directories...and missed one parameter.... - thanks for both replies. T.

-----

4 points by thaddeus 5883 days ago | link | parent | on: As.scm and relative paths

To launch arc - I use a unix command file:

  #!/bin/sh
  (cd /home/programs/arc;
   /home/programs/scheme/bin/mzscheme -f as.scm)
As for windows read:

http://arclanguage.org/item?id=9263

and

http://arclanguage.org/item?id=9382

Also - here are a few others to read:

1. Starting an arc script: http://arclanguage.org/item?id=9617

2. Easy means to search the arc forum: http://af.searchyc.com/

3. Good documentation: http://arcfn.com/

-----

1 point by thaddeus 5883 days ago | link | parent | on: As.scm and relative paths

I am not sure if I understand you -> you were originally loading code files from inside the arc directory, somehow, which worked.... Now you are putting your code in a file, elsewhere, and loading from the REPL ? using ... (load "\fullpath\file.arc")? which does not work? Or are your escaping from arc and switching directories then expecting everyting to still work?

More detail could help...

-----

1 point by erikb 5883 days ago | link

too far ahead. ^^ I just want to use the basic arc code from arc.arc and so on. The basic files load the other ones relative, but it seems they load it relative to my position, not to their own.

-----

More