Comments (8)
I tried attaching erl_crash.dump
, but it seems that github doesn't support attaching non-image files.
from lfe.
Forgive my newbness, but here's some more:
$ erl -pa ebin
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.9.3.1 (abort with ^G)
1> lfe_comp:file(hello).
** exception error: no case clause matching {error,tokens}
in function lfe_io:with_token_file/2 (src/lfe_io.erl, line 93)
in call from lfe_comp:file/2 (src/lfe_comp.erl, line 70)
2>
from lfe.
Hi Duncan,
There shouldn't be any problems running LFE on R15B03 on a Mac as I run it on R15B also on a Mac. I use the precompiled version from Erlang Solutions, https://www.erlang-solutions.com/downloads/download-erlang-otp, though this should not make a difference.
Your first problem is that the erlang system is not finding the LFE .beam files. The lfe
script is quite simple and it doesn't know where to find the binaries. You either have to give a -pa ebin
argument to it as you do with erl
, or use the ERL_LIBS
environment variable if you have more applications you wish to find automatically. See the documentation for the code
module.
Your second problem may be a bug in LFE. The LFE tokeniser is finding an error but the lfe_io
module is not handling it correctly. It is rare to get errors when scanning which is probably why I haven't noticed it before. I hope. Could you please send me a copy of the "hello.lfe" file so I can fix it? If it short just include it, or you can mail it to me at [email protected].
There is also a Google group at https://groups.google.com/forum/?hl=en&fromgroups#!forum/lisp-flavoured-erlang which may be easier for discussions.
I hope this helps,
Robert
from lfe.
Another reason for your second problem just occurred to me. The source file for the LFE tokeniser, lfe_scan
is the file lfe_scan.xrl
which is meant to be run through the Erlang tool leex to generate the erlang source file lfe_scan.erl
. Doing make "should " handle this correctly but if it doesn't then there may not be a compiler lfe_scan.beam
in ebin. To check this try doing
erlc -o ebin src/lfe_scan.xrl
which should result in there being an lfe_scan.beam generated in ebin.
If doing make did not generate this file then I need to fix Makefile.
By the way which branch are you using, it is only 'master' which is intended for users. There are no guarantees that 'develop' is consistent.
from lfe.
Thanks, Robert! Was away for the weekend, but will following your suggestions and provide everything you asked for :-)
from lfe.
Robert, thanks again for your help. I was keeping notes for this in an email to the group, but at the end, it seems that there is something missing with the Makefile, so I'm following up here.
Here's some more info for you:
- I am running against the "develop"
- I did run make prior to running ./lfe
- make did not generate lfe_scan.beam
- the hello.lfe I used is a copy-and-paste of the one given here: https://github.com/rvirding/lfe/wiki/Get-started ("First Program")
Here's what I've done, following your suggestions from your comments on the ticket I opened:
- ran make clean and then make, just to double-check that lfe_scan.beam was not getting created by make
- ran erlc -o ebin src/lfe_scan.xrl -- but this did not generate a .beam (only a .erl)
- made sure that I was using erl -pa ./ebin
Attempting to run the hello.lfe like this results in the following error:
** exception error: no case clause matching {error,tokens}
in function lfe_io:with_token_file/2 (src/lfe_io.erl, line 93)
in call from lfe_comp:file/2 (src/lfe_comp.erl, line 70)
Seeing that an .erl file was created with your command above, I followed that with this command:
erlc -I include -o ebin -W0 +debug_info ebin/lfe_scan.erl
And that did the trick!
Your makefoo is much stronger than mine -- I've never used something like what you're doing with "$(SRCDIR)/%.erl: %.xrl" so I don't know why it's not compiling the .xrl file first. Otherwise I would have submitted a patch, and saved you some time :-/
To summarize: when I do this first:
erlc -o src src/lfe_scan.xrl
before running make, the src/lfe_scan.erl is present and is compiled with the rest of the .erl files into the ebin dir when I run make.
from lfe.
And, with that done, I have a running repl with no errors:
./lfe -pa ./ebin
Horray! Now I can finally learn me some Erlang... ;-)
from lfe.
What happened was that the file lfe_scan.erl was removed from the distribution which is fine as it is a generated file. However, the Makefile wasn't modified to handle this. I will fix it so it works better. Rebar handles this auotmagically so there are no problems.
from lfe.
Related Issues (20)
- Feature Request: Github Discussions HOT 1
- Run tests without rebar3 HOT 4
- Add make targets for testing HOT 1
- README: Run tests with Makefile HOT 3
- Improve workflow for publishing LFE to hex.pm
- Odd recursion bug with rebar3_lfe as a plugin dep HOT 1
- v2.1.1 tagged but not marked as latest HOT 5
- lc/2 not defined HOT 8
- ets-ms is attempting to match 'undefined' when using match-record with unspecified slots HOT 5
- Error expanding (seemingly valid) qlc macro HOT 12
- Extend documentation for patterns HOT 2
- CI/CD no longer runs on older builds HOT 4
- Type definitions and specifications do not accept empty list syntax HOT 1
- Issues with LFE and Erlang 26.0 (user:start) HOT 5
- Make banner functions public for re-use in rebar3_lfe
- Consider using Erlang's shell:start_interactive for 26+ HOT 1
- Explore the possibility of making the LFE REPL developer experience more configurable HOT 2
- module-alias is ignored for macros HOT 1
- Pattern matching on nested literals with underscore. HOT 3
- Test Failures with rebar3 3.23.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lfe.