Guile
Guile related posts
Associate GPS coordinates with a street address
Init.el
1 | ;;;; Guile/Lisp Setup |
Guile alternatives to DSLs
From https://ambrevar.xyz/guix-advance/
- XML, HTML (better idea: S-XML)
- Make, Autoconf, Automake, CMake, etc.
- Bash, Zsh, Fish (better ideas: Eshell or scsh)
- JSON, TOML, YAML
- Nix language, Portage’s Ebuild and many other OS package definition syntax rules.
- Firefox when it used XUL (but since then Mozilla has moved on) and most other homebrewed extensibility languages
- SQL
- Octave, R, PARI/GP, most scientific programs (better ideas: Common Lisp, Racket and other Schemes)
- Regular expressions (better ideas: Emacs’ rx, Racket’s PEG, etc.)
- sed, AWK, etc.
- Most init system configurations, including systemd (better idea: GNU Shepherd)
- cron (better idea: mcron)
- conky (not fully programmable while this is probably the main feature you would expect from such a program)
- TeX, LaTeX (and all the derivatives), Asymptote (better ideas: scribble, skribilo – still in development and as of January 2019 TeX/LaTeX are still used as an intermediary step for PDF output)
- Most programs with configurations that don’t use a general-purpose programming language.
Issues
Install guile 2.2.7; can’t find libffi
https://guile-user.gnu.narkive.com/qcZSj1pL/libffi-not-found-even-if-installed-in-default-path
$ find /usr -name ‘libffi.*’
/usr/lib/libffi.dylib
/usr/local/lib/libffi.5.dylib
/usr/local/lib/libffi.a
/usr/local/lib/libffi.dylib
/usr/local/lib/libffi.la
/usr/local/lib/pkgconfig/libffi.pc
/usr/local/share/info/libffi.info
However, it did not help, and the ./configure still fails with the very same error message.
Did you try running configure as something like
‘PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure’
My command:
PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig ./configure
Configuration
In .bash_profile (not .bashrc)
(see https://guix.gnu.org/manual/en/html_node/Invoking-guix-environment.html#Invoking-guix-environment)
GUIX_PROFILE=”$HOME/.guix-profile” ;
source “$HOME/.guix-profile/etc/profile”
PKG_CONFIG_PATH
Missing development packages error
sudo find / -name “guile*.pc”
Look at the directories, are they present when
echo PKG_CONFIG_PATH
Say you find one in /usr/local/lib/pkgconfig
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig in .bashrc
sudo find / -name “guile*.pc”
%load-path
Is it in the path:
scheme@(guile-user)> (search-path %load-path “dbi/dbi.scm”)
#find / -wholename dbi/dbi.scm
note that I find /usr/local/share/guile/site/2.2/dbi/dbi.scm so to use-modules (dbi dbi) I must in .bashrc:
export GUILE_LOAD_PATH=”/usr/local/share/guile/site/2.2:/home/mbc/.guix-profile/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH”
McCarthyism is alive and well on the liberal left
…individuals with aggressive, rule-breaking and anti-social tendencies…are over-represented among benefit recipients.
Princeton Study - U.S. No Longer An Actual Democracy
American democracy no longer exists. I think the average American is aware of this - hence the popularity of Donald Trump. Throw the bums out!
Euler-98
https://projecteuler.net/problem=98
By replacing each of the letters in the word CARE with 1, 2, 9, and 6 respectively, we form a square number: 1296 = 36^2. What is remarkable is that, by using the same digital substitutions, the anagram, RACE, also forms a square number: 9216 = 96^2. We shall call CARE (and RACE) a square anagram word pair and specify further that leading zeroes are not permitted, neither may a different letter have the same digital value as another letter.
Using words.txt, a 16K text file containing nearly two-thousand common English words, find all the square anagram word pairs (a palindromic word is NOT considered to be an anagram of itself).
What is the largest square number formed by any member of such a pair?
NOTE: All anagrams formed must be contained in the given text file.
1 |
|
There are 1786 words, the longest is 14 characters and the smallest is 1 character. Since we have already been given the square anagram word pair CARE / RACE I will assume the answer is greater than 4 characters and ignore all 1-4 character words.
Write a function compare.word that will take 2 words, sort the characters and determine if the two words have the same characters.
1 | > compare.word <- function( a, b){ |
There are 19 anagrams with lengths of 5, 6, 8, or 9 characters.
Now figure out how many squares of length 5,6,8, or 9 exist.
These squares will be between 100^2 to 31623^2
1 |
|
There are about 41,000 squares. Assign a square to a word, rearrange according to the square pair, determine if the new word is in the anagram list.
1 |
|
CENTRE assigns different numbers to the ‘E’ violating one of the rules so BROAD/BOARD is the anagram pair and the largest square is 18769