Arc Forumnew | comments | leaders | submitlogin
1 point by shader 5536 days ago | link | parent

Ok, I've pushed the source table.

Here's what I changed:

1) def and mac now add entries to a table named source*

2) there are now two macs fro accessing those entries: lsrc and src. lsrc returns the source as a list, so that you can modify it, etc. src pretty-prints lsrc, so that you can read it better from the repl.

3) I also changed fns so that it a) takes both arguments as optional and b) will accept symbols as arguments. Here's a few examples on how to use fns:

  arc> (fns)
  *returns the signatures of all macros and functions currently defined*
  arc> (fns f)
  *returns the signagures of all functions and macros beginning with f*
  arc> (fns nil [fancy-filter _ ])
  *returns the sigs of all fns and macs which pass fancy-filter.*
In the last form, the br-fn cannot reference the first argument.

It could possibly be modified so that it tests if the single argument is a function or a symbol, and if it is a function it treats it as the filter, otherwise it uses prefix with the string of the symbol.