Re: circumflex/caret
Bill Yerazunis <[email protected]>
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
From: Ger Hobbelt <[email protected]> Note that I have a few reports of 'make check' failing; nothing fatal so far; the build should still work for you. WARNING: the latest crm114-GerH supports scoped script variables, so a particular (ugly) variable instantiation use in scripts won't work any longer: see http://hebbut.net/Public.Offerings/crm114/crm114-BlameBarack-Branch-preliminary.html#scoped_variables Whoa!!!! Interesting! I tried something like that but got tied up in knots. For example: isolate (:a:) /Foo!/ # a is of global scope call /:capture_func:/ output /:a: is :*:a:\n/ :capture_func: isolate (:z:) /abcdefghijklmnop/ # make :z: be local match [:z:] /...(...).../ ( :: :a: ) # capture :a: into :z: return Now, :a: is attached to the 4th through 6th characters of :z: - but :z: is now _going away_. So, what does :a: have? Second question: are these scoped variables "dynamic" or "static" - that is, if I call a function with a locally scoped variable a second time, what is the value of a locally scoped variable? Is it retained between calls (i.e. "static", as in C), or is the locally scoped variable reinitialized from scratch (so DEFAULT values values will trigger in!) Third question: if it's really scoped, then there should be a way to create that local variable as an overlay, so it _keeps_ it's value on return, like this isolate (:a:) /foo/ call /:capture_func: output /:*:a:/ # should be back to /foo/ :capture_func: isolate (:a:) /bar/ output /:a:/ return This drove me to consider that perhaps we needed four different waus for a variable to be created: isolate - global scope dynamic - local scope, state lost on RETURN static - local scope, retained state match - global by default, but will flow with dynamic or static. In which case, doing a DYNAMIC or STATIC on a MATCHed variable does... what? Do they create local overlays, in which case the old (MATCHed) value is restored on RETURN, or does it change the type of variable so they're erased (for dynamic) or hidden (for static) on return? And if it's a MATCH captured variable, are changes made while in the subroutine kept in the outer variable, or rolled back on RETURN? These kinds of questions are why there's not been a mainline release with that functionality. The semantics are not trivial. But your notions make me think more clearly on this again.. (as well as rethinking multiple-values-return capability... which is yet another matter, but simpler than this one at least) - Bill Yerazunis ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H