Arc Forumnew | comments | leaders | submitlogin
5 points by CatDancer 6153 days ago | link | parent

Do you mean to (re)define a global "yield" function on each call to defgen? In Arc, an internal def doesn't work like an internal Scheme define... it always sets the global top-level variable named as its first argument, it doesn't create a local binding as an fn or let would. (I couldn't tell if that's what you wanted to do or not).


2 points by applepie 6152 days ago | link

Ugh, the code was wrong. I'm starting to think that Arc didn't really learn the lesson (i.e. getting scope right).

IMHO, it would be cleaner if def behaved more like Scheme's internal define (i.e. create a new local binding and set!).

I'd keep the current behaviour of def under the name defglobal or something.

-----

3 points by nex3 6152 days ago | link

I added an "lset" form to Anarki that works just like Scheme's define.

-----