Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reporting , number_chars/2, installation problems. #192

Closed
UWN opened this issue Apr 8, 2022 · 8 comments
Closed

Error reporting , number_chars/2, installation problems. #192

UWN opened this issue Apr 8, 2022 · 8 comments

Comments

@UWN
Copy link

UWN commented Apr 8, 2022

#13:

?-  number_chars(N,[a|a]). 
2022/04/08 21:55:12 error(type_error(list, a), 'Expected list, found engine.Atom.') % unexpected

Expected: type_error(list, [a|a]).

To make errors more uniform, it helps a lot to express them internally in two ways: must_be(Type, X) and can_be(Type, X). See e.g. library(error) of Scryer. In above case, the entire term has to be reported. with can_be(list, [a|a]) you get this automatically.

(Also note that a dot in a list is not recognized just as in #1)

@UWN
Copy link
Author

UWN commented Apr 9, 2022

Maybe a clarification for this table which was created in preparation of Cor.2. What you need to conform to is Section 0 and Section 2. In Section 1 the sorry state prior to Cor.2 is depicted..

@UWN
Copy link
Author

UWN commented Apr 10, 2022

@ichiban: one question on this: how do I go-wise update and recompile? ((For rust I say: git pull && cargo build --release and for C mostly git pull && make))

@ichiban
Copy link
Owner

ichiban commented Apr 10, 2022

@UWN Thank you very much for letting me know the problems! git pull && go install github.com/ichiban/prolog/cmd/1pl will recompile and install 1pl from the source code.

Note that go install github.com/ichiban/prolog/cmd/1pl@latest will install the latest release of 1pl. Without a version suffix, it recompiles and installs from the source code.

$ git pull
Already up to date.
$ go install github.com/ichiban/prolog/cmd/1pl
$ $(go env GOPATH)/bin/1pl
Top level for ichiban/prolog (devel)
This is for testing purposes only!
See https://github.com/ichiban/prolog for more details.
Type Ctrl-C or 'halt.' to exit.
?- 

Alternatively, you can git pull && go run cmd/1pl/main.go to run without installing it.

$ git pull
Already up to date.
$ go run cmd/1pl/main.go 
Top level for ichiban/prolog (devel)
This is for testing purposes only!
See https://github.com/ichiban/prolog for more details.
Type Ctrl-C or 'halt.' to exit.
?- 

@UWN
Copy link
Author

UWN commented Apr 11, 2022

(It seems I am from the last century)

Where is this directory, where I shall say git pull? This is on a latop without any NFS or other remote file systems. There, I get:

ulrich@TU-Wien:~$ locate /ichiban
/home/ulrich/go/pkg/mod/cache/download/github.com/ichiban
...
/home/ulrich/go/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/ichiban
...
/home/ulrich/go/pkg/mod/github.com/ichiban
...

So I tried like:

ulrich@TU-Wien:~/go/pkg/mod/github.com/ichiban$ git pull
fatal: not a git repository (or any of the parent directories): .git
ulrich@TU-Wien:~/go/pkg/mod/github.com/ichiban$ cd
ulrich@TU-Wien:~$ locate .git| grep ichiban
/home/ulrich/go/pkg/mod/github.com/ichiban/prolog@v0.8.0/.github
/home/ulrich/go/pkg/mod/github.com/ichiban/prolog@v0.8.0/.github/workflows
/home/ulrich/go/pkg/mod/github.com/ichiban/prolog@v0.8.0/.github/workflows/go.yml
/home/ulrich/go/pkg/mod/github.com/ichiban/prolog@v0.9.1/.github
/home/ulrich/go/pkg/mod/github.com/ichiban/prolog@v0.9.1/.github/workflows
/home/ulrich/go/pkg/mod/github.com/ichiban/prolog@v0.9.1/.github/workflows/go.yml

Nowhere seems to be a path which ends with .git and contains ichiban. That's why I am so confused.

@UWN
Copy link
Author

UWN commented Apr 11, 2022

Here is the draft for the corrections of Cor.2 for the errors of number_chars/2, so you can see all error clauses at the same time.

@ichiban
Copy link
Owner

ichiban commented Apr 12, 2022

@UWN I'm sorry for not being clear! To git pull, you need to make a working copy first:

$ cd ~/src                                                   # Or anywhere you work with code.
$ git clone git@github.com:ichiban/prolog.git ichiban-prolog # Creates a working copy in ~/src/ichiban-prolog.
$ cd ichiban-prolog
$ git pull
Already up to date.
$ go install github.com/ichiban/prolog/cmd/1pl               # Installs 1pl from this working copy.

I think this is the fastest way to do git pull && go install github.com/ichiban/prolog/cmd/1pl.

Alternatively, you can fork github.com/ichiban/prolog first and make a working copy of it. It's a preferred way to make a pull request: https://github.com/ichiban/prolog#contributing

The files under ~/go/pkg/mod must be the cached files to build the 1pl command from go install github.com/ichiban/prolog/cmd/1pl@latest.

@UWN
Copy link
Author

UWN commented Apr 12, 2022

Or, how can I cleanly uninstall it? Such that I can just install it anew? I tried SO for this, but did not get any go-related good answer. Maybe I messed up something. But for other systems, everything is fine on github.

@UWN
Copy link
Author

UWN commented Apr 12, 2022

Thank you, finally, I have everything in place. I will close this now, to make sure that issues remain related to one clear topic.

@UWN UWN closed this as completed Apr 12, 2022
@UWN UWN changed the title Error reporting , number_chars/2 Error reporting , number_chars/2, installation problems. Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants