Arc Forumnew | comments | leaders | submitlogin
5 points by absz 6073 days ago | link | parent

Yes, it is possible. But first, a formatting tip: surround your code with blank lines and indent each line of code with two spaces to get it to look like a real code block.

What you want is defset, defined in "arc.arc". The idea with defset is that you define what will happen when = sees something of the form (name ...) as its first argument (called a "place"). The best tutorial for defset is http://arcfn.com/doc/setforms.html -- it should answer your questions. Good luck!



2 points by zhtw 6073 days ago | link

Thanks for the tip. That way my first post, I didn't know how would it look.

Anyway looks like defset is exactly what I need. Thanks a lot!

-----

2 points by absz 6072 days ago | link

It occurs to me that there's another problem with this code: your use of t as a variable name. This is outright forbidden globally:

  arc> (= t (table))
  Error: "Can't rebind t"
. Though it does work locally, it is nevertheless inadvisable: t is the global "true" value (equivalent to 't). It's probably better to use tb as the name for your table.

Glad to be of assistance.

-----

2 points by sacado 6072 days ago | link

And don't ever use tab, particularily for a table : it is a macro's name so it will get you in trouble.

-----

1 point by absz 6072 days ago | link

Or we could fix that part of the language ;)

Seriously, that's one of my biggest standing irritations. If I have some time, I might look at fixing that in the Anarki, actually.

-----

2 points by zhtw 6072 days ago | link

I also had a problem with tab and also think that it should be fixed.

Btw what do I need to load to get the base language without any web stuff. Are there an official "base" part? As.scm loads all the libraries for me. Do I need to load arc.arc only to get the base language.

-----

1 point by absz 6071 days ago | link

Yes, that would be the way to do it, but I don't know a simple way to load only arc.arc.

-----