Concentrate procedures from various modules in one module

2017-02-21 Thread Diogo F. S. Ramos
Can I concentrate procedures from various modules in one module and use this module in the other modules? For example, suppose I have these modules: (define-module (foo) #:export (foo-proc)) (define-module (bar) #:export (bar-proc)) `foo' is a module that exports procedure `foo-proc' and `b

Re: Passing objects between threads

2016-09-10 Thread Diogo F. S. Ramos
> Hi, > is there any easy way to create a channel (queue) that could be used to > communicate between threads? In particular, if the queue is empty, I would > like the consumer to wait until something appears in it (pretty much like > the channels in Clojure) I don't know about Clojure, but I've w

How is a procedure's signature documented?

2014-04-29 Thread Diogo F. S. Ramos
Is there a pattern they must/should follow? Using (ice-9 documentation), I've been looking at some procedure signatures. For what I can tell, they are described in the first line of `object-documentation'. Here are some examples: (object-documentation car) => "- Scheme Procedure: car " (objec

Re: What is the output port of `system*'?

2014-04-27 Thread Diogo F. S. Ramos
>> As an example of this behavior, I point to the following Racket program: >> >> #lang racket >> >> (define foo >> (with-output-to-string >> (lambda () >> (system* (find-executable-path "ls") "/tmp" > > I agree that it would be nice to make this work as you expected. In > order to

Re: What is the output port of `system*'?

2014-04-26 Thread Diogo F. S. Ramos
> "Diogo F. S. Ramos" writes: > >> The following program doesn't output to a string, which I expected. >> >> (define foo >> (with-output-to-string >> (lambda () >> (system* "ls" "/tmp" > > A

Re: #:getter procedure returns unexpected value in GOOPS

2014-04-26 Thread Diogo F. S. Ramos
>> I tried changing all to `#:init-value', but the result was the same. > > Imo, using your definitions, guile should return 'foo, not 42. IMO it should return 'bar, as `foo-a' should return the value of the slot `a', which in the subclass of is 'bar.

What is the output port of `system*'?

2014-04-26 Thread Diogo F. S. Ramos
The following program doesn't output to a string, which I expected. --8<---cut here---start->8--- (define foo (with-output-to-string (lambda () (system* "ls" "/tmp" --8<---cut here---end--->8---

Re: #:getter procedure returns unexpected value in GOOPS

2014-04-26 Thread Diogo F. S. Ramos
> "Diogo F. S. Ramos" writes: > >> When using GOOPS, if a class has a second slot, the #:getter procedure >> of the first slot returns the value of the second slot when applied to >> an instance of a subclass. >> >> (use-modules (oop goops)) &g

#:getter procedure returns unexpected value in GOOPS

2014-04-25 Thread Diogo F. S. Ramos
When using GOOPS, if a class has a second slot, the #:getter procedure of the first slot returns the value of the second slot when applied to an instance of a subclass. --8<---cut here---start->8--- (use-modules (oop goops)) (define-class () (a #:init-form '

Re: Description of `program-sources' and accessors

2014-04-22 Thread Diogo F. S. Ramos
> On the other hand it is probably possible to know where a name "foo" in > a module (bar) is defined, through VM internals. Not currently > implemented. But that's a mapping from fully-qualified _names_ to > locations, not values to locations. I didn't think of this distinction. For my purpose

Re: Description of `program-sources' and accessors

2014-04-22 Thread Diogo F. S. Ramos
>> I'm using this interface to know where an object has been defined. > > What does this mean? (Have you seen the (system xref) facility? It > doesn't do a good job with non-procedures, but perhaps we could change > that.) Thank you for the reference. `procedure-callees' and `procedure-callers'

Re: Description of `program-sources' and accessors

2014-04-20 Thread Diogo F. S. Ramos
>> Is there a place which describes the meaning of each of element of >> `program-sources' accessors? > > Note that this is an interface that is very specific to Guile 2.0's > VM, and it's gnarly in many ways. However :) What program-sources > returns is a list of sources. Therefore source:addr

Description of `program-sources' and accessors

2014-04-19 Thread Diogo F. S. Ramos
Is there a place which describes the meaning of each of element of `program-sources' accessors? For example: (source:addr (program-sources every)) => (0 "srfi/srfi-1.scm" 810 . 0) What does each element of the improper list mean? Also for `source:file', `source:line' and `source:column'. The

Re: Does Guile have a thread limit?

2014-04-05 Thread Diogo F. S. Ramos
>> From: "Diogo F. S. Ramos" >> Date: Sat, 05 Apr 2014 03:28:25 -0300 >> >> The following program is aborted: >> >> --8<---cut here---start->8--- >> (define number-of-thread 1000) >> >>

Does Guile have a thread limit?

2014-04-04 Thread Diogo F. S. Ramos
The following program is aborted: --8<---cut here---start->8--- (define number-of-thread 1000) (do ((i number-of-thread (- i 1))) ((zero? i)) (call-with-new-thread (lambda () (sleep 42 --8<---cut here---end--->8---

Re: Number in a module-name

2014-03-14 Thread Diogo F. S. Ramos
>> Is it possible to have a number as a module-name component? >> >> e.g. (define-module (42 bar)) > > At present, module name components must be symbols. Could I use something like (define-module (#{42}# bar))?

Re: guile-gnome and guile 2

2013-08-09 Thread Diogo F. S. Ramos
>> Second, with the guile-gnome tarball you referenced, it errors >> complaining that only `glib.h' can be included directly, so the >> compilation stops. > > That probably is because the '-dev' files/packages are not installed on your > machine. I am on debian it is the libglib2.0-dev package. Th

Re: guile-gnome and guile 2

2013-08-09 Thread Diogo F. S. Ramos
>> Is there a release of guile-gnome which works with guile 2? > > Yes, here a the link to the latest tarball: > > > http://ftp.gnu.org/pub/gnu/guile-gnome/guile-gnome-platform/guile-gnome-platform-2.16.2.tar.gz > > Obviously, there a re dependencies > > http://www.gnu.org/software/gu

guile-gnome and guile 2

2013-08-09 Thread Diogo F. S. Ramos
Is there a release of guile-gnome which works with guile 2?

Re: Loading a module before and after adding a load path

2013-01-18 Thread Diogo F. S. Ramos
Noah Lavine writes: > As a workaround, remove your module from the list "autoloads-done". > (actually, there will be a pair > in that list, where the cdr of the pair is the name of the module as a > string. remove that.) Nice! Thank you. Here is a little procedure that might help someone (it

Re: Loading a module before and after adding a load path

2013-01-18 Thread Diogo F. S. Ramos
Nala Ginrut writes: > Why you need to load the module without giving its path? Sorry, I should have added some more context. While I'm working with the REPL, sometimes I forget to add the path to a module before trying to use it. It's a mistake. So, after trying to load the module with `use-mod

Re: Loading a module before and after adding a load path

2013-01-18 Thread Diogo F. S. Ramos
Yanbin Zhang writes: > Hi, > > I guess you need to tell GUILE where to find your module before you can load > it. GUILE has some standard places where it will look for modules. If your > module is not there, then you need to add the path so > that GUILE can find it. There are several ways to do

Loading a module before and after adding a load path

2013-01-18 Thread Diogo F. S. Ramos
I have a module at `/path/to/foo'. If I open a guile REPL and type: (add-to-load-path "/path/to/foo") (use-modules (foo bar)) everything works. But, if I type: (use-modules (foo bar)) (add-to-load-path "/path/to/foo") (use-modules (foo bar)) I get the same error I've got by using a module befo

Re: Installing scheme only programs

2011-03-10 Thread Diogo F . S . Ramos
want to get rid of comments.I >> always do it like this way: >> == >> sed "/;.*/d" filename >> == > > Careful! Guile now has the expression comment #; > That sed would be bad for something like (list a #;b c) Thank you for the 'sed' recipe. Unfortunately, it's deleting whole lines like: (foo bar) ;;this line is gone -- Diogo F. S. Ramos

Re: Installing scheme only programs

2011-03-10 Thread Diogo F . S . Ramos
t know. But I guess, in the end, the way to go would be using the new compilation technology from guile 2.0, although not for now, as I'm running 1.8. -- Diogo F. S. Ramos

Re: Installing scheme only programs

2011-03-10 Thread Diogo F . S . Ramos
m4 macros from guile.m4 to test if some guile modules are installed. The thing is, while I can test for (gnome-2), I can't for, say, (gnome gtk), because, as I understand it, (gnome-2) prepares the paths to enable loading gnome modules, but, as I'm not /using/ (gnome-2) at configure time, I can't locate them. -- Diogo F. S. Ramos

Installing scheme only programs

2011-03-09 Thread Diogo F . S . Ramos
de my application take a little more time to start than separate loaded files. I didn't do any benchmark, so don't take my word on it. So, what do you guys think? Is there a proper way to distribute and install scheme only programs? -- Diogo F. S. Ramos

Re: Guile 2.0 + guile-gnome + GTK 3

2011-02-23 Thread Diogo F . S . Ramos
aying. ;) >> > > Sorry, I mean I'm using it. Not maintaining it. I just told you > guile-gnome + guile2.0 works well. > And you can find it here: > http://www.gnu.org/software/guile-gnome/ Oh, I see. Nice to know, thank you. Now, just the second question remains. -- Diogo F. S. Ramos

Re: Guile 2.0 + guile-gnome + GTK 3

2011-02-23 Thread Diogo F . S . Ramos
s a good idea? I was doing some reading and the Introspection thing seems to be a nice way for doing bindings. At least it's what people are saying. ;) -- Diogo F. S. Ramos

Guile 2.0 + guile-gnome + GTK 3

2011-02-23 Thread Diogo F . S . Ramos
Is it possible to use guile-gnome with Guile 2.0? Are there any plans to port guile-gnome to GTK 3? -- Diogo F. S. Ramos