ns (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
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 "var&
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
(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
ile/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
the fortnightly monster crosscompilation 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 (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
*/
/* 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
David Kastrup <d...@gnu.org> 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
Jan Nieuwenhuizen <jann...@gnu.org> 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 t
GUILE_LOAD_COMPILED_PATH instead of throwing early.
Shouldn't we worry about switching _to_ guile-2.0 first?
--
David Kastrup
\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
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
Andy Wingo wi...@pobox.com writes:
On Wed 20 Jun 2012 12:40, David Kastrup d...@gnu.org 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 number comes directly from
David Kastrup d...@gnu.org 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 not (eq
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
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
Andy Wingo wi...@pobox.com writes:
On Wed 20 Jun 2012 16:31, David Kastrup d...@gnu.org writes:
Andy Wingo wi...@pobox.com writes:
interesting and permissible optimizations
Name one.
FWIW, eta-conversion (for primitives). Copy propagation for the
purposes of inlining (a la Waddell
Andy Wingo wi...@pobox.com writes:
On Wed 20 Jun 2012 16:27, David Kastrup d...@gnu.org 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.
x
Pierpaolo Bernardi olopie...@gmail.com writes:
On Wed, Jun 20, 2012 at 4:27 PM, David Kastrup d...@gnu.org wrote:
Andy Wingo wi...@pobox.com writes:
If the Scheme standard states that
(and (pair? x) (not (eq? (car x) (car x
can return #t in a conforming implementation, that means
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org 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 reasons I have
Daniel Hartwig mand...@gmail.com writes:
On 14 June 2012 22:47, David Kastrup d...@gnu.org wrote:
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Scheme/Guile vectors are fixed size. [...] It is a bit of a nuisance
that one can grow a hashtable efficiently
Daniel Hartwig mand...@gmail.com writes:
On 14 June 2012 23:34, David Kastrup d...@gnu.org 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 reasonable start
Daniel Hartwig mand...@gmail.com writes:
On 15 June 2012 01:15, David Kastrup d...@gnu.org wrote:
Daniel Hartwig mand...@gmail.com 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
reallocated
, 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
Mark H Weaver m...@netris.org writes:
Hi David,
David Kastrup d...@gnu.org 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 can grow but have
Mark H Weaver m...@netris.org writes:
Hi David,
David Kastrup d...@gnu.org writes:
Mark H Weaver m...@netris.org writes:
Simpler data structures can usually be implemented with less memory,
shorter code sequences with fewer conditional branches and less space in
the instruction cache
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Mark H Weaver m...@netris.org 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 size? Which
Daniel Hartwig mand...@gmail.com writes:
On 11 June 2012 12:37, David Kastrup d...@gnu.org 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
Andy Wingo wi...@pobox.com writes:
You raise an interesting issue. But first, a nitpick :)
On Sat 09 Jun 2012 14:32, David Kastrup d...@gnu.org writes:
Scheme hashtable
To be very pedantic, there are no hashtables in R5RS Scheme. SRFI-69
and R6RS specify them (in different ways), but do
Andy Wingo wi...@pobox.com writes:
Hi,
On Mon 11 Jun 2012 11:55, David Kastrup d...@gnu.org 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 does not come together with vector.
Why
David Kastrup d...@gnu.org writes:
Andy Wingo wi...@pobox.com writes:
Hi,
On Mon 11 Jun 2012 11:55, David Kastrup d...@gnu.org 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 does
David Kastrup d...@gnu.org writes:
David Kastrup d...@gnu.org writes:
Andy Wingo wi...@pobox.com writes:
Hi,
On Mon 11 Jun 2012 11:55, David Kastrup d...@gnu.org writes:
Tables are a superset of what I need here. I need the growable vector
aspect, not the hash part aspect. Guile 1.8
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
Daniel Hartwig mand...@gmail.com writes:
On 11 June 2012 20:00, David Kastrup d...@gnu.org 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 building blocks
Daniel Hartwig mand...@gmail.com writes:
On 11 June 2012 20:20, David Kastrup d...@gnu.org 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 unsuitable again.
Note
Andy Wingo wi...@pobox.com writes:
On Mon 11 Jun 2012 16:19, David Kastrup d...@gnu.org 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 efficient
Daniel Hartwig mand...@gmail.com writes:
On 9 June 2012 20:32, David Kastrup d...@gnu.org 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 other indices going through a hashing
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
Krister Svanlund krister.svanl...@gmail.com writes:
On Sat, Jun 9, 2012 at 2:32 PM, David Kastrup d...@gnu.org wrote:
One principal distinguishing feature, like with a Scheme
hashtable, is the ability to grow on-demand.
Scheme/Guile vectors are fixed size
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
in Guile being confused even when talking to itself.
--
David Kastrup
l...@gnu.org (Ludovic Courtès) writes:
Hi,
David Kastrup d...@gnu.org 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.
Yes, but I was referring to “string ports”, which may
.
--
David Kastrup
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
headers are obviously a good indicator for that.
--
David Kastrup
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
.
--
David Kastrup
the
portion of compile-time where the interpreter is running the compiler.
Bootstrap hell. If the copy of Guile already around happens to
produce different code, you have lots of fun ahead.
--
David Kastrup
Noah Lavine noah.b.lav...@gmail.com writes:
On Sat, May 5, 2012 at 12:42 PM, David Kastrup d...@gnu.org wrote:
Noah Lavine noah.b.lav...@gmail.com writes:
It appears to me (anecdotally) that most of the build time is spent
compiling Scheme code, rather than C code.
One idea I had been
to
be synchronized. I think this is reasonable. What do you think?
I agree.
I just reread what I replied, and it was probably hard to detect the
implicit I too between the lines of the diatribe.
--
David Kastrup
.
--
David Kastrup
are interested in getting to work on LilyPond again, this rock
of Sisyphos will already be on the other side, making room for more
rewarding things.
All the best
--
David Kastrup
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
How is this supposed to work for compiling and installing a package?
Basically,
make all
sudo make install
The usual case will be that the user calling lilypond will not have
write permission in the installed
benchmark by a percent or so without increasing code size.
With your compiler, the current compiler version, and on a particular
platform.
--
David Kastrup
Mark H Weaver m...@netris.org writes:
Hello all,
I occasionally talk about my large Guile TODO list, and sometimes people
say that I should put it somewhere public. Okay, here it is (not
including my ticked messages in Gnus).
Were you planning to do anything on the seventh day?
--
David
, and if we could tackle design or
maldesign questions mostly independently and in bite-sized chunks rather
than humongous patches moving material around, this would help a lot in
getting Guilev2 support on track.
Suggestions?
--
David Kastrup
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
with the stable release 2.16 of LilyPond looming around the corner, it
will become imminent soon to think about supporting Guile 2.0.
Previous attempts have mostly exploded around the problem that we have
something
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
with the stable release 2.16 of LilyPond looming around the corner, it
will become imminent soon to think about supporting Guile 2.0
like thinking the easiest path for a Franch-speaking newbie to
learn English is to start by learning Latin.
You'll find that kind of opinion expressed mostly by people fascinated
with Latin rather than English.
--
David Kastrup
Andy Wingo wi...@pobox.com writes:
Hi David,
On Sun 04 Mar 2012 13:01, David Kastrup d...@gnu.org writes:
The global symbol space is a different identity space than heap
equality, and it never gets garbage collected: the lifetime of a
gensym is eternal.
This is not true in Guile, where
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Andy Wingo wi...@pobox.com writes:
On Sun 04 Mar 2012 13:01, David Kastrup d...@gnu.org writes:
The global symbol space is a different identity space than heap
equality, and it never gets garbage collected
)))
(define call/ec call-with-escape-continuation)
Given the constraints of current guile-1 and guile-2, I doubt that there
is much to take away anymore from this solution.
Thanks
--
David Kastrup
- using symbols to denote names, like prompts, undoes the
hygiene that Scheme is supposed to have. But the only solution I can
think of is pretty messy.
Yup. call-with-single-continuation would make best sense as a primitive
for building other stuff, not the other way round.
--
David Kastrup
.
--
David Kastrup
Noah Lavine noah.b.lav...@gmail.com writes:
On Thu, Mar 1, 2012 at 7:00 PM, David Kastrup d...@gnu.org wrote:
Hi,
I am just meddling around with coding and have come up with the
following:
(define-public (find-child music predicate)
Find the first node in @var{music} that satisfies @var
(throw tag x)))
(lambda (tag x) (apply values x)
Oops. (apply values ...)? Does this even work? Anyway, you get the
drift. But it is not pretty and it is not primitive. And its failure
mode when you disobey the single contract is an uncaught exception
with a weird symbol.
--
David
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Scheme has a very useful property which your proposed syntax would
destroy: any valid expression can be substituted for any other valid
expression, and the result has the same meaning except for the
substitution
(lambda ( . x) (apply fun x))
I assume eval is not supposed to try dealing with dotted lists?
--
David Kastrup
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
I guess my real problem is that I'd like to do call wrapping by writing
(lambda ( . x) (fun . x))
instead of having to write
(lambda ( . x) (apply fun x))
I assume eval is not supposed to try dealing with dotted
David Kastrup d...@gnu.org writes:
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
I guess my real problem is that I'd like to do call wrapping by writing
(lambda ( . x) (fun . x))
instead of having to write
(lambda ( . x) (apply fun x))
I assume eval
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
A list in dotted tail position is evaluated via (map ... eval) rather
than (eval ...). I don't see much of a problem with that.
No, it's worse than that. I think you failed to understand my point,
so let me try
David Kastrup d...@gnu.org writes:
David Kastrup d...@gnu.org writes:
Noah Lavine noah.b.lav...@gmail.com writes:
Hello,
I've been working on a patch to add a new sort of optimization to
peval, and I think it's almost ready. It's based on some of the ideas
in Environment Analysis
occuring in practice. Can you suggest an example that would make more
sense than demonstrating that the optimization works? Is this supposed
to help with automatically generated code like macros?
--
David Kastrup
David Kastrup d...@gnu.org writes:
Noah Lavine noah.b.lav...@gmail.com writes:
Hello,
I've been working on a patch to add a new sort of optimization to
peval, and I think it's almost ready. It's based on some of the ideas
in Environment Analysis of Higher-Order Languages.
The goal
)) is a standard-compliant
implementation choice. I know this was a different discussion
altogether but thought it might be worth pointing out.
--
David Kastrup
of a clue about the other differences. But
this one _really_ comes at a dear price in its implications.
--
David Kastrup
.
--
David Kastrup
of that are.
--
David Kastrup
. Of course, if the subsequences _do_ overlap, you tend to
get colliding sequences instead of just single outliers.
--
David Kastrup
to be a problem at any time, it becomes much easier to diagnose.
--
David Kastrup
_sessions_
without coordination. So why bother with the lock?
To avoid both threads reading the same seed value before generating the
same number? I have not looked at the code, but that could be a reason
for serializing.
--
David Kastrup
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Mark H Weaver m...@netris.org writes:
Andy Wingo wi...@pobox.com writes:
Sorry for asking a stupid question, but why is it that we want the
gensym counter to be thread-local? Just to avoid the mutex? TBH I
don't
-with-current-continuation? a little too crazy is not a
criterion. Too complex to work or or with would be. Those are
related, but not necessarily the same.
--
David Kastrup
calling it, he is going
to be in for surprises.
--
David Kastrup
Marijn hk...@gentoo.org writes:
On 13-01-12 17:39, Mark H Weaver wrote:
David Kastrup d...@gnu.org writes:
However, my mind is not set in stone on this. Does anyone else
here agree with David? Should we defend the legitimacy of this
optimization, and ask the R7RS working group to include
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
(define current-module
(let ((top-level (the-environment)))
(lambda () (eval '(the-environment) top-level
Some more notes about the above code (changing `eval' == `local-eval'):
* (local-eval
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Well, deciding to use my guile checkout not just for reference, I tried
./autogen.sh, ./configure and make on master.
For now, it's best to stay on the stable-2.0 branch.
That's our current focus.
I see.
CCLD
of
standardizing on variable objects as a way to represent mutable
lexicals could suggest that the strength of even the theoretical
reasons might get eroded further. Of course, _calling_ mutual recursive
functions in execution before the second part has been defined will
remain unfeasible.
--
David
/guile/libguile'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/tmp/guile/libguile'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/tmp/guile'
make: *** [all] Error 2
Is that expected?
--
David Kastrup
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
I am not sure that the reasons for not permitting definition context in
local-eval are not of somewhat more theoretical than practical nature
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
Well, deciding to use my guile checkout not just for reference, I tried
./autogen.sh, ./configure and make on master.
For now, it's best to stay on the stable-2.0 branch.
That's our current focus.
Interesting
Mark H Weaver m...@netris.org writes:
David Kastrup d...@gnu.org writes:
You are suggesting that we wrap the expression within a (let () ...),
for the dubious benefit of allowing you to wrap the local forms in
(begin ...) instead of (let () ...).
Are there even situations where you could
David Kastrup d...@gnu.org writes:
In the light of local-eval evaluating a _form_ rather than a _body_
(stupid of me to forget), and seeing the weird semantics of begin, I
agree that an implicit (let () ...) wrapper for a single form does not
really appear to add significant gains. It would
, because (the-environment) is not a top-level form. If you
put (define x 5) in place of (the-environment), it would not set a
top-level variable; it would produce an error.
I am not saying that the actual code would need to work. It was more
intended as a show of equivalences.
--
David Kastrup
objects can make this string different from what it is.
And since there is no way to share the empty contents of an empty string
with other strings, this is true even if every empty string is eq? to
every other one.
--
David Kastrup
since you can always write down an explicit list of
variables yourself. It would be different if you were able to specify
the _classes_ of variable to capture.
--
David Kastrup
, one can't
prod Scheme into taking up another branch without letting that
continuation continue, so obviously something is missing in this
picture.
--
David Kastrup
Andy Wingo wi...@pobox.com writes:
Hi,
On Mon 05 Dec 2011 15:54, Andy Wingo wi...@pobox.com writes:
On Mon 05 Dec 2011 09:11, David Kastrup d...@gnu.org writes:
David Kastrup d...@gnu.org writes:
(symbol-set! #f (string-symbol name) value)
(module-define! (current-module) (string-symbol
? and mutable-string? (I
don't have Guilev2 installed), then would be the only string
satisfying both predicates.
Efficiency of implementation might make other choices preferable, but
that's what I would consider logically satisfying.
--
David Kastrup
1 - 100 of 160 matches
Mail list logo