Re: gh_inexact_p error in 1.7.x

2005-11-30 Thread Kevin Ryde
Bruce Korb <[EMAIL PROTECTED]> writes: > > - 40 if (gh_inexact_p(typ )) return GH_TYPE_INEXACT; > <<=== throws error Collateral damage from the change to scm_inexact_p (other message). Not sure how one or both ought to work. ___ Gu

Re: I don't want to maintain this

2005-11-30 Thread Kevin Ryde
Bruce Korb <[EMAIL PROTECTED]> writes: > > ERROR: Wrong type argument in position 1: # Ah, I see 1.7 now throws an error for a non-number argument to inexact?, where 1.6 would accept anything. Looks like a deliberate change "2003-11-19 Marius Vollmer", maybe he can say what motivated it. __

Re: I don't want to maintain this

2005-11-30 Thread Kevin Ryde
Bruce Korb <[EMAIL PROTECTED]> writes: > > port = scm_mkstrport( SCM_INUM0, expr, SCM_OPN | SCM_RDNG, zEx ); scm_open_input_string is probably easier. > pt->line_number = line - 1; > pt->file_name = file; Maybe scm_set_port_line_x and scm_set_port_filename_x instead of

gh_inexact_p error in 1.7.x

2005-11-30 Thread Bruce Korb
Hi Rob et al., Now for something completely different. Obviously, I have not yet updated my code to figure out what sort of thing it is that I got back from my eval call. Nevertheless, my understanding was that you ought to be able to call WHATEVER_p with any bit pattern and have it say, "Yes,

Re: Getting source location information

2005-11-30 Thread Han-Wen Nienhuys
Bruce Korb wrote: Hi, I am completely certain that this makes sense to you. To me, it does not. If I call ``scm_read(port)'' I have to attach the input file as a port. That read function reads an s-expr. How can that work if the non-Scheme text in the file is not an s-expr? I don't see anot

Re: [PATCH] Fixing `gc-live-object-stats'

2005-11-30 Thread Han-Wen Nienhuys
Ludovic Courtès wrote: Hi, [EMAIL PROTECTED] (Ludovic Courtès) writes: 2005-11-17 Ludovic Courtès <[EMAIL PROTECTED]> * gc-card.c (scm_i_card_statistics): Return if BITVEC is NULL. This was typically hit when running `gc-live-object-stats' right after starting Guile

Re: Getting source location information

2005-11-30 Thread Bruce Korb
On Wednesday 30 November 2005 02:35 pm, Rob Browning wrote: > >SCM res = scm_call_3 (proc, str, file, line); > >// Let's forget columns -- we don't have scm_call_4. > > Actually it looks like there is a scm_call_4. OK. Let's put it in the doc then, too. :-) > > I'll give this a spin

Re: Getting source location information

2005-11-30 Thread Rob Browning
Bruce Korb <[EMAIL PROTECTED]> writes: > With the final piece being the C code: > >SCM proc = scm_c_eval_string ("eval-string-from-file"); This is probably fine, but you might also want to try the scm_c_module_lookup function(s). They should be a little bit more efficient: SCM proc = s

Re: Getting source location information

2005-11-30 Thread Bruce Korb
On Wednesday 30 November 2005 11:00 am, Rob Browning wrote: > If so, then I wondered if it might be possible to just implement the > function mentioned originally > i.e. ag_scm_c_eval_string_from_file_line, and here's what I came up > with. Note that I have no idea if this will actually work; I ha

Re: Getting source location information

2005-11-30 Thread Rob Browning
[EMAIL PROTECTED] (Ludovic Courtès) writes: > If you want to use source locations in a Guile-friendly way (so that > Guile can, for instance, display location information in > backtraces), then you may want to use `scm_set_source_property_x > (sexp, key, datum)' (where KEY may be one of SCM_SYM_FI

Re: Getting source location information

2005-11-30 Thread Ludovic Courtès
Bruce Korb <[EMAIL PROTECTED]> writes: > *Thank you*, Ludvic! Now we're getting some where. :-D Cool. ;-) > So, again, I need clarity. Are you saying this: First, the `scm_sym_*' things should be lower-case (I was using the GNU notation for function arguments). It's more complicated than th

Re: Getting source location information

2005-11-30 Thread Bruce Korb
On Wednesday 30 November 2005 08:04 am, Ludovic Courtès wrote: *Thank you*, Ludvic! Now we're getting some where. :-D > That the input file does not contain only Scheme source wasn't clear to > me. What I am doing is extracting Scheme code from an encompassing template and handing it off fo

Re: Getting source location information

2005-11-30 Thread Ludovic Courtès
Bruce Korb <[EMAIL PROTECTED]> writes: > That read function reads an s-expr. How can that work if > the non-Scheme text in the file is not an s-expr? I don't see another > function for getting text from a port. Am I missing something? > Especially troubling is the phrase, "Any whitespace before

Re: Getting source location information

2005-11-30 Thread Bruce Korb
On Wednesday 30 November 2005 06:44 am, Ludovic Courtès wrote: > Bruce Korb <[EMAIL PROTECTED]> writes: > > > Because the file is mostly *NOT* scheme. > > I did say that you could use "Scheme constructs", "be it from Scheme > o[r] C code". In other words, you can either write `(read)' in a piece

Getting source location information

2005-11-30 Thread Ludovic Courtès
Bruce Korb <[EMAIL PROTECTED]> writes: > Because the file is mostly *NOT* scheme. I did say that you could use "Scheme constructs", "be it from Scheme o[r] C code". In other words, you can either write `(read)' in a piece of Scheme code, or call `scm_read ()' from your C code: both are strictly

Re: I don't want to maintain this

2005-11-30 Thread Bruce Korb
On Wednesday 30 November 2005 05:46 am, Ludovic Courtès wrote: > Bruce Korb <[EMAIL PROTECTED]> writes: > > > Well, okay, I don't find the stuff obvious. With effort, I'm sure > > I could puzzle it out. I have never found Lisp to be inherently > > "obvious". > > Oh, but things are different her

Re: I don't want to maintain this

2005-11-30 Thread Ludovic Courtès
Bruce Korb <[EMAIL PROTECTED]> writes: > Well, okay, I don't find the stuff obvious. With effort, I'm sure > I could puzzle it out. I have never found Lisp to be inherently > "obvious". Oh, but things are different here: this is Scheme! ;-) Just out of curiosity: why are you writing Scheme if

Re: I don't want to maintain this

2005-11-30 Thread Bruce Korb
On Wednesday 30 November 2005 12:39 am, Ludovic Courtès wrote: > Hi Bruce, > > Bruce Korb <[EMAIL PROTECTED]> writes: > > > *I* certainly cannot. > > Do you mean that you don't *want* to, or that this is not possible? Well, okay, I don't find the stuff obvious. With effort, I'm sure I could pu

Re: [PATCH] Fixing `gc-live-object-stats'

2005-11-30 Thread Ludovic Courtès
Hi, [EMAIL PROTECTED] (Ludovic Courtès) writes: > 2005-11-17 Ludovic Courtès <[EMAIL PROTECTED]> > > * gc-card.c (scm_i_card_statistics): Return if BITVEC is NULL. > This was typically hit when running `gc-live-object-stats' right > after starting Guile. Can this be applied?

Re: I don't want to maintain this

2005-11-30 Thread Ludovic Courtès
Hi Bruce, Bruce Korb <[EMAIL PROTECTED]> writes: > *I* certainly cannot. Do you mean that you don't *want* to, or that this is not possible? The point is that writing Scheme code will always be easier than writing C code, and maintaining it will be even more easier. > And I do not understand t