Re: can't export conditional variable set with 'cond'

2024-02-02 Thread Mortimer Cladwell
Thanks all. Both parameters and boxes work for me with guile-3.0.9, which is what I run on my local machine. >> I get the impression that you were asking this more for curiosity about how the language implementation works than to solve a problem I am trying to solve a problem. I have old code run

can't export conditional variable set with 'cond'

2024-01-23 Thread Mortimer Cladwell
Hi, Suppose I have the following module "testexport" with the auxiliary module "env.scm", used to set global environment variables: -testexport.scm begin-- (define-module (testexport) #:use-module (ice-9 pretty-print) #:use-module (env) ) (define

g-golf example error 'No applicable method for #< g-application-run'

2023-11-09 Thread Mortimer Cladwell
Hi, I have installed g-golf with guix: guix package -i guile-g-golf gtk guile-cairo I try to run the hello-world example with the manifest.scm: ---manifest.scm-- (specifications->manifest '("guile" "guile-g-golf" "guile-cairo" "gtk")) --- mbc@ins

Re: intern a top level variable

2023-08-16 Thread Mortimer Cladwell
21:17, Mortimer Cladwell wrote: > > I would like to define a variable within a method but make it available > to > > the entire module - globally. > > Take a string "abc" convert to a variable (symbol??) abc and set to the > > string value "def". > >

Re: Re: intern a top level variable

2023-08-16 Thread Mortimer Cladwell
@(guile-user)> (test-intern) scheme@(guile-user)> abc $14 = "def" So yes I will need to read more about interning. Thanks Mortimer On Wed, Aug 16, 2023 at 12:13 PM Jean Abou Samra wrote: > Le mercredi 16 août 2023 à 10:55 -0400, Mortimer Cladwell a écrit : > > I wou

Re: Re: intern a top level variable

2023-08-16 Thread Mortimer Cladwell
I would like to intern and assign a value within a method: (define (test-intern) (let* ((name "abc") (data "def") (name-symbol (gensym name)) ) (pretty-print (string-append "symbol: " (symbol->string name-symbol))) (set! name-symbol data))) scheme@(guile-user)> (test-inte

intern a top level variable

2023-08-16 Thread Mortimer Cladwell
Hi, How do I intern a top level variable? looks like intern-symbol is deprecated? Is there a substitute? gensym does not seem to be it: scheme@(guile-user)> (gensym "abc") $11 = abc2652 scheme@(guile-user)> abc2652 ;;; : warning: possibly unbound variable `abc2652' ERROR: In procedure module-looku

Re: extract headers from response record

2023-08-10 Thread Mortimer Cladwell
:05 -0400, Mortimer Cladwell wrote: > > Hi, > > I am running a local fake Urbit zod on port 8080. I want to submit an > > http-request and obtain an urbauth id cookie. I run the following method: > > > > (use-modules (web client)(web response) (srfi srfi-9)(oop goops)

re: extract headers from response record

2023-08-09 Thread Mortimer Cladwell
a couple more: (pretty-print (record? a)) ==> #t (pretty-print (record-predicate a)) ==> not-a-record-type #< version: (1 . 1) code: 204 reason-phrase: "ok" headers: ((date . #) (connection close) (server . "urbit/vere-2.11") (set-cookie . "urbauth-~zod=0vao7n2.lcut2.mu17h.9dgil.2o48i; Path=/;

extract headers from response record

2023-08-09 Thread Mortimer Cladwell
Hi, I am running a local fake Urbit zod on port 8080. I want to submit an http-request and obtain an urbauth id cookie. I run the following method: (use-modules (web client)(web response) (srfi srfi-9)(oop goops) (ice-9 receive) (ice-9 pretty-print)) (define (urbit-http-connect) (let* ((uri "ht

Re: http-request bearer token syntax for Twitter v2 api

2022-10-13 Thread Mortimer Cladwell
Thanks Ricardo. I used your over-writes and modified my code below: (let* ( (uri "https://api.twitter.com/2/tweets";) (data "{\"text\":\"Hello world!\"}") (access-token "abcdemyaccesstoken") (my-headers `((Content-type . "application/json")(authorization . (bearer . ,access-token)) )) )

Re: http-request bearer token syntax for Twitter v2 api

2022-10-12 Thread Mortimer Cladwell
Thanks Olivier. Those spellings did not work with https://api.twitter.com/2/tweets and/or Guile http-request. On Wed, Oct 12, 2022 at 7:06 AM Olivier Dion wrote: > On Wed, 12 Oct 2022, Mortimer Cladwell wrote: > > Hi, > > Has anyone successfully submitted a bearer token to Twitt

http-request bearer token syntax for Twitter v2 api

2022-10-12 Thread Mortimer Cladwell
Hi, Has anyone successfully submitted a bearer token to Twitter v2 api using http-request? What syntax did you use? Without success I have tried many permutations/splellings/capitalizations of: (let* ( (uri "https://api.twitter.com/2/tweets";) (data "{\"text\":\"Hello world!\"}") (my-token (str

Re: backing out of debugger

2021-09-15 Thread Mortimer Cladwell
ue, Sep 14, 2021 at 10:35 AM Olivier Dion wrote: > On Tue, 14 Sep 2021, Luis Felipe wrote: > > On Tuesday, September 14th, 2021 at 1:27 PM, Mortimer Cladwell < > mbcladw...@gmail.com> wrote: > > > >> Thanks Luis. What about in emacs/geiser where Ctrl-D won

Re: backing out of debugger

2021-09-14 Thread Mortimer Cladwell
Thanks Luis. What about in emacs/geiser where Ctrl-D won't work? On Tue, Sep 14, 2021 at 9:11 AM Luis Felipe wrote: > Hi, Mortimer, > > On Tuesday, September 14th, 2021 at 12:50 PM, Mortimer Cladwell < > mbcladw...@gmail.com> wrote: > > > Hi, > > > >

backing out of debugger

2021-09-14 Thread Mortimer Cladwell
Hi, Let's say I made a lot of mistakes. I look at my repl and see: scheme@(guile-user) [10]> Any way to back out to scheme@(guile-user)> without typing ,q ten times? Thanks Mortimer

Can system modify an environment variable in the current environment?

2021-09-02 Thread Mortimer Cladwell
Hi, Consider my file test.scm: (define (main args) (let* ((myvar (string-append "export GUILE_LOAD_PATH=/some/random/text:$GUILE_LOAD_PATH")) (statement1 (system (string-append "echo " myvar " >> $HOME/.bashrc"))) (statement2 (system myvar))) (write myvar))) At the t

Meaning of <=> in the context of procedures

2021-06-02 Thread Mortimer Cladwell
Hi, What does <=> mean/do? It can be found in guile-json in the (json record) module, line 33: 33 #:export (<=> define-json-mapping define-json-type)) Not mentioned in the entire Guile manual. Happens to be defined on line 36 of the module: 36 (define <=> '<=>) I didn't find that very helpful