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

As Arc compiles to MzScheme, Arc global variables become MzScheme global variables, and MzScheme stores global variables in a namespace.

-----

3 points by zhtw 5505 days ago | link

Yes, I understand that. And that's why I asked the question. Conanite said that it might be for performance reason. Do you think it is?

-----


I suspect that if you want to know about Arc's design goals, then pg's writings at http://www.paulgraham.com/arc.html is a better source than various random interpretations floating around on the forums.

-----

3 points by thaddeus 5511 days ago | link

Agreed. I do hope, however, that arc.v4.0 is structured in such away to move away from being news.arc centric. I hope pg chooses a different project to push down on arc. I think this would open the door to a fresh perspective.

-----

2 points by CatDancer 5532 days ago | link | parent | on: Help wanted: eval and lexical variables

Well, MzScheme's eval lets you pass in a namespace. Now a namespace is not a lexical environment. It's simply a collection of names and values. Arc uses one MzScheme namespace for its top-level environment. It would be pretty easy for you to create your own namespace and eval Arc expressions in that namespace, so that they'd see a different "top-level" environment than the main program does. However that's not going to give you access to lexical variables.

-----

4 points by CatDancer 5537 days ago | link | parent | on: Accessing .arc db files

Sadly this forum is for the brand new Arc language, not the ancient ".arc" archive format. You could try asking over at stackoverflow.com, someone there might be able to help you.

-----

2 points by CatDancer 5553 days ago | link | parent | on: Evsrv source

Not to worry, I myself have often ranted on some forum or another and the next day said "oops" :-)

Is there a particular open source license (or putting it in the public domain) that you're releasing your code under? I ask because I had earlier thought of doing something similar, though I hadn't started work yet. If you happened to be releasing your code under a license that I myself might not be able to use such as the GPL, then I'd want to make sure I didn't look at your source to avoid the possibility or appearance of copyright infringement if I did get around to doing my own implementation someday.

Thanks!

-----

1 point by palsecam 5553 days ago | link

Initially planned to release under GPL but it's too tiny to merit it, and after me being a moron, it would be too much.

Consider it is public domain. Use it for whatever you want.

Heck, let's be chauvinistic. Let's say it's officially under the WTFPL - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE (http://sam.zoy.org/wtfpl/), which is basically public domain. Quoting the license link:

Isn’t this license basically public domain?

There is no such thing as “putting a work in the public domain”, you America-centered, Commonwealth-biased individual. Public domain varies with the jurisdictions, and it is in some places debatable whether someone who has not been dead for the last seventy years is entitled to put his own work in the public domain.

-----

2 points by CatDancer 5553 days ago | link

Thanks!

Edit: I had suggested the Creative Commons CC0 license, but the Creative Commons FAQ says:

Can I license software using CC licenses?

We do not recommend it. Creative Commons licenses should not be used for software. We strongly encourage you to use one of the very good software licenses which are already available. We recommend considering licenses made available by the Free Software Foundation or listed at the Open Source Initiative. Unlike our licenses, which do not make mention of source or object code, these existing licenses were designed specifically for use with software.

Oops.

-----

1 point by palsecam 5553 days ago | link

The WTFPL has a more funny name :-)

More seriously, thanks for the link, good to know.

But for evsrv, don't worry too much about the license. Use it if you find it useful and this is all. I promise I will not sue you about it :-D!

Also seriously, despite its name, the WTFPL is no BS. As said on the license link, it's actually used, although rarely, for "serious" software, the type you can find in your favourite Linux/*BSD repositories. And the FSF recognizes it as a valid FOSS license (but not the OSI, I think).

-----

4 points by CatDancer 5554 days ago | link | parent | on: Your own Arc REPL, online

I think I may be able to clear up a bit of confusion here.

All (almost all?) of the code related to Arc so far has been released as open source by various authors, including rntz's extensive work with Anarki.

Thus when code hasn't been released, it's been because the author doesn't think it's good enough yet, instead of because the author wants to keep it proprietary.

So when one of us sees something cool, it's not uncommon for us to say, "oooh, we'd like to see the source to that!" Not as a request to give away something proprietary, but to say that if someone has code that they'll be making open source anyway, to encourage them to go ahead and release it, because it looks cool.

-----


  (= (taskslist*.user task!id) nil)
could be

  (wipe (taskslist*.user task!id))

-----


Use a dynamic DNS service such as http://zoneedit.com/doc/dynamic.html . This will keep your domain pointed to your IP address as it gets changed by your ISP.

-----

2 points by zck 5557 days ago | link

Great advice. I set it up at http://zck.dnsalias.com:8080/ . The source is at http://zck.dnsalias.com:8080/source .

-----

2 points by CatDancer 5566 days ago | link | parent | on: how to refactor this code?

What is your goal for the refactoring?

-----

1 point by adm 5566 days ago | link

those three methods are similar except line processing. Can't we refactor those, where they will call a single method or macro?

-----

3 points by CatDancer 5566 days ago | link

untested, but perhaps something like this?

  (def ffilter1 (file func (o fldsep whitec))
    (ffilter file (fn (line)
                    (func (tokens line fldsep)))))
and similarly define ffilter2 using ffilter as well.

-----

1 point by adm 5566 days ago | link

  (def ffilter1 (file func (o fldsep whitec))
    (ffilter file [tokens _ fldsep]))
this should work? (just curious: since I don't have access to arc right now).

-----

3 points by absz 5566 days ago | link

You want

  (def ffilter1 (file func (o fldsep whitec))
    (ffilter file [func:tokens _ fldsep]))

-----

1 point by adm 5566 days ago | link

oops! I will test with this.

-----


'assoc will find for you the cons containing the key and value:

  arc> (assoc 'k2 mylist)
  (k2 v2)
so just modify the cons:

  arc> (= ((assoc 'k2 mylist) 1) 'foo)
  foo
  arc> mylist
  ((k1 v1) (k2 foo) (k3 v3))

-----

More