guile

How to check whether GNU Make supports Guile

别来无恙 提交于 2019-12-11 06:41:17
问题 How to check from the command line whether GNU Make is built with support of Guile? Inside Makefile it can be determined via analyzing .FEATURES variable (see documentation). 回答1: As @ruvim points out, the manual says You can determine whether GNU Guile support is available by checking the .FEATURES variable for the word guile . $(if $(filter guile,${.FEATURES}) \ ,$(info Guile suppoerted, yay!) \ ,$(error Guile not supported - update your make)) 回答2: One possible way is a quasi makefile in

Detecting #<unspecified> in Scheme list

人盡茶涼 提交于 2019-12-11 03:13:16
问题 I have a function which return a list of values. Some of these values may be empty lists themselves, while some are not. However, at the end of every list, there is a #<unspecified> value present. I understand that this value is returned when the function does not return anything. I want to trim this value, along with other null lists. My list is like this: (() () MD- MC+. #<unspecified>) I intend to apply a filter function to this list. The criteria that I will be applying is null? . However

How to fix libguile/stime.c on macOS Sierra build of guile-2.0.11?

假如想象 提交于 2019-12-11 03:08:52
问题 enter link description hereThe build of guile-2.0.11 stops with the following error, Undefined symbols for architecture x86_64: "_clock_getcpuclockid", referenced from: _scm_init_stime in libguile_2.0_la-stime.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Googling around I found a bug report and patch. The bug report is here: http://lists.gnu.org/archive/html/bug-guile/2016-06/msg00252.html The link to the

decent way of nested definition in scheme

≡放荡痞女 提交于 2019-12-10 18:53:53
问题 I want to define a constant foo using an auxiliary function, say, bar . And I want to hide bar inside the definition of foo , so I come with this code: (define foo (define (bar n) (+ n n)) (bar 1)) However, this definition causes syntax errors in many scheme implementations(mit-scheme, racket, guile, etc.). I have three workarounds but none of them seems satisfactory: (define foo1 ((lambda () (define (bar n) (+ n n)) (bar 1)))) (define foo2 (let ((bar (lambda (n) (+ n n)))) (bar 1))) (define

How to change current directory in GNU Make

亡梦爱人 提交于 2019-12-10 16:48:58
问题 I want to separate the directory with sources from the directory with targets. And it seems that changing the current working directory from Makefile should be the simplest solution. Explicit path to targets is not sufficient because of the following drawbacks: Redundant code in Makefile since every reference to target should be prefixed with variable. More complex command line to build particular intermediate target (worse for debugging). See also Pauls's rule #3: Life is simplest if the

How do I evaluate a symbol returned from a function in Scheme?

南笙酒味 提交于 2019-12-10 15:47:15
问题 I'm refamiliarizing myself with Scheme and I've hit a problem that is probably reflecting a fundamental misunderstanding on my part. Say I do the following in Scheme (using Guile in this case but it's the same in Chicken): > (define x 5) > x 5 > (string->symbol "x") x > (+ 5 (string->symbol "x")) <unnamed port>:45:0: In procedure #<procedure 1b84960 at <current input>:45:0 ()>: <unnamed port>:45:0: In procedure +: Wrong type: x > (symbol? (string->symbol "x")) #t > (+ 5 x) ; here x is

How can I convert a string into exact number in Scheme Lisp?

那年仲夏 提交于 2019-12-08 06:44:48
问题 For example, I have this string: "6119726089.12814713" If I do (string->number "6119726089.12814713") - using the SISC implementation the result is 6.119726089128147e9 - and in Guile implementation is 6119726089.128147 but I would like an exact number, like: 611972608912814713/100000000 without loss precision. I'd like a function like (string->exact) or something like this. NOTE: please fix my non-native English and remove this message. Thanks. 回答1: Use (string->number "#e6119726089.12814713"

How to abbreviate 'note with the same note an octave higher, parenthesized' in Lilypond?

谁说我不能喝 提交于 2019-12-07 03:56:21
问题 Currently I write lilypond code that looks like this: \version "2.14.2" P = #parenthesize \relative c, { \clef bass <c \P c'> <e \P e'> <g \P g'>2 <c, \P c'>4 <d \P d'> <e \P e'>2 } where I repeatedly mean ' this note, together with the same note one octave higher, parenthesized'. I'd like a way to abbreviate this, so that I can write something like this: \version "2.14.2" poct = ... \relative c, { \clef bass \poct c \poct e \poct g2 \poct c,4 \poct d \poct e2 } As suggested in a helpful

How to parse out base file name using Script-Fu

旧城冷巷雨未停 提交于 2019-12-07 01:05:44
问题 Using Gimp 2.6.6 for MAC OS X (under X11) as downloaded from gimp.org. I'm trying to automate a boring manual process with Script-Fu. I needed to parse the image file name to save off various layers as new files using a suffix on the original file name. My original attempts went like this but failed because (string-search ...) doesn't seem to be available under 2.6 (a change to the scripting engine?). (set! basefilename (substring filename 0 (string-search "." filename))) Then I tried to use

Execute command line from Scheme (Guile)

六眼飞鱼酱① 提交于 2019-12-06 01:51:04
问题 The question is described on the title, basically I'd like to execute a command line from scheme, let's say 'ls' and obtaining the output. So my questions are: Is it possible? How? Thanks a lot in advance! By the way I use Guille. 回答1: You need one of these system and system* . Example: (system "ls") From the documentation: Guile Reference — Scheme Procedure: system [cmd] — C Function: scm_system (cmd) Execute cmd using the operating system's “command processor”. Under Unix this is usually