Re: unhandled constant?

2020-02-01 Thread David Kastrup
/.cache/guile/ccache/2.2-LE-8-3.A/home/hanwen/vc/lilypond/ew.scm.go' >> [hanwen@localhost lilypond]$ GUILE_AUTO_COMPILE=0 guile2.2 ew.scm >> I-am-called-at-runtime xy >> Backtrace: >>6 (apply-smob/1 #) >> In ice-9/boot-9.scm: >> 705:2 5 (call-with-prompt ("prompt") # …) >> In ice-9/eval.scm: >> 619:8 4 (_ #(#(#))) >> In ice-9/boot-9.scm: >>2312:4 3 (save-module-excursion #) >> 3832:12 2 (_) >> In ew.scm: >> 10:10 1 (runtime-call "xy") >> In unknown file: >>0 (scm-error misc-error #f "~A ~S ~S ~S" ("No variabl…" …) …) >> >> ERROR: In procedure scm-error: >> No variable named xy in # >> But that is not using a local define at all. Can you point out the actual code that failed for you? -- David Kastrup

Re: unhandled constant?

2020-02-01 Thread David Kastrup
hat inner calls make-var (and accesses decl) which is only being defined at expansion time. The error message, however, rather appears to complain about inner being undefined rather than the definition of inner referring to undefined entities. Can you clarify? -- David Kastrup

Re: unhandled constant?

2020-02-01 Thread David Kastrup
Han-Wen Nienhuys writes: > On Sat, Feb 1, 2020 at 11:11 AM David Kastrup wrote: >> >> Here is an example that shows better how things work, and what might >> >> be the cause of my problems. Is it right that programmatically set >> >> contents of "

Re: unhandled constant?

2020-02-01 Thread David Kastrup
Linus Björnstam writes: > On Sat, 1 Feb 2020, at 12:09, David Kastrup wrote: >> >> Can you expand about the "expansion time and macro time separation"? >> >> If we have >> >> (define decl '()) >> (define (make-var n v) (list "

Re: definitions in macros?

2020-03-22 Thread David Kastrup
free expressions (namely quoted lists) and returns the last one which is (define q "i am Q\n") This then gets evaluated at run time, defining q . You probably wanted something like `(begin (define p ...) (define q ...)) as your body (and return expression) instead. > (my-macro-old 1 2) > (my-macro-new 1 2) > (display x1) > (display x2) > (display q) > (display p) > > > thanks, -- David Kastrup

Re: Do you recognize these modules?

2012-05-14 Thread David Kastrup
m checking in the changes or otherwise contributing them in a manner making clear that the contribution is intentional. Matching copyright headers are obviously a good indicator for that. -- David Kastrup

Re: Do you recognize these modules?

2012-05-14 Thread David Kastrup
later the owner says "You took the halter! I did not sell the halter!" that's a worse situation to be in rather than if he handed you the horse including halter, even though the halter is not in the contract. Frankly, in the given situation I should be rather surprised if there was potential for misunderstandings. It does look like both the intent to contribute as well as the compass of the contribution are quite well-understood. -- David Kastrup

Re: Register VM WIP

2012-05-16 Thread David Kastrup
other representation better suited to compile into code for a certain amount of registers. Of course, the threshold to picking actual registers of the available processor and compiling native code is then not all too large. -- David Kastrup

Re: %default-port-conversion-strategy and string ports

2012-05-30 Thread David Kastrup
oint of a string is to be an array of characters. Not an array of arbitrarily encoded bytes. -- David Kastrup

Re: %default-port-conversion-strategy and string ports

2012-05-31 Thread David Kastrup
l...@gnu.org (Ludovic Courtès) writes: > Hi, > > David Kastrup skribis: > >> Shouldn't strings be in "internal encoding" anyway? The whole point of >> a string is to be an array of characters. Not an array of arbitrarily >> encoded bytes. > >

Re: %default-port-conversion-strategy and string ports

2012-06-01 Thread David Kastrup
hout change. Things are complicated enough talking to the outside. There is no point in Guile being confused even when talking to itself. -- David Kastrup

Re: %default-port-conversion-strategy and string ports

2012-06-02 Thread David Kastrup
rguments both in favor and against separate binary/textual ports. The question binary/textual concerns ports connected to a file. String ports and Scheme ports should be _transparent_: input and output identical. They are used for connecting character streams within Scheme and should not tamper with them. -- David Kastrup

Growable arrays?

2012-06-09 Thread David Kastrup
would seem like a reasonably useful idea. After all, there already _is_ such a mechanism underlying hash tables so it seems somewhat peculiar not to have it available for vectors as well. Suggestions? -- David Kastrup

Re: Growable arrays?

2012-06-09 Thread David Kastrup
Krister Svanlund writes: > On Sat, Jun 9, 2012 at 2:32 PM, David Kastrup wrote: > > > One principal distinguishing feature, like with a Scheme > hashtable, is the ability to grow on-demand. > > Scheme/Guile vectors are fixed size. > > It is a bit

Re: Growable arrays?

2012-06-10 Thread David Kastrup
Daniel Hartwig writes: > On 9 June 2012 20:32, David Kastrup wrote: >> >> Hi, >> >> the main data structure of Lua is a "table", an associative array, and a >> table t has a continguous numerically addressed part from 1..#t, with >> all othe

Re: Growable arrays?

2012-06-11 Thread David Kastrup
Daniel Hartwig writes: > On 11 June 2012 12:37, David Kastrup wrote: >> What is a vlist? > > vlist is a data type introduced around guile 2.0. You will find it > documented in the Guile Reference under Compound Data Types. > > They are growable and provide vector-like

Re: Growable arrays?

2012-06-11 Thread David Kastrup
Andy Wingo writes: > You raise an interesting issue. But first, a nitpick :) > > On Sat 09 Jun 2012 14:32, David Kastrup writes: > >> Scheme hashtable > > To be very pedantic, there are no hashtables in R5RS Scheme. SRFI-69 > and R6RS specify them (in different way

Re: Growable arrays?

2012-06-11 Thread David Kastrup
f dynvector-grow!, doing the growth in a loop rather then just the determination of the new size seems a bit expensive: (while (<= (dynvector-capacity dynvector) k) (dynvector-grow! dynvector)) -- David Kastrup

Re: Growable arrays?

2012-06-11 Thread David Kastrup
Andy Wingo writes: > Hi, > > On Mon 11 Jun 2012 11:55, David Kastrup writes: > >> Tables are a superset of what I need here. I need the "growable vector" >> aspect, not the "hash part" aspect. Guile 1.8 only offers subsets: >> "growable&

Re: Growable arrays?

2012-06-11 Thread David Kastrup
David Kastrup writes: > Andy Wingo writes: > >> Hi, >> >> On Mon 11 Jun 2012 11:55, David Kastrup writes: >> >>> Tables are a superset of what I need here. I need the "growable vector" >>> aspect, not the "hash part"

Re: Growable arrays?

2012-06-11 Thread David Kastrup
David Kastrup writes: > David Kastrup writes: > >> Andy Wingo writes: >> >>> Hi, >>> >>> On Mon 11 Jun 2012 11:55, David Kastrup writes: >>> >>>> Tables are a superset of what I need here. I need the "growable vector&q

Re: Growable arrays?

2012-06-11 Thread David Kastrup
e point in thinking up yet another restriction that will make for a new data structure "complementing" the others? Why not just have a superset without arbitrary restriction and implement the other structures based on that? Then each one just needs to enforce its personal restrictions in its accessor functions, and otherwise just use what is there in the general mechanism. -- David Kastrup

Re: Growable arrays?

2012-06-11 Thread David Kastrup
Daniel Hartwig writes: > On 11 June 2012 20:00, David Kastrup wrote: >>> I guess to summarize: if you want an abstraction like tables, you would >>> build it out of vectors and hash tables.  But vectors and hash tables >>> themselves are the lower-level buildi

Re: Growable arrays?

2012-06-11 Thread David Kastrup
Daniel Hartwig writes: > On 11 June 2012 20:20, David Kastrup wrote: >>> P.S.: I still need to look at vlists.  They might already address this >>>       issue, though I can't use them in Guile 1.8. >> >> No, the "immutable" angle would make them

Re: Growable arrays?

2012-06-11 Thread David Kastrup
Andy Wingo writes: > On Mon 11 Jun 2012 16:19, David Kastrup writes: > >> Are you even reading what you are replying to? > > Please be civil. People are trying to help you. More like telling me off. Of course, I am perfectly able to implement my own moderately efficien

Re: Growable arrays?

2012-06-12 Thread David Kastrup
Mark H Weaver writes: > Hi David, > > David Kastrup writes: >> I don't think I need yet another data structure deficient in some >> respects. We have vectors that can't grow, hashtables that can grow but >> only index through a hash function, vlists that c

Re: Growable arrays?

2012-06-12 Thread David Kastrup
Mark H Weaver writes: > Hi David, > > David Kastrup writes: >> Mark H Weaver writes: >>> Simpler data structures can usually be implemented with less memory, >>> shorter code sequences with fewer conditional branches and less space in >>> the instruct

Re: Growable arrays?

2012-06-12 Thread David Kastrup
Mark H Weaver writes: > David Kastrup writes: >> Mark H Weaver writes: >>> C++, like Scheme, already supports fixed-size vectors in the core >>> language, so it would be redundant to include them in a library. >> >> A vector with run-time determined siz

Re: Growable arrays?

2012-06-14 Thread David Kastrup
Mark H Weaver writes: > David Kastrup writes: >> Scheme/Guile vectors are fixed size. [...] It is a bit of a nuisance >> that one can grow a hashtable efficiently and on-demand, but not so an >> array. > > Although Scheme vectors should remain fixed-size for reaso

Re: Growable arrays?

2012-06-14 Thread David Kastrup
Daniel Hartwig writes: > On 14 June 2012 22:47, David Kastrup wrote: >> Mark H Weaver writes: >> >>> David Kastrup writes: >>>> Scheme/Guile vectors are fixed size.  [...]  It is a bit of a nuisance >>>> that one can grow a hashtable eff

Re: Growable arrays?

2012-06-14 Thread David Kastrup
Daniel Hartwig writes: > On 14 June 2012 23:34, David Kastrup wrote: > >> Huh?  When resizing a hash table by doubling, you need to recoalesce >> each bucket to two buckets, one of which is the original.  Doubling >> the size of the underlying vector is a rea

Re: Growable arrays?

2012-06-14 Thread David Kastrup
Daniel Hartwig writes: > On 15 June 2012 01:15, David Kastrup wrote: >> Daniel Hartwig writes: >>> What is this half-in-place algorithm that makes this efficient?  If >>> the table is to remain balanced, all items should be rehashed and >>> realloc

Re: Growable arrays

2012-06-14 Thread David Kastrup
start index agnostic). Indexes in math often run from 1, being able to translate into a straightforward 1-based rendition can avoid transliteration errors. It is definitely a higher-level feature and not a fundamental property of underlying primitive data types, though. -- David Kastrup

Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
specified* I think that is wrong. A variable reference can't really be anything except eq? to itself in my opinion. As long as a Scheme object is not being manipulated in any manner, it should stay eq? to itself. What am I missing? -- David Kastrup

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Andy Wingo writes: > On Wed 20 Jun 2012 12:40, David Kastrup writes: > >> Numbers and characters are not equal to any other object, but the >> problem is they're not necessarily `eq?' to themselves either. >> This is even so when the num

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
David Kastrup writes: > I think it is completely absurd. It would mean, for example, that > (memq x (list x)) > is generally unspecified. It would mean that things like > (eq? (car x) (car x)) > are generally unspecified even when x is a pair. So that we can have (eq? x x) but

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
do so in an alternate universe. Again: it is fine if an optimizer chooses not to track object identities for numeric values. But if it doesn't, it needs to assume they are eq? when equal rather than some random choice. -- David Kastrup

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
er or running memq on a list containing a number. That would be interesting and apparently permissible behavior. I have my doubts that users will be impressed favorably. -- David Kastrup

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Andy Wingo writes: > On Wed 20 Jun 2012 16:31, David Kastrup writes: > >> Andy Wingo writes: >> >>> interesting and permissible optimizations >> >> Name one. > > FWIW, eta-conversion (for primitives). Copy propagation for the > purposes of inli

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Andy Wingo writes: > On Wed 20 Jun 2012 16:27, David Kastrup writes: > >> I am not comparing numbers when writing (eq? x x). >> I am checking the identity of an object. Whether that object is a >> number or not, and if so, what value it has, is irrelevant. > >

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Pierpaolo Bernardi writes: > On Wed, Jun 20, 2012 at 4:27 PM, David Kastrup wrote: >> Andy Wingo writes: >> >> If the Scheme standard states that >> >> (and (pair? x) (not (eq? (car x) (car x >> >> can return #t in a conforming implementation,

Re: MinGW vs. c-api.test

2014-06-10 Thread David Kastrup
remember correctly, even something like C:\tmp\nul.txt would serve as null device, though I cannot vouch for this remaining true with NT-based Windows systems. It was the case for those versions running on top of MSDOS I'm pretty sure. -- David Kastrup

Re: [PATCH] Skip invalid compiled file found, continue searching path.

2016-03-11 Thread David Kastrup
nstead of throwing early. Shouldn't we worry about switching _to_ guile-2.0 first? -- David Kastrup

Re: [PATCH] Skip invalid compiled file found, continue searching path.

2016-03-13 Thread David Kastrup
Jan Nieuwenhuizen writes: > David Kastrup writes: > > Hi David, > >> Shouldn't we worry about switching _to_ guile-2.0 first? > > Are you asking for help on this? Is there any to be had? I got a whole lot of promises from Guile developers over the years. Basical

Re: [PATCH] Skip invalid compiled file found, continue searching path.

2016-03-13 Thread David Kastrup
David Kastrup writes: [...] I apologize for sending this and the previous mail to the Guile-devel list in violation of my ban here. I had been of the impression that this was copied to the LilyPond developer list rather than the Guile developer list. Feel free to delete it. -- David Kastrup

Re: The “finalized” SMOB type

2016-10-08 Thread David Kastrup
*/ /* The setter and getter are unsynchronized.*/ GC_API void GC_CALL GC_set_java_finalization(int); GC_API int GC_CALL GC_get_java_finalization(void); This might be enough to make the scheme work. A whole bit of type field might be much, however. I seem to remember that there are only 8 to go around anyway. -- David Kastrup

Re: The “finalized” SMOB type

2016-10-09 Thread David Kastrup
mp; ~(scm_t_bits) 0xff00); + + return (void *) smobnum; +} this looks like only clearing the smob type field, leaving the flags in place. So if you really need some former type information for a decommissioned object, it could be stored in the flags (which are documented as still being referenceable). -- David Kastrup

Re: Interest in windows native port, interpreters for other languages and C++ binding API.

2017-02-01 Thread David Kastrup
pilation run is not an option. But you really cannot maintain one large project sensibly under two fundamentally different toolchains. Particularly not a GNU-relevant one that will want to be able to access a number of UNIX-typical facilities and programs in order not to degress into what programming was before the seventies. -- David Kastrup

Return value of hashq-set!

2011-10-19 Thread David Kastrup
Hi, in guile 1.8.?, hashq-set! returns the set value. That is quite inconsistent with the behavior of set! (which returns SCM_UNSPECIFIED) and undocumented as well. A good reason for that? -- David Kastrup

Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-03 Thread David Kastrup
. -- David Kastrup

What's with `symbol-set!' is deprecated. Use the module system instead.

2011-12-04 Thread David Kastrup
x27;s up with that? -- David Kastrup

Re: What's with `symbol-set!' is deprecated. Use the module system instead.

2011-12-04 Thread David Kastrup
David Kastrup writes: > The module system documentation provides _no_ _clue_ _whatsoever_ about > how something like > (symbol-set! #f (string->symbol name) value) > could be replaced. In fact, the module system documentation provides > _no_ _clue_ _whatsoever_ how to actu

Re: What's with `symbol-set!' is deprecated. Use the module system instead.

2011-12-05 Thread David Kastrup
David Kastrup writes: > David Kastrup writes: > >> The module system documentation provides _no_ _clue_ _whatsoever_ about >> how something like >> (symbol-set! #f (string->symbol name) value) >> could be replaced. In fact, the module system documentation pro

Re: Update and Questions

2011-12-06 Thread David Kastrup
t -pedantic should stay optional. -- David Kastrup

Re: when and unless

2011-12-06 Thread David Kastrup
t unspecified. I've actually wondered if it would not make sense to return *unspecified* in the case of the plain else-less if even if the condition is true, namely when you write (if #t #t). There is probably code relying on this to be #t, but frankly, this appears like a recipe for breakage. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-06 Thread David Kastrup
Thien-Thi Nguyen writes: > () David Kastrup > () Sat, 03 Dec 2011 16:45:06 +0100 > >The lack of procedure-environment in Guilev2 implies that I >have to wrap the stuff in (lambda () ...) in order to capture >the lexical environment for evaluation. > >

Re: when and unless

2011-12-06 Thread David Kastrup
Andy Wingo writes: > On Tue 06 Dec 2011 12:17, David Kastrup writes: > >> I've actually wondered if it would not make sense to return >> *unspecified* in the case of the plain else-less if even if the >> condition is true, namely when you write (if #t #t).

Re: when and unless

2011-12-06 Thread David Kastrup
27;m not > returning any values"? Testing for that is not all that much fun. It is also rather useless since pretty much all of the call-for-effect functions of Guile return *unspecified* rather than (values). It is not clear to me why (values) can't just evaluate to a single *unspecified* just like '() evaluates to null. Outside of call-with-values, I don't see much need to treat it special. -- David Kastrup

Re: when and unless

2011-12-07 Thread David Kastrup
"Chris K. Jester-Young" writes: > On Tue, Dec 06, 2011 at 11:08:08PM +0100, David Kastrup wrote: >> > Have you considered using `(values)' as your way of saying, "I'm not >> > returning any values"? >> >> Testing for that is not all

And another deprecation joke

2011-12-07 Thread David Kastrup
y _documented_? This is not the first such "deprecation" I have encountered, and it shows a blatant disrespect of the user base. -- David Kastrup

Re: when and unless

2011-12-07 Thread David Kastrup
7;t return a specified value when the condition is not true since then no form gets evaluated. So where is the point in returning a value that is only sometimes specified? "Sometimes specified" logically is pretty much the same as "unspecified", and then we might return *unspecified* right away. -- David Kastrup

Re: And another deprecation joke

2011-12-07 Thread David Kastrup
Andy Wingo writes: > On Wed 07 Dec 2011 13:58, David Kastrup writes: > >> `dimensions->uniform-array' is deprecated. Use `make-typed-array' instead. >> >> Unfortunately, this was not even called in the application. >> >> The actual function ca

Re: And another deprecation joke

2011-12-07 Thread David Kastrup
ubt that crashing and burning silently, as others apparently do, will be much preferable. -- David Kastrup

Re: And another deprecation joke

2011-12-08 Thread David Kastrup
e that sloppiness costs them their user and in following their developer base. If I wanted an incoherent junk yard of half-features, I would start with Common Lisp instead of Scheme. -- David Kastrup

Re: when and unless

2011-12-08 Thread David Kastrup
"Chris K. Jester-Young" writes: > On Wed, Dec 07, 2011 at 10:23:25AM +0100, David Kastrup wrote: > >> Well, you'd need to have >> >> (call-with-values (lambda () *unspecified*) (lambda x (length x))) => 0 > [...] >> That means that one _only_

Re: when and unless

2011-12-08 Thread David Kastrup
"Chris K. Jester-Young" writes: > On Thu, Dec 08, 2011 at 09:42:36AM +0100, David Kastrup wrote: >> So here is another proposal: (values) is not the same as *unspecified*. >> But if you take the first value of a values list in single-value >> contexts, there

Re: And another deprecation joke

2011-12-08 Thread David Kastrup
as unsavory as a bug has a sinister flavor to it after all. It has found a home and place it has been enjoying for years in peace and company. -- David Kastrup

Re: And another deprecation joke

2011-12-08 Thread David Kastrup
Andy Wingo writes: > On Thu 08 Dec 2011 21:32, David Kastrup writes: > >>> So please keep up your (useful!) bug reports, but try to give them a >>> more positive flavor :) >> >> Could you give an example how to deliver with a positive flavor a report >>

Re: And another deprecation joke

2011-12-09 Thread David Kastrup
writes: > ---- David Kastrup wrote: > >> An application "guile-bug" is mentioned nowhere. > > "bug-gu...@gnu.org" is a mailing list, not an application. You use > your email application to send the bug report. Indeed. At some point of time I lost

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-11 Thread David Kastrup
Marco Maggi writes: > David Kastrup wrote: >> Hi, if I have something read that is evaluated later, the >> lack of procedure-environment in Guilev2 implies that I >> have to wrap the stuff in (lambda () ...) in order to >> capture the lexical environment f

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-11 Thread David Kastrup
David Kastrup writes: > Marco Maggi writes: > >> David Kastrup wrote: >>> Hi, if I have something read that is evaluated later, the >>> lack of procedure-environment in Guilev2 implies that I >>> have to wrap the stuff in (lambda () ...) in order

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-11 Thread David Kastrup
Mark H Weaver writes: > David Kastrup writes: >> Basically I need to evaluate dynamic code in a given lexical environment >> rather than at top and/or module level. >> >> For a language that is supposed to be a building block for extension >> languages, not

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-12 Thread David Kastrup
Mark H Weaver writes: > David Kastrup writes: >>> In general, the _right_ way to build a custom extension language using >>> Guile 2 is to write a compiler that converts your language into one of >>> the other languages that Guile 2 supports. >> >&

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-12 Thread David Kastrup
and pieces where it is convenient. That it _integrates_ with a larger system. Lexical environments are a fundamental part of what integration may involve, and they operate at a different level as modules. Macros play _into_ lexical environments, so obviously Scheme itself recognizes the importance of being able to extend. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
some work, it could present a similar interface to > 1.8's `local-eval', `procedure-environment', `the-environment', and > such things. When we are forced to reimplement a toy Scheme interpreter from scratch anyway, including implementing every single defining form, one really has to ask oneself why pick Guile in the first place if it does not give you a Scheme language to work with? Just for the API? -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
ircular evaluator instead. You could likely also use Guile for _bootstrapping_ a meta circular evaluator. But that is not really the same thing. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo writes: > On Tue 13 Dec 2011 10:02, David Kastrup writes: > >> Lilypond's input language is not "David's current strategy". > > I was referring to your implementation strategy. It's not a strategy. Merely the least painful way to do things

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
lypond already has an ugly inefficient hack in it that will keep it working in regard of the closure department largely independent of whatever Guile development chooses to come up with next. > On Tue 13 Dec 2011 14:56, David Kastrup writes: > >>> I wonder if we could provide som

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
David Kastrup writes: > So I don't think that throwing out _distinguishing_ selling points of > Guile is necessarily doing you a favor. And the transparency with > which it integrates with its language environment and the fact that > one can continue to use its evaluator and

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo writes: > On Tue 13 Dec 2011 16:27, David Kastrup writes: > >>> It sounds like `current-bindings' is the thing you need. >> >> It will at least be a year before any solution that does not work with >> Guile 1.8 will be accepted into Lilypo

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo writes: > On Tue 13 Dec 2011 16:27, David Kastrup writes: > >>> It sounds like `current-bindings' is the thing you need. >> >> It will at least be a year before any solution that does not work with >> Guile 1.8 will be accepted into Lilypo

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo writes: > On Tue 13 Dec 2011 17:08, David Kastrup writes: > >> The current implementation wraps scraps of code into (lambda () ...) and >> executes them on-demand. So the expectation is that embedded Scheme >> code can have side-effects on the lexic

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
Andy Wingo writes: > On Tue 13 Dec 2011 17:54, David Kastrup writes: > >>> Am I missing something? >> >> Performance, space, simplicity, robustness. Compiling five closures >> that do nothing except accessing a single variable each is a bit >> wasteful

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
reliable idea what "memoize" means exactly in Guile's terminology, and the parts of the manual I have consulted have no qualms using this expression, but don't bother explaining it. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-13 Thread David Kastrup
ronment > representation. > > Anyway, it's looking in the wrong place. There is a compiler too. We might be miscommunicating here. Lilypond calls eval on the # and $ scraps (though I don't know whether that would be ice-9 or not). Actually, I have no idea what else it could call. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
, the enclosing code can't be optimized (in the current implementation, it is simply left uncompiled). So it is a good idea to place performance-critical code in functions separate from those where you need to capture the environment." should likely be enough. -- David Kastrup

Re: [PATCH] Implement `capture-lexical-environment' in evaluator

2011-12-14 Thread David Kastrup
ely because of not changing modules), I left worrying about this alone. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
Andy Wingo writes: > On Wed 14 Dec 2011 00:45, David Kastrup writes: > >> Andy Wingo writes: >> >>> On Wed 14 Dec 2011 00:00, Noah Lavine writes: >>> >>>> I haven't really been contributing to this thread, so please take my >>>&g

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
h undocumented internals is not safe to rely on at all. It can break at any point of time with no active Guile developer being in a position where he would feel compelled to fix it for the sake of Guile. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
access the power of Scheme transparently without losing expressivity in the main user language of your system. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
to turn GUILE into Emacs Lisp rather than implement Elisp on top of it. I have not actually looked at the respective code bases. That's just a gut feeling of what would be cool, and also provide a user experience that is not purely either/or regarding what layer one is working in. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
k that GUILE might be selling itself under value when compared to its competitors, possibly without compelling need when I look at the sketches of Mark and the discussion of them. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
e of the-environment) or more coherently (in the case of procedure-environment and local-eval). Then maybe enough people would have found a use for them that they would not have to rely on me to stand up for them. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
he string in order to get useful error messages. So it took work getting errors to throw where they belong. So at its current state, Lilypond itself does not much more than lukewarmly ask for local-eval. But for the sake of GUILE, I would consider it a mistake to lose sight of it. It is a powerful tool in the language embedding and self-awareness department. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
David Kastrup writes: > To be fair: this is what we currently do, and we only actually call > those lambdas that end up actually being recognized by the grammar. > So as long as (primitive-eval `(lambda () ,(read))) is guaranteed to > not ever choke, the potential for error is limit

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
articular, it will refinish macro expansion (so you don't want significant material behind it) and reevaluate the _whole_ eval it is in up to the point of calling my-env (so you don't want significant material before it). So it is more a joke than anything of practical value. But is _is_ good for a few dropjaws. -- David Kastrup

Re: Anything better for delayed lexical evaluation than (lambda () ...)?

2011-12-14 Thread David Kastrup
David Kastrup writes: > (define (my-eval form env) > (call-with-current-continuation >(lambda (x) > (env (list x form) > > (define-macro (my-env) > (call-with-current-continuation >identity)) > > > (format #t "~a" (my-eval &

Re: summary: lilypond, lambda, and local-eval

2011-12-15 Thread David Kastrup
to the previous code version running under Guile 1.8, robustness, cleanliness and manageability of the code have taken a step backwards. It's not a mile, but not trivial either. -- David Kastrup

Re: Update and Questions

2011-12-15 Thread David Kastrup
) Stallman -pedantic guile.scm looks redundant. -- David Kastrup

Re: Update and Questions

2011-12-15 Thread David Kastrup
Nala Ginrut writes: > -pedantic? Sorry, but I'm afraid I didn't see it in Noah's > description.  > > Anyone give me some context? gcc has an option -pedantic for strict standard adherence. -- David Kastrup

  1   2   3   >