Bigloo fails with *fl in interpreter // the-fixnum parser // Reloading modules within the interpreter.

"Ollagnon, Pierre-Francois" <[email protected]>
Newsgroups gmane.lisp.scheme.bigloo
Message-ID <[email protected]>
Hello Guys

1)
We spent a bit of time to work on 3.1b -> 4.3 migration
We succeed to compile when removing all optimization but testcase are hard to make ...

I face an issue using *fl in the interpreter.

Here is my test (it doesn't do a real thing but shows the error):

(module top
        (main main))

(define (main argv)
  (test  1.25 '(1 2 3)))


(define (test cload curve)
  (let* ((mylambda  (lambda (cv)
                      (let*  ((add           1.3)
                              (toadd         (*fl add 1e-4))) ;; If I replace *fl by * it also works in Interpreted mode.
                        (for-each (lambda (x)
                                    (set! add (+ toadd add)))
                                  cv)
                        add
                        )
                      )))
    (print  (mylambda curve))
    ))

1:=> (load "toto.scm")
#unspecified
main
test
*** ERROR:bigloo:
`segmentation violation' exception -- raised
    1. \@test, toto.scm:9
    2. test, toto.scm:8
    3. load, toto.scm:8
1:=> (quit)

(note that some time it is completely impossible to quit the interpreter, I need to use kill -9)

The test work with * both in compiled and interpreted mode but fails in the interpreter when using *fl. (it works with *fl when compiled)
(same with other fl operator)
Can you have a look at it ?


2) Parser "issue"

We use to describe some yacc rules with:

( (+ digit)
  (? #\%))         (the-fixnmu))

It was correctly working before:  (the-fixnum) was sending the last matching fixnum.
In crgc.c Line 745 : rgc_buffer_fixnum you were using atol C function that was correctly returning the number.

Now you run over the complete string without checking if it is a number or not and add the ASCII number of whatever we have... returning a wrong number...
Maybe you want to use back the atol, or checking if the character is in the 0-9 range (I don't know what you prefer ....)
(or change the doc and I will change my syntax ^^ )

(I currently use atol in my local Bigloo4.3a to go further in my investigations)


3) Is there a way to replace all "instantiation" of a function when we reload a module file ?
Little explanation:
I load a software where there is 3 modules mod1 mod2 mod3 Having each one 1 function func1 func2 func3
Func1 call func2
Func2 call func3

Let say that I load these modules,
If I change func3 and reload the file (with load or loadq) func2 will still call the old func3.
So I need to reload mod2.
Then func1 is calling the old func2 that still call the old func3, so I need to reload module1.
By the way if I have cyclic dependency, I need to reload 3 or 4 times ALL modules. AND we need to do it in the good order or you are gone to make it 1 or 2 times more ! Grrrr

Having the interpreted  mode is so powerfull to make modifications and debug very quickly, it's a shame that we need to make these tricks to reload some part of the code...
(2.7 was really good at this !)

Thanks and regards,
Pierre-Francois
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.