Hi Damien,
On 20.01.2016 14:09, Damien MATTEI wrote:
Hi Vladimir,

thank you for your answer your help is precious,
i didn't noticed there was an earlier version on github,
The googlecode has archived all projects and recommended to move to github. So 
did I recently.
i just try it last evening, if something is possible it will be easiest from 
this version.
Note that i have no use of gtk* in my application, i'm just trying to use the 
mysql feature of the bigloo-lib3 because the project i'm developing is porting 
a web project (originally under I2S from microsoft and access under windows) 
with
connection to relational database hosted on an apache tomcat8 web engine (for 
security reasons) under linux and MySQL (MariaDB now) . The language used with 
apache tomcat is Java,
i should say java byte-code as the tomcat engine do not care if you created the 
*.class or .jar or .war files from java source or any other language that 
produce java byte-code for jvm
  such as Scheme. So the project is using little java source, some Bigloo 
Scheme source files, and Kawa Scheme source files too.
Great company :-)
As there is no support for MySQL database connection in Kawa Scheme and Bigloo 
Scheme i have those choices:
-the easy way but not really pretty:made a simple class in java source code 
that handle the SQL request generated by Scheme source code classes
-find a library for Bigloo or Kawa that handle database connection with MySQL
I'm workin on the two solutions because i  only use the java front-end version 
of bigloo,
and i do not know if  the bigloo-lib3 is compatible with the java front-end of 
bigloo (option  -jvm  for bigloo)
is your library only for bigloo compiling to C language or is it compatible too 
with the Java compilation option of bigloo ?
Never tried using Bigloo with Java. I doubt Bigloo can translate C library 
calls to Java native interface.

I would recommend using JDBC. It works great for MySQL. I wrote rdbms interface for Bigloo since it was the only option to access relation DBs uniformly from bigloo interpreter and/or compiler. There is no such problems in Java.

anyway i find interesting info in your code , from  lib-bigloo2 to lib-bigloo3 the 
use of   $string->bstring which is undocumented but help porting code, still 
work in latest bigloo (4.2c)
I will take a look at code as soon as I have some spare time.

Regards,
Vladimir

PS: from my experience, if you have to deal with Java, you shall write your projects mostly in Java, and probably use other languages compiled to Java bytecode just for exploring and testing. Otherwise soon you'll find yourself writing interfaces to dozens of Java libraries with no usual help from Java IDE.
so i try to modify lib-bigloo3  for bigloo 4.* , i had to change the regex 
definitions because now bigloo have support for regex via pregex , i modified 
some definition in your code:
in common:
in
(module
  apropos
  ;; (extern (symtab::obj "c_symtab"))
  ;;(import regex srfi-1)
  (include "regex2.scm")

with regex2.scm like this:

define regexp pregexp)

(define regexp-match-positions pregexp-match-positions)

i'm at this point:
[mattei@moita common]$ make
LD_LIBRARY_PATH=/usr/local/lib/bigloo/4.2c ../common/bigloo-lib-afile  \
-I . -o .afile md5.scm srfi-1.scm string-lib.scm misc.scm char-hex.scm 
apropos.scm random.scm string-grammar-apply.scm base64.scm crypt.scm os.scm 
time.scm locale.scm iconv.scm times.scm regex.scm gettext.scm dl.scm mmap.scm 
curl.scm misc.scm srfi-1.scm string-lib.scm evprim.scm
/usr/local/bin/bigloo -I . -L .       -afile .afile -cgen iconv.scm -o iconv.c

File "iconv.scm", line 80, character 2221:
#      (make-iconv res writer 0 0))))
#      ^
*** ERROR:iconv-open
Unbound variable -- make-iconv

File "iconv.scm", line 84, character 2326:
#  (pragma::int "iconv_close($1)" (iconv-cd self)))
#                                 ^
*** ERROR:iconv-close
Unbound variable -- iconv-cd

File "iconv.scm", line 161, character 5041:
#       (cond ((not (iconv? encoder))
#                   ^
*** ERROR:<anonymous:1436>
Unbound variable -- iconv?
3 errors occured, ending ...
make: *** [iconv.c] Erreur 255

but i do not understand anymore the errors... it's seems cgen.c do not generate 
all the definitions needed....

perheaps there is not a lot of work to do to port the common and sql part of 
lib-bigloo to new versions but only you can understand how your code works.
i will get back to the first solution and continue ti wrote a simple java class 
to handle sql request needed.

Regards,

Damien
Le Tuesday 19 January 2016 13:26:49 Vladimir Tsichevski, vous avez écrit :
Hi Damien,

Bigloo-lib is not compatible with bigloo releases after 3.6a. I have never 
upgraded it for later bigloo releases. Moreover, the
gtk package is for gtk-1.2, not gtk-2.x or gtk-3.x.

Note also that the bigloo-lib package was moved twice: from sf to googlecode, 
and from googlecode to github. The actual version
is available at

https://github.com/tsichevski/bigloo-lib3

Regards,
Vladimir

On 12.01.2016 13:07, Damien MATTEI wrote:
hello,

i'm trying to upgrade the bigloo-lib ( 
http://sourceforge.net/projects/bigloo-lib/ ) to make it compile with latest 
version of bigloo, the library seems to have worked with bigloo of 2007 
(perheaps 2013 but not sure),
bigloo was implementing function at this time that are no more supported and i 
get errors at compilation:

[mattei@moita bigloo-lib-0.21b]$ make
Making all in common
make[1] : on entre dans le répertoire « 
/home/mattei/Téléchargements/bigloo-lib-0.21b/common »
/usr/local/bin/bigloo -I . -L .       -cgen misc.scm -o misc.c

File "misc.scm", line 775, character 22558:
#  (make-hash-table 256 ptr->0..255 car eq?))
#  ^
*** ERROR:toplevel-init
Unbound variable -- make-hash-table

File "misc.scm", line 826, character 23982:
#(define *object-data-registry* (make-hash-table 256 obj->0..255 car equal?))
#                               ^
*** ERROR:toplevel-init
Unbound variable -- make-hash-table

File "misc.scm", line 826, character 24003:
#(define *object-data-registry* (make-hash-table 256 obj->0..255 car equal?))
#                                                    ^
*** ERROR:toplevel-init
Unbound variable -- obj->0..255

File "misc.scm", line 258, character 8614:
#       (string->bstring(pragma::string "$1 + 1" found)))))
#       ^
*** ERROR:string-after
Unbound variable -- string->bstring

File "misc.scm", line 255, character 8533:
#                             (bstring->string s)
#                             ^
*** ERROR:string-after
Unbound variable -- bstring->string

File "misc.scm", line 269, character 9002:
#                                  (bstring->string s))))))
#                                  ^
*** ERROR:string-before
Unbound variable -- bstring->string

File "misc.scm", line 264, character 8857:
#                            (bstring->string s)
#                            ^
*** ERROR:string-before
Unbound variable -- bstring->string

File "misc.scm", line 275, character 9211:
#    (let*((ps(bstring->string p))
#             ^
*** ERROR:<anonymous:1750>
Unbound variable -- bstring->string

File "misc.scm", line 291, character 9763:
#      (let*((ps(bstring->string p))
#               ^
*** ERROR:<anonymous:1757>
Unbound variable -- bstring->string

File "misc.scm", line 289, character 9683:
#       (needle-c(bstring->string needle)))
#                ^
*** ERROR:string-split-by-string
Unbound variable -- bstring->string

File "misc.scm", line 693, character 20218:
#  (bstring->string s)
#  ^
*** ERROR:string->hex
Unbound variable -- bstring->string

File "misc.scm", line 694, character 20240:
#  (bstring->string result))
#  ^
*** ERROR:string->hex
Unbound variable -- bstring->string

File "misc.scm", line 737, character 21474:
#                        result i(bstring->string o)))
#                                ^
*** ERROR:<anonymous:1977>
Unbound variable -- bstring->string

File "misc.scm", line 740, character 21574:
#                        result i(bint->int o)))
#                                ^
*** ERROR:<anonymous:1977>
Unbound variable -- bint->int

File "misc.scm", line 778, character 22630:
#  (get-hash o *scheme-object-registry*))
#  ^
*** ERROR:object-lookup
Unbound variable -- get-hash

File "misc.scm", line 785, character 22803:
#                   (put-hash! tuple *scheme-object-registry*)
#                   ^
*** ERROR:object-ref
Unbound variable -- put-hash!

File "misc.scm", line 803, character 23366:
#                    (rem-key-hash! o *scheme-object-registry*)
#                    ^
*** ERROR:object-unref
Unbound variable -- rem-key-hash!

File "misc.scm", line 814, character 23655:
#     (obj->0..2^x-1 o p)))
#     ^
*** ERROR:pair->0..2^x-1
Unbound variable -- obj->0..2^x-1

File "misc.scm", line 829, character 24096:
#  (let((data(cond ((get-hash o *object-data-registry*) => cdr))))
#                   ^
*** ERROR:object-data-get
Unbound variable -- get-hash

File "misc.scm", line 837, character 24335:
#                 (put-hash! (list o) *object-data-registry*))))
#                 ^
*** ERROR:object-data-set!
Unbound variable -- put-hash!

File "misc.scm", line 836, character 24295:
#  (let((entry (or (get-hash o *object-data-registry*)
#                  ^
*** ERROR:object-data-set!
Unbound variable -- get-hash

File "misc.scm", line 844, character 24511:
#  (rem-key-hash! o *object-data-registry*))
#  ^
*** ERROR:object-data-free!
Unbound variable -- rem-key-hash!

File "misc.scm", line 865, character 25150:
#         (set-printer!
#         ^
*** ERROR:add-printer
Unbound variable -- set-printer!

File "misc.scm", line 864, character 25127:
#       (let ((old-printer (current-printer)))
#                          ^
*** ERROR:add-printer
Unbound variable -- current-printer
24 errors occured, ending ...
make[1]: *** [misc.c] Erreur 255
make[1] : on quitte le répertoire « 
/home/mattei/Téléchargements/bigloo-lib-0.21b/common »
make: *** [all-recursive] Erreur 1
[mattei@moita bigloo-lib-0.21b]$

some function have changed of names:
make-hash-table  -> make-hashtable

but some function are no more supported by bigloo 4.* such as:
bstring->string

causing errors:

File "misc.scm", line 737, character 21474:
#                        result i(bstring->string o)))
#                                ^
*** ERROR:<anonymous:1977>
Unbound variable -- bstring->string

again i having troubles with bstring i do not know how to handle them or cast 
them in string ,
any idea ?

also the obj class seems no more accessible from bigloo 4.* :
File "misc.scm", line 814, character 23655:
#     (obj->0..2^x-1 o p)))
#     ^
*** ERROR:pair->0..2^x-1
Unbound variable -- obj->0..2^x-1

i do not know how to handle all the errors, even when fixing them i have then 
serious errors with the generated misc.c due to the structure conversion of 
bstring not compatible with string and other incompatibilities

regards,

Damien






Reply via email to