Comments (13)
Not really, when I find time I will go over the current sh.janet in detail. I find the namespace currently a bit unorganized
from spork.
This is probably due to git adding the CR byte on checkout, I'd like to test this, but don't have a working jpm setup on my windows machine.
from spork.
In a different repository I had added this: https://github.com/sogaiu/judge-gen/blob/master/.gitattributes
Does that seem like the kind of thing you had in mind for testing?
from spork.
To be honest, I not really sure. I would have to experiment with it myself. But if that works and doesn't break anything else ok the project, it should be fine I think?
Maybe this should be applied to all static test files then?
from spork.
I looked into the situation a bit more.
If test.file
doesn't have any line ending characters, the test seems to work fine.
If test.file
ends with a newline character, the test fails and it looks like test2.file
has both a carriage return and a newline character at the end.
The :w
in the file/open
of make-new-file
may be a factor:
Lines 95 to 104 in 63f656e
Chaging the mode to :wb
made the test pass.
On a side note, it doesn't look like make-new-file
's optional parameter mode
is used anywhere.
from spork.
I see, I completely forgot about the existence of the binary flag for file/open
from spork.
Regarding sh/make-new-file
and the mode
argument, I filed #98.
Perhaps a straight-forward fix would be to make file/open
's second argument mode
.
So:
(file/open file-path :w)
would become:
(file/open file-path mode)
If that seems appropriate, perhaps the line in sh/copy-file
:
Line 113 in 63f656e
can specify a different mode, say :wb
, to address this issue.
How does that seem?
from spork.
Perhaps an additional keyword argument :mode for the file creating functions would be useful instead.
from spork.
By "keyword argument", do you mean this sort of thing? https://janet-lang.org/docs/functions.html#Keyword-style-arguments
from spork.
Yes, exactly, functions using optional arguments with Keywords can be extended later, without breaking previous code and also allow specifying only one select optional argument. While only one would have to be added here, it would be easier to extend later.
I'm curious what others think about this argumentation.
from spork.
For sh/make-new-file
, it looked like in ae9db3d, @bakpakin intended for an ordinary optional argument. May be he'd be fine with a keyword argument though.
Regarding:
file creating functions
did you have any other specific ones in mind?
from spork.
bakpakin merged #99 and I verified that the change described in #96 (comment) works on a Windows machine and a Linux machine.
Made PR - #100
from spork.
The test passes for me now.
from spork.
Related Issues (20)
- Missing prime number generator HOT 20
- Prime factorization? HOT 14
- Janet 1.30 - Spork not building on Windows 11 Pro Build 22621 HOT 3
- spork/json crashes janet on cycles
- Add chance to set the HTTP status in httpf HOT 2
- in argparse, a cfunction cannot be used for :map HOT 7
- `json/encode` and representing objects with `null` values HOT 4
- janet-netrepl -l VALUE and near-immediate client disconnection
- No error feedback when coerce-to-env fails for netrepl's server function HOT 1
- Extra call to string in receiver function returned by make-recv?
- getline: Ctrl-k does not delete from the cursor to the end of the line
- Do `exec-slurp` and `exec-slurp-all` benefit from tighter resource control? HOT 4
- spork/mdz eats whitespace HOT 4
- Curious code in `math.janet` HOT 3
- spork/http/middleware asserts incorrectly when number is an argument HOT 2
- Hang during `jpm test` at `test/suit0002.janet` HOT 2
- Capturing functions for the temple
- janet-netrepl and janet-format missing from `bundle/init.janet`? HOT 5
- `(use spork)` fails if installation done via `bundle/install`
- Lack of cross-platform function to create temporary directory HOT 2
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 spork.