Re: [Chicken-users] [Chicken-hackers] Happy Christmas!

2018-12-27 Thread Hugo Arregui

Happy Christmas to everyone!

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [Chicken-hackers] happy christmas!

2016-12-24 Thread Hugo Arregui

On 2016-12-23 06:36, felix.winkelm...@bevuta.com wrote:

Dear CHICKEN folks!


I wish all of you a very happy christmas.



Merry Christmas everyone!

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] egg jni installation error

2016-03-03 Thread Hugo Arregui
Hi Cao,

Could you try setting your LD_LIBRARY_PATH variable to the directory in
which libjvm.so is located?.

In my machine (arch using openjdk) will be:

export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jvm/java-7-openjdk/jre/lib/amd64/server

HIH

Regards,
Hugo



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] iconv egg patch

2015-11-07 Thread Hugo Arregui
Hi Mario,

> I notice the .release-info file doesn't reference old versions.  Would
> you please add them?  If you need an example on how to do that, take a
> look at awful's .release-info:
> https://github.com/mario-goulart/awful/blob/master/awful.release-info

Oh, of course!, sorry for that, I just added it.

Regards,
Hugo



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] iconv egg patch

2015-08-20 Thread Hugo Arregui
Hi,

The project is here[1], and the release file here[2]. I hope everything
is ok!

Regards,
Hugo

[1] https://github.com/hugoArregui/iconv
[2]
https://raw.githubusercontent.com/hugoArregui/iconv/master/iconv.release-info



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] iconv egg patch

2015-08-13 Thread Hugo Arregui
> You can take the svn egg repo as a base (that's where it's currently hosted).
> We can give you access to it if you like, or you could import the egg into
> a git or mercurial repository and we can change the URL.

Thanks Peter! I imported the code into a github repository, I will let
you guys know when is ready for the URL change.

One question though, I found a couple of things I would like to improve:

- I think the documentation is a bit misleading when it says (about
iconv procedure), "The resulting string is returned (or #f if the
implementation runs out of memory)."

But it can actually return #f on error too (check here if you like:
https://github.com/hugoArregui/iconv/blob/master/iconv.scm#L85).

- The iconv procedure has an `invalid` parameter, which defaults to "?".
When an invalid sequence is found, the `invalid` string is appended to
the output string for each wrong byte found. Maybe this is desirable
sometimes, but there is no way to actually raise an error on this case.
So, I will just add an alternative, and if invalid is #f, an error will
raise. However, I think raising an error on invalid input is a much
saner default, but this breaks backward compatibility

I would really like Alex Shinn's opinion on this one, because he has two
eggs using iconv. Hope he's reading this.

But anyway, my question is: both of this items are related to backwards
compatibility, what do you think is the best choice here? should I just
change it (if Alex Shinns and perhaps something else who is using it
agrees with these changes), should I create another procedure and
deprecate this one?, should we call it iconv2 and deprecate iconv?.

Thanks.
Regards,
Hugo



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] iconv egg patch

2015-08-12 Thread Hugo Arregui
> I am afraid that the iconv egg is orphaned at the moment. Would you like
> to take care of it?

Sure!. I cannot access the svn repo mentioned in the egg source, so I
guess I should use the result of chicken-install -r as the base, isn't that?

Regards,
Hugo



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] iconv egg patch

2015-08-11 Thread Hugo Arregui
Hi,

The attached small patch get rides of this warning in the iconv egg:

/usr/include/iconv.h:42:15: note: expected ‘char ** restrict’ but
argument is of type ‘const char **’

I tried to contact the author but the email addresses found both in the
egg and in the wiki are disabled, so perhaps he is here on the list.

Regards,
Hugo
71c71
<   if (iconv((iconv_t) cd, (const char* *) &src, &srclen, &dst, &left) == -1)
---
>   if (iconv((iconv_t) cd, (char** __restrict) &src, &srclen, &dst, &left) == -1)


signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] 15 years ago...

2015-07-20 Thread Hugo Arregui


On 20/07/15 11:39, Mario Domenech Goulart wrote:
> 
> A baby CHICKEN was born:
> https://groups.google.com/forum/#!msg/comp.lang.scheme/QOil0WmRtWg/rp_Yb6Et--0J
> 
> Congrats. :-)

That's really a piece of history! Congrats!



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Vim plugin for chicken-docs

2015-03-12 Thread Hugo Arregui
Very nice! Glad there some more vimers out there :-D!

Regards,
Hugo



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] "[panic] invalid encoded numeric literal" with gtk

2015-02-18 Thread Hugo Arregui

$ pkg-config --modversion gtk+-3.0
3.14.5


I tried with that version, but unfortunately it didn't work.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] "[panic] invalid encoded numeric literal" with gtk

2015-02-18 Thread Hugo Arregui

And guess what, it seems to work just fine...


Thanks Christian! It's certainly useful to know, but I tried with the
same gcc version you have (I was using the gcc from Arch, 4.9.2-3) and
is still broken.

I did a full clean chicken install with no results, and also tried with
an older chicken version (4.8.2).

I'm clueless, can be related to the gtk version? I have gtk3 3.14.8-1
installed.

Thanks again,
Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] "[panic] invalid encoded numeric literal" with gtk

2015-02-17 Thread Hugo Arregui

Hi guys,

I'm puzzled by a strange error I found playing with gtk, it might be
something silly, but I cannot grok it. The code is pretty simple:

-
;-- test.scm
(import chicken scheme foreign)

#>
#include 

int main(int argc, char** argv) {
   gtk_init(&argc, &argv);
   CHICKEN_run(C_toplevel);
   return 0;
}
<#

(print "hey")
(return-to-host)

;-- output:

$ chicken
(c) 2008-2014, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.9.0.1 (stability/4.9.0) (rev 8b3189b)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
bootstrapped 2014-06-07

$ csc -e test.scm `pkg-config --cflags --libs gtk+-3.0 | sed 's/-pthread/-C -pthread/'`  


$ ./test
[panic] invalid encoded numeric literal - execution terminated

-

The error disappear if I remove the gtk_init line.

Any ideas?

Thanks!
Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Travis CI

2014-04-30 Thread Hugo Arregui

Hi Mario,

Sorry for the late response!.


Instead of just running "chicken-install -test", you can install
salmonella and run it.  It'll perform some extra checks that
chicken-install doesn't.  In case you run salmonella, you'll probably
also want to run "salmonella-log-viewer salmonella.log" to show details
of the build/test steps.


Excellent advice!


If you want to use that infrastructure to test your project, it's just a
matter of adding it to the official coop.  It'll be automatically added
to the daily test procedure.  New eggs are aways welcome!


Thanks!, I think I will. Nevertheless, I was thinking on Travis as 
another instance of testing, as is build every time you push, you can

catch some mistakes before the coop tests run (that is why I don't
care too much about the old chicken version). Or maybe also prior to
release it as an egg.


P.S.: sorry for the spiffy-request-vars bug. :-)  Fixing it is in my
TODO list.


Haha, you never miss a thing!. If its for me, please don't bother
to fix it, is an old version and I don't need it.

Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Travis CI

2014-04-25 Thread Hugo Arregui

Hi!

In case someone is interested, I setup Travis CI in one of my chicken
projects:

https://github.com/hugoArregui/awful-blog
https://travis-ci.org/hugoArregui/awful-blog

Sadly, the repo gcc/chicken are old:

$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ chicken -version
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2011-10-17 on allspice (Linux)

Of course, (unless the gcc version is incompatible) a new chicken can
be downloaded and installed as an install step.

Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] CHICKEN 4.9.0rc1 is available

2014-04-18 Thread Hugo Arregui

Excellent news!

Everything ok here, my results:

Operating system: Arch linux
Hardware platform: x86-64
C Compiler: GCC 4.8.2
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes

Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread Hugo Arregui
On 27/11/13, m...@freeshell.de wrote:
> On a sidenote:
> 
> It seems that there is an analgon to go routines on Erlang, which can be
> accessed the LFE (Lisp Flavoured Erlang). However, that would require to
> learn the entire Erlang VM ecosystem.

A Lisp Flavoured Erlang, what nice!. 


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] scrutinizer warning in dotted argument notation when using units

2013-08-04 Thread Hugo Arregui
Hi!

I noticed this warning using the latest version from master:

;test.scm
(use data-structures)
(flatten '(1 2 3) '(4 5 6) '(7))

[hugo@io test]$ csc test.scm

Warning: at toplevel:
  (test.scm:3) in procedure call to `flatten', expected 1 argument,
but was given 3 arguments

Is also easily reproducible with any file included as unit, declaring
a procedure using dotted argument notation. This is not happening if
the procedure is defined in the same file. I'm not sure why.

I take a look at scrutinizer.scm just to learn how it works, and I'm
sending a patch, but I'm not sure if its correct.

(Also, if someone is in teaching mood:
1) debugging the scrutinizer I found sometimes procedures or vars are
replaced with '*, what does it means?
2) if someone figures out.. why is this not happening on procedures in
the same file? )

Regards,
Hugo


scrutinizer.patch
Description: Binary data
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] patch to rss egg to "handle" xml:base attribute

2013-07-29 Thread Hugo Arregui
> I have applied the patch and tagged version 1.6. Could you document
> the new exports in the rss documentation at

Ready!

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] patch to rss egg to "handle" xml:base attribute

2013-07-19 Thread Hugo Arregui
Hi,

I found a little problem trying to read a feed using rss egg:

(use rss http-client)
(call-with-input-request "http://lambda-the-ultimate.org/rss.xml"; #f
(lambda (port)

(rss:read port)))

$ csi -s test.scm
Error: (match) no matching pattern

Playing with the code a little I found the problem: the rss tag
contains a xml:base attribute, and the egg only support the version
attribute. The "xml:base" apparently is a gray area on the
specification, so I'm not sure if you want to support it. I choose an
intermediate solution, I added an slot in the rss:feed register named
"base-uri" and I set it only if the xml:base attribute appears.
I'm sending the patch attached in case it could be useful for someone.

Regards,
Hugo


support-xml-base.patch
Description: Binary data
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] scheme.vim

2013-06-17 Thread Hugo Arregui
On Mon, Jun 17, 2013 at 4:42 PM, Daniel Ajoy  wrote:
> which one is more up to date?

I think a combination of both is better, probably your lispwords list
will grow when you add new eggs or new syntax, I also have:

  setl lispwords+=let-values,condition-case,with-input-from-string
  setl 
lispwords+=with-output-to-string,handle-exceptions,call/cc,rec,receive
  setl 
lispwords+=call-with-output-file,define-for-syntax,define-foreign-record-type
  setl 
lispwords+=define-concurrent-native-callback,define-synchronous-concurrent-native-callback
  setl lispwords+=define-callback,test-group

I also find useful to redefine iskeyword this way:
set 
iskeyword=33,35-36,38,42-58,60-90,94,95,97-122,126,_,+,-,*,/,<,=,>,:,$,?,!,@-@,#,^

I like to exclude <%> and <'>, so a current-word-search over for
example, 'something or something or %something is equivalent.

HIH
Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] question about foreigners

2013-04-12 Thread Hugo Arregui
Hi guys,

A little question about foreigners. I have this:

typedef struct JavaVMOption {
...
} JavaVMOption;

(define-foreign-record-type (jvm-option "JavaVMOption")
...)

typedef struct JavaVMInitArgs {
...
JavaVMOption *options;
} JavaVMInitArgs;

Then I need to define a binding to JavaVMInitArgs in which I need to
set more than one jvm-option in the options field.

- My fist attempt was:

(define-foreign-record-type (jvm-init-args "JavaVMInitArgs")
  ...
  (jvm-option options jvm-init-args-options jvm-init-args-options-set!))

I can use jvm-init-args-options-set! to set one jvm-option, just using
(jvm-init-args-options-set! args option1). But I don't know how to set
a second one.

- Another alternative (doesn't work but I think could be theoretically
possible) is this:

(define-foreign-type struct-jvm-option "struct JavaVMOption") ; this
doesn't work (Error: illegal foreign argument type `JavaVMOption')

(define-foreign-record-type (jvm-init-args "JavaVMInitArgs")
  ...
  (struct-jvm-option (options 2) jvm-init-args-options
jvm-init-args-options-set!))

and then use jvm-init-args-options-set! with an index.

Could you give me a hint?

Thanks!,
Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] problem from chicken 4.7 to chicken 4.8.X

2013-03-26 Thread Hugo Arregui
Hi guys,

I'm having and strange problem trying to make a code work from 4.7 to 4.8:

its a very simple code that uses JNI to invoke CreateJVM:
https://gist.github.com/hugoArregui/a0a133385d62008b6a74

This is how I compile it and the result (using chicken 4.8.0.3):
$ csc ex.scm -ljvm
-L/usr/lib/jvm/java-7-openjdk/jre/lib/amd64/server
-I/usr/lib/jvm/java-7-openjdk/include/
$ ./ex
Segmentation fault (core dumped)

as you can see, I'm using amd64 and openjdk7. This code works fine, as
far I can tell, in chicken 4.7.0.6.

Is a ugly error and having Java in the middle makes it worst. I'm
complete lost and I don't know what else I can try. Could you give me
a hint of how to debug this or you have a clue about what changes from
one version to another could cause this?.


I'm not sure if this is helpful.

This is the real project:
https://github.com/chicken-mobile/jni

I'm testing it like this:
chicken-install -s
csc tests/tests.scm
tests/tests

the same happens with the tests, they work fine in 4.7 and breaks in
4.8, but.. I found something strange, if I replace the .so files of
regex egg (used by test egg), the code works fine.

In other words:
$ cp /usr/lib/chicken-4.7.0.6/6/regex* /usr/lib/chicken-4.8.0.3/6/

and the tests runs ok.

Seems to black magic to me, and I suppose is just a coincidence, but a
very remarkable one.


Thanks,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] misc questions about macros

2013-03-04 Thread Hugo Arregui
Thanks Christian!

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] misc questions about macros

2013-03-04 Thread Hugo Arregui
Hi guys,

I'm pretty new to macros, so I want to ask a couple of questions to
sort the things in my brain :-).

1) I think this is an issue regarding expansion time / runtime:

(define (aproc a)
  (* 2 a))

(define-syntax amacro
  (er-macro-transformer
(lambda (x r c)
  (aproc 1

(print (amacro))

works great via csi, but when I try to compile it:

Error: during expansion of (amacro ...) - unbound variable: aproc

Call history:

  (##core#begin (print (amacro)))
  (print (amacro))
  (amacro)
(aproc 1) <--


Clarification: This is a simplification, I know I can do this:

(define-syntax amacro
  (er-macro-transformer
(lambda (x r c)
  '(aproc 1 ; I should rename this

But I'm trying to understand whats happening in the first example.

My questions are:
  - I'm guessing the proc isn't available in expansion time. I'm right?
  - How can make this work?

2) I have a macro called "jlambda-field", its signature is:

(jlambda-field (modifiers) type class field-name)

Now, if modifiers contains "static" keyword I want to delegate the
call to static-field macro, otherwise, delegate to field macro. As
static could be in any position in the list, I need to express a "list
contains" pattern. I express that in this way:

(define-syntax jlambda-field
  (syntax-rules (static)
((_ (static) type class field-name)
 (static-field () type class field-name))
((_ (static modifier ...) type class field-name)
 (static-field (modifier ...) type class field-name))
((_ (modifier ... static) type class field-name)
 (static-field (modifier ...) type class field-name))
((_ modifiers type class field-name)
 (field modifiers type class field-name

This works perfect, but I want to ask, there is a simplified way to do this?

Thanks,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] documenting eggs

2013-02-21 Thread Hugo Arregui
Thanks Mario, Dan. Very useful information as usual!.

Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] documenting eggs

2013-02-21 Thread Hugo Arregui
Hi people,

some questions regarding egg docs:

1) I understand that the egg doc should be added to the wiki, but I
suppose that it should respect a particular format to be compatible
with chickadee, I'm right? where I can found it?

2) Is there any tools for this? I found the cock egg, but I don't find
any documentation about it, so I don't know neighter how it's works or
if it's helpfull in this case.

Thanks,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] some questions about easyffi and foreign code

2013-02-03 Thread Hugo Arregui
Hey Kristian,

many thanks for you response!

> Yeah, that example wasn't working for me either. If you put "(use easyffi)"
> at the top of the file though, it should work. Note that easyffi is
> deprecated, use bind instead:
>
> (use bind)
> (bind* "double modf(double x, ___out double *iptr);")
> (let-values ([(frac int) (modf 33.44)])
> (print frac " " int))

Great!, I'm changing it right now.

> If 64-bit integers are all you need, perhaps you can use the foreign type
> unsigned-integer64? I'm guessing the C compiler will handle that even if
> you're on a 32bit system. I'm not sure how Chicken will handle integer64's
> if you're on a 32bit system though.

Well, I tried that at first (I have a 32bits machine):

(use numbers)
(use bind)

(define double->uint64
  (foreign-lambda* unsigned-integer64 ((double d))
# If you want to continue using your multiword version, you could look into
> the u32vector foreign type. It will give you a nice array on the C-side, and
> a nice vector on the Chicken side:

I exactly do that, but found another problem. u32 uses 31bit, so it's
not working either, let me show you:

(use srfi-4)
(import foreign)

(define double->u32vector
  (foreign-lambda* void ((double d) (nonnull-u32vector v))
#

Re: [Chicken-users] some questions about easyffi and foreign code

2013-02-02 Thread Hugo Arregui
Hi again,

> 1) ..
> $ csc -X easyffi test.scm -c++; ./test
>
> Error: unbound variable: foreign-parse
> Call history:
> foreign-parse
>
> I have no idea of what's going on.

Could this be a problem in my installation?

The example in the wiki is not working either:

#>!
#ifndef CHICKEN
#include 
#endif

double modf(double x, ___out double *iptr);
<#

(let-values ([(frac int) (modf 33.44)])
(print frac " " int))

//with the same error: "unbound variable: foreign-parse"

> 2) Then I tried another approach:
>..
> Error: bad argument type - not a pointer: 0

I found a way to do this[1]. But, I found another problem: big int32
are promoted to flonums, I know that this is an expected behaviour,
but I have a doubt:

In a message[2] Kon Lovett writes:

"Means you want to compile w/ generic-arithmetic & usual-integrations
when using a foreign call."

I suposse this is a compiler setting, but I don't now how to enable
it. Also, I don't know what  "usual-integrations" means, could you
provide more details please?

Thanks again, and sorry for bothering you.
Regards,
Hugo

[1] http://pastebin.com/XH5n3V72
[2] http://lists.nongnu.org/archive/html/chicken-users/2007-05/msg00227.html

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] some questions about easyffi and foreign code

2013-02-01 Thread Hugo Arregui
Hi guys,

I'm having some troubles using easyffi to embed some C++ code in my
program, sorry if my questions are kind of trivial but it's the first
time that I do something like this.

1) First I try this:

http://pastebin.com/1X3qcvjK

Compiles with no error, but then I get this when it runs:

$ csc -X easyffi test.scm -c++; ./test

Error: unbound variable: foreign-parse
Call history:
foreign-parse

I have no idea of what's going on.

2) Then I tried another approach:

http://pastebin.com/E6xfVe29

Again compiles with no error, but then:

$ csc -X easyffi test.scm -c++; ./test

Error: bad argument type - not a pointer: 0

Call history:

test.scm:1: ##sys#require   
test.scm:17: double->uint64 <--

The error is very descriptive, but I don't know how I should handle
pointers or references here.

Thanks,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Msgpack implementation for scheme (and some questions)

2013-01-31 Thread Hugo Arregui
I think you are right Jim,

This is the way that C implementation packs float/doubles:

https://github.com/msgpack/msgpack-c/blob/master/pack_template.h#L635

Regards,
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Msgpack implementation for scheme (and some questions)

2013-01-30 Thread Hugo Arregui
On Wed, Jan 30, 2013 at 10:52 PM, Kristian Lein-Mathisen
 wrote:
> Hi Hugo,
>
> Msgpack seems like an interesting project indeed. Thanks for making an egg
> for it!

my pleasure!

> I'm quite a newbie myself, but I noticed the coops egg includes the module
> implementation directly, so you don't have to declare two modules. Maybe
> that's easier in your case too?

I can do that, but the problem is, if I do so, the only module should
export all the procedures, include the internals one, that are needed
only for testing.

> I also noticed you're using (let () ...). Is there a reason you're not
> simply using (begin ...)?

No really, just inertia :-).

> I've been poking around the msgpack-repositories, they support a lot of
> languages! It's real neat that Chicken Scheme now joins in on the fun too.
> So, looking at the node.js port, it seems like they've created js-bindings
> to the official C library. Perhaps this might be suitable for Chicken Scheme
> too? From what I can tell, you are reimplementing most of the functionality
> from scratch, is that correct?

That's right, in fact, when I started the project I think to do so,
just create the bindings, but, to be honest, I think it will more fun
if I do it from scratch.

> Great work, great piece of software to keep handy!

Thanks Kristian!.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Msgpack implementation for scheme (and some questions)

2013-01-28 Thread Hugo Arregui
Hi,

Recently I wrote an implementation of msgpack[1], which can be found
here[2]. This is my first "full" project in scheme, so I would
appreciate any feedback (please, be destructive).

A couple of points already has been mentioned:

- Macros to reduce redundancy (I'm reading about them, so I'm
expecting to fix this soon).
- A non technical but important thing: I'm using endian-blob egg,
which is licensed as gpl and it's incompatible with the project
license, which is bsd.

But, beside that, I have a few questions:

1) To avoid the creation of very heavy structures in tests, i'm using
a kind of mock[3], which overrides some procedures, and restores it
later. Is this the right way to do it?.

In fact, in the "egg" branch I tried to pack the project as an egg and
I think this "hack" is not working.

2) To access the procedures mentioned in (1), i'm using two modules:
"msgpack-imple" which contains the whole project and it's used for the
tests, and "msgpack" which import "msgpack-imple" and expose the real
interface. Again, is this the right way to do it?

3) To read/write float/double numbers (in ieee754) i'm using
endian-blob egg (here[4]), it's there any alternative without
implementing the full float/double->binary logic (which seems quite
complicated)?

Thanks,
Hugo.

[1] http://msgpack.org/
[2] https://github.com/hugoArregui/msgpack-scheme
[3] https://github.com/hugoArregui/msgpack-scheme/blob/master/tests/run.scm#L187
[3] 
https://github.com/hugoArregui/msgpack-scheme/blob/master/msgpack-imple.scm#L131

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] happy christmas!

2012-12-24 Thread Hugo Arregui
Happy Chrismas for everyone!

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] error with srfi-19: /usr/lib/chicken/6/locale-posix.so: undefined symbol: C_fixnum_modulo

2012-12-13 Thread Hugo Arregui
Well, it's finally working!. I just remove the complete chicken
installation, and then rebuild from zero.

Thanks!
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] error with srfi-19: /usr/lib/chicken/6/locale-posix.so: undefined symbol: C_fixnum_modulo

2012-12-13 Thread Hugo Arregui
Thanks for all yours replies!

>> This is weird. Do you have old chicken libraries lying around somewhere?

It is, I don't think so, but I will try to remove the whole chicken
installation, and then start fresh.

> If so, I'd expect to see C compiler warnings about assumptions of
> the function's signature due to the missing prototype.  Did you get
> those while installing numbers or srfi-19?

No, here's the output:

http://pastebin.com/yvFfZ23q

Thanks again!.
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] error with srfi-19: /usr/lib/chicken/6/locale-posix.so: undefined symbol: C_fixnum_modulo

2012-12-13 Thread Hugo Arregui
On Thu, Dec 13, 2012 at 12:20 PM, Hugo Arregui  wrote:
> Oh sorry, i left the most important thing out!
>
> $ csi -version
>
> CHICKEN
> (c)2008-2012 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 4.8.0 (rev 0db1908)
> linux-unix-gnu-x86 [ manyargs dload ptables ]
> compiled 2012-09-24 on debian (Linux)
>
>
> Thanks!
>
> On Thu, Dec 13, 2012 at 12:19 PM, Christian Kellermann
>  wrote:
>> Which chicken version is that?

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] error with srfi-19: /usr/lib/chicken/6/locale-posix.so: undefined symbol: C_fixnum_modulo

2012-12-13 Thread Hugo Arregui
Hi guys,

I have a problem with and old script which uses srfi-19. I thinks
something went broke after an update: I'm using arch linux, and
chicken is installed from the package manager.

It's easy to reproduce, just enter csi, and then:

#;1> (use srfi-19)
; loading /usr/lib/chicken/6/srfi-19.import.so ...
; loading /usr/lib/chicken/6/chicken.import.so ...
; loading /usr/lib/chicken/6/srfi-19-timezone.import.so ...
; loading /usr/lib/chicken/6/miscmacros.import.so ...
; loading /usr/lib/chicken/6/locale.import.so ...
; loading /usr/lib/chicken/6/locale-timezone.import.so ...
; loading /usr/lib/chicken/6/foreign.import.so ...
; loading /usr/lib/chicken/6/posix.import.so ...
; loading /usr/lib/chicken/6/type-checks.import.so ...
; loading /usr/lib/chicken/6/type-errors.import.so ...
; loading /usr/lib/chicken/6/data-structures.import.so ...
; loading /usr/lib/chicken/6/locale-builtin.import.so ...
; loading /usr/lib/chicken/6/locale-posix.import.so ...
; loading /usr/lib/chicken/6/srfi-1.import.so ...
; loading /usr/lib/chicken/6/srfi-13.import.so ...
; loading /usr/lib/chicken/6/regex.import.so ...
; loading /usr/lib/chicken/6/irregex.import.so ...
; loading /usr/lib/chicken/6/files.import.so ...
; loading /usr/lib/chicken/6/locale-categories.import.so ...
; loading /usr/lib/chicken/6/lookup-table.import.so ...
; loading /usr/lib/chicken/6/srfi-69.import.so ...
; loading /usr/lib/chicken/6/ports.import.so ...
; loading /usr/lib/chicken/6/extras.import.so ...
; loading /usr/lib/chicken/6/record-variants.import.so ...
; loading /usr/lib/chicken/6/locale-components.import.so ...
; loading /usr/lib/chicken/6/locale-current.import.so ...
; loading /usr/lib/chicken/6/srfi-19-support.import.so ...
; loading /usr/lib/chicken/6/numbers.import.so ...
; loading /usr/lib/chicken/6/srfi-19-time.import.so ...
; loading /usr/lib/chicken/6/srfi-18.import.so ...
; loading /usr/lib/chicken/6/srfi-19-date.import.so ...
; loading /usr/lib/chicken/6/srfi-19-io.import.so ...
; loading /usr/lib/chicken/6/srfi-29.import.so ...
; loading /usr/lib/chicken/6/posix-utils.import.so ...
; loading /usr/lib/chicken/6/condition-utils.import.so ...
; loading /usr/lib/chicken/6/variable-item.import.so ...
; loading /usr/lib/chicken/6/srfi-19.so ...
; loading /usr/lib/chicken/6/srfi-19-timezone.so ...
; loading /usr/lib/chicken/6/locale.so ...
; loading /usr/lib/chicken/6/locale-timezone.so ...
; loading /usr/lib/chicken/6/type-checks.so ...
; loading /usr/lib/chicken/6/type-errors.so ...
; loading /usr/lib/chicken/6/locale-builtin.so ...
; loading /usr/lib/chicken/6/locale-posix.so ...
; loading /usr/lib/chicken/6/regex.so ...
; loading /usr/lib/chicken/6/locale-categories.so ...
; loading /usr/lib/chicken/6/lookup-table.so ...
; loading /usr/lib/chicken/6/locale-components.so ...
; loading /usr/lib/chicken/6/locale-current.so ...
csi: symbol lookup error: /usr/lib/chicken/6/locale-posix.so:
undefined symbol: C_fixnum_modulo

I tried reinstalling srfi-19 with chicken-install, but I get the same result.

Maybe I'm missing some upgrade procedure?

Thanks!.
Hugo

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] catching a "cannot import undefined module" error

2011-08-21 Thread Hugo Arregui
Thanks Felix!, I gonna try it.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] catching a "cannot import undefined module" error

2011-08-20 Thread Hugo Arregui
Sure,

i'm trying to build a script to list all my unsatisfied dependencies
(along all my source files), so I can install them (for example: after
a chicken upgrade). I'm already get the dependencies, but I need try
to load them, so I can kow if they are missing or not.

Thanks again!

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] catching a "cannot import undefined module" error

2011-08-20 Thread Hugo Arregui
Hi guys,

is there a way to catch  "cannot import undefined module" error?

I tried with catch and "with-exception-handler" procedures, but they
don't seems to work.

Thanks!
Hugo.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] where move-file is?

2011-06-30 Thread Hugo Arregui
On Thu, Jun 30, 2011 at 10:23 AM, Kon Lovett  wrote:
> Unit files file-move

Even better, I will use this one.

Thanks everyone.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] where move-file is?

2011-06-30 Thread Hugo Arregui
On Thu, Jun 30, 2011 at 10:16 AM, Peter Bex  wrote:
> It's actually part of the available procedures inside a setup-script
> for eggs (see http://wiki.call-cc.org/man/4/Extensions#move-file)
>
> It is available in setup-api. (use setup-api)
>

Thanks Peter!

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] where move-file is?

2011-06-30 Thread Hugo Arregui
Hi guys,

I want to use move-file procedure, (
http://api.call-cc.org/doc/chicken/eggs/move-file ), but i cannot find
it as an egg or as an procedure. I mean, seems an egg, but
chicken-install cannot find it, and doesn't seems installed already.
Can you give me an advice?

(i tried chicken 4.5.0 and 4.6.0)

Thanks,
Hugo.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] http-client and set-cookie

2010-12-25 Thread Hugo Arregui
On Sat, Dec 25, 2010 at 8:29 PM, Peter Bex  wrote:
> Please try the attached patch and let me know if it helps.

Works great Peter, thanks.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] http-client and set-cookie

2010-12-25 Thread Hugo Arregui
Hi guys,

I was trying to download and parse a blogspot web, but I had an error:

Error: (string-split) bad argument type - not a string: #f

Call history:

uri-generic#uri-port
uri-generic#uri-scheme  
alist-ref   
uri-common#uri-port 
uri-generic#uri-port
uri-generic#uri-scheme  
alist-ref   
uri-common#uri-host 
uri-common#uri-host 
raise   

using: (with-input-from-request url #f read-string)

I localized the problem, the request header contains:  (set-cookie
#(("blogger_TID" . "XXX") ((httponly . #t
and in http-client.scm:299 (process-set-cookie! proc), (get-param
'path c) returns #f

I just check for #f first, and works fine.

Now, my questions:

-it's a bug? I really don't understand what get-param is.
-It's was hard to find the problem because the stack wasn't helpful, i
have to debug by hand, adding prints on egg source and that kind of
things. Is there a better way to do that?

Thanks,
Hugo.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Merry Christmas

2010-12-24 Thread Hugo Arregui
I want to thanks all chicken community, not just for the dev work, but
also for the amazing spirit what makes learning scheme even more
funniest than it is.

Thanks! and merry christmas!

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] loopy-loop

2010-12-21 Thread Hugo Arregui
On Tue, Dec 21, 2010 at 10:44 PM, Alex Shinn  wrote:
> On Mon, Dec 20, 2010 at 1:45 AM, Hugo Arregui  wrote:
>> Hi guys, I'm facing an unexpected behaviour using loopy-loop:
>
> Is there a reason you're using loopy-loop instead
> of the newer fast-loop?

I didn't know about that. I don't see any docs on eggs index, can you
point me to them?

thanks

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] loopy-loop

2010-12-19 Thread Hugo Arregui
Hi guys, I'm facing an unexpected behaviour using loopy-loop:

(loop lm ((m <- in-range-reverse 6 4 1))
  (print m)
  (lm))

shows 6,5 as expected, but:

(loop lm ((m <- in-range-reverse 6 4))
  (print m)
  (lm))

theoretically the same, but don't shows anything at all.

Also, this:

(loop lm ((m <- in-range 4))
  (print m)
  (lm))

is given me an error:

Error: during expansion of (%loop-next395 ...) - no rule matches form:
(%loop-next () ((m 0 4)) () () lm () () () () () () (print m) (lm))

Call history:

(##sys#eq? (##sys#cdr temp363) (quote ()))
(##sys#cdr temp363)
(##sys#car tail362)
  [tmp31] (tmp3138 (#%+ m39 1))
  [tmp31] (#%+ m39 1)
  [run] (##core#let () (tmp31 6))
  [run] (##core#begin (tmp31 6))
  [run] (tmp31 6)
  [run] (##core#undefined)
  (loop lm ((m <- in-range 4)) (print m) (lm))  <--

Maybe it's a bug, o maybe i'm misunderstanding the docs.

Thanks,
Hugo.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Memoizing a procedure

2010-11-28 Thread Hugo Arregui
Thanks for your comments Peter!, they are very interesting.

> It looks good to me.  It only works for simple procedures though,
> not for procedures with optional arguments or keyword arguments.
> Keyword args can be in any order, and an optional argument can be
> identical to a missing argument when it has the value of the default.

I didn't know about keyword arguments in scheme. It's SRFI-88 stuff?

>And not for procedures returning zero or multiple values.

You right.

> A small optimization would be not to check the hash table first and
> then perform another lookup.  You could perform one lookup and have
> that immediately check whether the value is stored in the hash table:
>
> (define (make-memoized proc)
>  (let ((memo (make-hash-table))
>        (missing (list 'missing)))
>    (lambda args
>      (let ((result (hash-table-ref/default memo args missing)))
>        (when (eq? result missing)
>          (set! result (apply proc args))
>          (hash-table-set! memo args result))
>        result

Collateral question: it's there a difference between define vars into
make-memoized directly or inside a let?

> I don't think the advice egg would add a lot.  You could use it like
> this:
>
> ---
> (use srfi-69 advice)
> (define-syntax mdefine (syntax-rules ()
>                         ((mdefine (proc v ...) body ...)
>                          (begin (define (proc v ...) body ...)
>                                 (memoize proc)
>
> (define (memoize proc)
>  (let  ((memo (make-hash-table))
>         (missing (list 'missing)))
>    (advise 'around proc
>            (lambda (inner args)
>              (let ((result (hash-table-ref/default memo args missing)))
>                (when (eq? result missing)
>                  (set! result (apply inner args))
>                  (hash-table-set! memo args result))
>                result))
>            'memoized)))
>
> (define (dememoize proc)
>  (unadvise proc 'memoized))

Cool, this is a pretty good example for around mode.

Thanks again Peter!

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Memoizing a procedure

2010-11-28 Thread Hugo Arregui
Hi guys,

I wrote a small code to add procedure memoization, most for learning
purposes (attached).
I'm glad to ear your suggestions.

Also, I cheked advice egg, but I cannot find the way to reuse in this
particular case.

Thanks,
Hugo.


mem.scm
Description: Binary data
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] upgrading to 4.6.0 in Arch

2010-11-12 Thread Hugo Arregui
Thanks!

I'm not sure if it's a problem of my install, but I found this:

CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.0
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2010-11-09 on archlinux (Linux)

; loading ./.csirc ...
#;1> (use charconv)
; loading /usr/lib/chicken/5/charconv.import.so ...
; loading /usr/lib/chicken/5/scheme.import.so ...
; loading /usr/lib/chicken/5/chicken.import.so ...
; loading /usr/lib/chicken/5/extras.import.so ...
; loading /usr/lib/chicken/5/regex.import.so ...
; loading /usr/lib/chicken/5/ports.import.so ...
; loading /usr/lib/chicken/5/posix.import.so ...
; loading /usr/lib/chicken/5/srfi-69.import.so ...
; loading /usr/lib/chicken/5/iconv.import.so ...
; loading /usr/lib/chicken/5/foreign.import.so ...
; loading /usr/lib/chicken/5/charconv.so ...
; loading /usr/lib/chicken/5/iconv.so ...

Error: unbound variable: make-hash-table

Call history:

  (quote charconv)
  (##core#quote charconv)
  (import charconv)
  (import scheme chicken extras regex ports posix 
srfi-69 iconv)
  (import scheme chicken extras foreign)
  (##core#undefined)
  (##core#undefined)
  (##core#undefined)
  (##core#undefined)
(##sys#require (quote charconv))  <--


It works if I add srfi-69 previously.

Thanks again.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] upgrading to 4.6.0 in Arch

2010-11-11 Thread Hugo Arregui
Hi everyone,

I have a few doubts after the upgrade:

- Which is the right procedure to upgrade eggs?

The new chicken version is still pointing to /usr/lib/chicken/5.

I try to export the CHICKEN_REPOSITORY var to a new
/usr/lib/chicken/6/, but the chicken-install script seems to ignore
this.

- Also, there's a way to reinstall all eggs in a single command or
something like that?

Thanks,
Hugo.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] date, string formatting and locale

2010-11-05 Thread Hugo Arregui
Thanks Thomas, it's clear now.

On Thu, Nov 4, 2010 at 8:01 AM, Thomas Chust  wrote:
> Hello,
>
> the locale egg may examine environment variables to set its default locale
> to the same one the C library would use, but the locale management of the egg
> and the C library is otherwise completely independent. It should definitely
> be possible to setup the C library and the locale egg to use completely
> different locales. But, as I mentioned before, setting the C library locale
> at all, especially inside a CHICKEN program, is usually not a terribly smart
> idea.
>
> Ciao,
> Thomas

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Check SRFI 19 localized strings

2010-11-03 Thread Hugo Arregui
The spanish capitalization seems to be ok. Maybe this doesn't matter but:

 (date-time . "~a ~d ~b ~H:~M:~S~z ~Y")

according to my unix date, should be:

 (date-time . "~a ~b ~d ~H:~M:~S~z ~Y")

2010/11/3 Kon Lovett :
> Hi,
>
> Because I need to release an updated srfi-19 egg now is a good time to check
> the localizations. We have Dutch, English, Spanish, and
> Brazilian-Portuguese. I would like for those in the know to confirm the
> capitalization. Currently it is inconsistent. Mainly, item, such as month
> names, have a leading lowercase, while I would expect uppercase.
>
> Best Wishes,
> Kon
>
> Spanish:
>
>
>
>
> Dutch:
>
>
>
>
>
> Brazilian-Portuguese:
>
>
>
>
>
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
>
>

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] date, string formatting and locale

2010-11-03 Thread Hugo Arregui
On Wed, Nov 3, 2010 at 1:20 PM, Thomas Chust  wrote:
> 2010/11/3 Hugo Arregui :
>> [...]
>> 1) Using posix:
>>
>> (use posix)
>> (time->string (string->time "2" "%d"))
>> "Tue Jan  2 00:00:00 1900"
>>
>> but, my current locale es:
>>
>> (use locale)
>> (current-locale)
>> "es_AR.utf8"
>> [...]
>
> Hello,
>
> the POSIX functions use the C standard library's locale which is entirely
> independent from that of the locale egg.
>
> In fact, if you set the C library's locale to anything else than "C", all hell
> breaks lose inside CHICKEN: For example the reader will no longer recognize
> floating point numbers in the standard Scheme format. If you are lucky numbers
> in the C library locale's format will be recognized, but if the locale happens
> to change the decimal point to something else than #\. it is very likely that 
> no
> floating point numbers will be recognized at all by the reader.
>
> If you change the C library's locale at all from inside a Scheme program, I
> would advise to keep this change strictly local to the application of 
> procedures
> like time->string and always ensure that the locale is reset to "C" upon exit
> from the relevant dynamic scopes.
>
> Ciao,
> Thomas

I'm not quite sure understand the idea. You mean (current-locale)
could not be the POSIX locale?

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] date, string formatting and locale

2010-11-03 Thread Hugo Arregui
Sorry, I'm bothering you again:

I found another issue with srfi-19:

string->date works as its expected with all full month name but may:

> (string->date "16 de Septiembre de 2007" "~d de ~B de ~Y")
#,(date 0 0 0 0 16 9 2007 -10800 ART #f #f #f #f)
> (string->date "16 de Mayo de 2007" "~d de ~B de ~Y")
Error: (string->date) bad date template - invalid string for indexer: "Mayo"

Now, this works and shouldn't:

> (string->date "16 de may de 2007" "~d de ~B de ~Y")
#,(date 0 0 0 0 16 5 2007 -10800 ART #f #f #f #f)

Seems like a mistake in full month spanish names. But, looking at the
code in svn, in trunk/es/srfi-19 it's well defined:

;; long month
 [..] (may . "Mayo") [..]

(I don't know if that file is just for test purposes or are the true
definition).

(I'm using chicken Version 4.5.0)

Thanks again!
Hugo.


On Wed, Nov 3, 2010 at 1:33 PM, Kon Lovett  wrote:
> Kon

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] date, string formatting and locale

2010-11-03 Thread Hugo Arregui
Sorry, I found another thing in srfi-19:

> (date->string (seconds->date 12) "~B")
"Diciembre"

but, now:

> (string->date (date->string (seconds->date 12) "~B") "~B")

Error: (scan-date) bad date template - date read incomplete
"~B"
#,(date 0 0 0 0 #f 12 #f -10800 ART #f #f #f #f)

I'm missing something?

Thanks.
Hugo.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] date, string formatting and locale

2010-11-03 Thread Hugo Arregui
> I meant the date program in UNIX. The (2) refers to the manpage
> section. Sorry for the confusion.

No problem, here is:

$ date
mié nov  3 11:46:59 ART 2010

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] date, string formatting and locale

2010-11-03 Thread Hugo Arregui
On Wed, Nov 3, 2010 at 10:44 AM, Peter Bex  wrote:
>> 1) Using posix:
>>
>> (use posix)
>> (time->string (string->time "2" "%d"))
>> "Tue Jan  2 00:00:00 1900"
>>
>> but, my current locale es:
>>
>> (use locale)
>> (current-locale)
>> "es_AR.utf8"
>
> hmmm, I think time->string uses strftime(), so it depends on
> whether your OS supports this.  Can you verify that?  (ie, what's
> the output of date(2)?)

I think that is supported, I already wrote an C code to test it:

#include 
#include 
#include 

int main()
{
  time_t tiempo;
  char cad[80];
  char *old_locale;
  struct tm *tmPtr;

  setlocale(LC_ALL, "es_AR.utf8");
  tiempo = time(NULL);
  tmPtr = localtime(&tiempo);
  strftime(cad, 80, "%H:%M.%S, %A de %B de %Y", tmPtr);

  printf("%s\n", cad);
  return 0;
}

"11:30.08, miércoles de noviembre de 2010"

(But sorry, I don't understand what is date(2), C, scheme, in the term?)

> I guess it uses the more Schemely syntax from SRFI-19. See the SRFI
> document for details: http://srfi.schemers.org/srfi-19/srfi-19.html
>
> (search for "string->date")
>

Great! it works!.

Thanks,
Hugo.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] date, string formatting and locale

2010-11-03 Thread Hugo Arregui
Hi guys,

I'm facing some troubles getting a formatted string from a date.

1) Using posix:

(use posix)
(time->string (string->time "2" "%d"))
"Tue Jan  2 00:00:00 1900"

but, my current locale es:

(use locale)
(current-locale)
"es_AR.utf8"

(Spanish, Argentina)

2) Trying srfi-19:

srfi-19-io has a format-date, but what kind of format is using?

(require-extension srfi-19-date)
(require-extension srfi-19-io)
(format-date #f "%B" (seconds->date 1))
"%B"

Thanks,
Hugo.

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] newbie question about numbers

2010-02-18 Thread Hugo Arregui
On Thu, Feb 18, 2010 at 1:23 PM, Hugo Arregui  wrote:
> I am using Chicken Version 4.3.0 with Arch Linux.
>
> I'll try with a newer version, and see what happens.
>
> Thanks,
> Hugo.
>

I try with 4.3.5, and get the same result:

#;1>  (/ 1 7)
0.142857142857143
#;2>  (flonum-print-precision 23)
15
#;3> (/ 1 7)
0.14285714285714285


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] newbie question about numbers

2010-02-18 Thread Hugo Arregui
I am using Chicken Version 4.3.0 with Arch Linux.

I'll try with a newer version, and see what happens.

Thanks,
Hugo.

On Wed, Feb 17, 2010 at 10:45 PM, Kon Lovett  wrote:
> Sorry, don't know what to tell you. 'flonum-print-precision' appears to be
> undocumented in the current manual. However, the code in
> 'C_number_to_string' (the actual primitive for 'number->string') makes use
> of the value. Both the core printer and the numbers printer use this
> routine.
>
> When 'gcvt' is available it is used in preference to the 'printf' family.
> The only platform I know of that states it doesn't have 'gcvt' is MacOS X;
> it does but deprecated. I don't know about your platform. I am using Chicken
> Version 4.3.5 w/ MacoS 10.5 so YMMV.
>
> On Feb 17, 2010, at 1:49 PM, Hugo Arregui wrote:
>
>> On Wed, Feb 17, 2010 at 6:08 PM, Kon Lovett  wrote:
>>>
> 
>>>
>>> #;9> (exact->inexact (/ 1 7))
>>> 0.142857142857142849212692681248881854116916656494140625
>>> #;10> (flonum-print-precision 15)
>>> 100
>>> #;11> (exact->inexact (/ 1 7))
>>> 0.142857142857143
>>
>> But I don't see the same results:
>>
>> #;1> (flonum-print-precision)
>> 15
>> #;2> (/ 1 7)
>> 0.142857142857143
>> #;3> (flonum-print-precision 23)
>> 15
>> #;4> (/ 1 7)
>> 0.14285714285714285
>> #;5> (flonum-print-precision 100)
>> 23
>> #;6> (/ 1 7)
>> 0.14285714285714285
>> #;7>
>>
>> Cheers,
>> Hugo.
>
> Best Wishes,
> Kon
>
>
>


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] newbie question about numbers

2010-02-17 Thread Hugo Arregui
Hi,

I have a few new questions about numbers:

Doing tests I find two values: flonum-precision (a variable) and
flonum-print-precision (a procedure), I suppose that the
flotnum-precision means the real working precision and the other one,
it's just for display. But, I tried:

;I'm using numbers extension

(flonum-print-precision) => 15

flonum-precision => 53

(exact->inexact (/ 1 7)) => 0.142857142857143 ; It's what I expected

(flonum-print-precision 100) ; it's right?

(exact->inexact (/ 1 7)) => 0.14285714285714285 ; I expect 53 decimals
at least.. why this happens?

There's a way to change the flonum-precision?

Btw, there's a place to read this things and avoid disturbing you?.

Thanks again,
Hugo.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] procedure memoization

2010-02-12 Thread Hugo Arregui
Hi,

there's a standard implementation for procedures memoization? Srfi or egg?

Thanks,
Hugo.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] newbie question about numbers

2010-02-09 Thread Hugo Arregui
Thanks Peter, I install numbers and works like a charm!.

Thanks for the explanation too, It was very useful.

Cheers,
Hugo.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] newbie question about numbers

2010-02-07 Thread Hugo Arregui
Hi,

I'm new in scheme, and, of course, in chicken too. I've a few newbie
doubts about numbers, I hope you can help me.

First, reading the scheme report I notice about a set of complex
numbers procedures:

make-rectangular
make-polar
real-part
etc

I found some of them implemented in chicken (without extensions), but
miss others. Specifically: make procedures. It's sound very strange to
me.

In other hand, I've doubts about number representations and exactness:

Can I represent a big integer as an exact number?

For example, when I try "#e20", I get this error:
(inexact->exact) inexact number cannot be represented as an exact
number: 20.0

In the Scheme revision I read: "For this purpose, numerical constants
may be written with an exponent marker that indicates the desired
precision of the inexact representation. The letters s, f, d, and l
specify the use of short, single, double, and long precision,
respectively.". Are these representations available in chicken?

Thanks,
Hugo.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users