Arc Forumnew | comments | leaders | submitlogin
3 points by rocketnia 5270 days ago | link | parent

I think your ideas have merit, but first take a look at how your examples compare to what you can already do in Arc:

  { let x 3 ; print x }
  (let x 3 prn.x)        ; Note: "a.b" effectively means "(a b)"
  
  { let x %1; print x}
  [let x _ prn.x]       ; Note: "[a b c]" is like "(fn (_) (a b c))"
  
  {let z arr[3]; print z}
  (let z arr.3 prn.z)      ; Note: "(arr 3)" is like "(cadr (cddr arr))"
  
  (call arr each (x) (print x))
  (each x arr prn.x)
As for "infix mini language" and "infix lambda mini language," I've seen a couple of infix libraries floating around, and I'm pretty confident it would only take about a page of code to make one from scratch. Mini-languages like that are what a lisp is good for. ^_^ Also, while I initially missed having infix syntax when I started out with Scheme and Arc, I eventually forgot why. Prefix syntax just takes some getting used to, I think.

That said, I am enthusiastic about mini-languages. :)

I wish you can declare strong and dynamic mode so it could be fast or dynamic.

Hmm, curious. I'm not sure I can comment much as far as lisps are concerned, but I can say I've been considering using Groovy++ instead of (or alongside) Groovy for video processing (via the Xuggler JVM wrapper of ffmpeg) in the future, and Groovy++ is basically just Groovy with the ability to make exactly that kind of declaration. So I agree it's a nice feature. ^_^

In an Arc context, I'm not sure a strong/weak typing or static/dynamic dispatch distinction makes much sense, but on the other hand Arc might have its own declaration possibilities.

For instance, if you declare a variable to be constant, that variable value could be hardwired into every function that uses it (which is kinda what Jarc's compiler already does). This could eliminate the need to "dispatch" through 'ar-apply. (Er, just so you're not totally lost, ylando, Jarc is an unofficial Arc implementation in Java, and 'ar-apply is a Scheme function in the official Arc implementation which does function calls on functions while also doing useful function-call-like behaviors on non-functions. For instance, above I mentioned that (arr 3) is like (cadr (cddr arr)) in Arc, and 'ar-apply is what achieves that.)