chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re : Re : Re : [Chicken-users] hacking the mailbox egg


From: minh thu
Subject: Re : Re : Re : [Chicken-users] hacking the mailbox egg
Date: Sun, 7 Jan 2007 23:33:24 +0100

2007/1/7, Kon Lovett <address@hidden>:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>
<snip>
> As you said, the first lines of queue.scm define some %car,... to
> 1/ be inlined
> 2/ use ##sys#slot
> Is it mandatory to do this to be included in the disabling-
> interrupts file ?
> Both of 1/ and 2/ ?

No. Is it not mandatory to ever use a sys namespace routine (there
are a few exceptions) & one should try not to use such routines. Do
not be confused by the use of ##sys#slot, etc. by mailbox. As I said
earlier it is the style of the original author & historical to boot.
Ok, I didn't fully understand.

>
> If the above is true, what are the real primitives of chicken (that
> can thus be used without 'getting out' of the file) ?

I do not understand "... without 'getting out' of the file".
Well, I meant "without running code that re-enables interrupts". And
I guessed the "re-enabling" is done when executing code from
"somewhere else". But I don't see what is the "somewhere else".
I.e. I don't see what triggers the "re-enabling".


Stay away from the "true" primitives of Chicken. These are inlined C
code. Chicken is primarily a compiler. You can see these things by
looking in the .scm source for Chicken units, like library.scm.

Whenever possible do not stray from R5RS or a SRFI. Your situation is
a little special since you are hacking an existing egg that does
stray (mostly for no good reason except history). You can freely
intermix '(##sys#slot p 1)' & '(cdr p)', they are the same thing. The
compiler will even recognize 'cdr' & inline it.

Again, the use of ##sys# stuff in mailbox is historical & not an
example for preferred style. Except for '##sys#thread-unblock!' &
'##sys#delq' which are unavailable in the global namespace.
'##sys#current-thread', '##sys#structure?', & '##sys#make-structure'
are available in other forms, & ##sys#check-structure can be done
differently.
Ok. I will post my code to get feedback and try to not use the sys and core
namespace.


>
> Thanks, and sorry for those lengthy questions,
> mt

No problem. Thanks for making look inside the mailbox code. I spotted
a bug. (Fixed.)
Great :)

Cheers,
mt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]