1
1
mirror of https://github.com/tweag/nickel.git synced 2024-09-20 08:05:15 +03:00
Commit Graph

119 Commits

Author SHA1 Message Date
Yann Hamdaoui
1a9ac993d0 Fix record.update contract, remove trailing spaces 2022-03-28 18:00:10 +02:00
silverraven691
fcec594c77
Fix call to %record_insert% in record.update 2022-03-11 15:04:01 +01:00
silverraven691
7a13774777 Update code samples in stdlib docs to use renamed stdlib modules
This follows changes made in #620
2022-03-10 18:21:27 +01:00
Yann Hamdaoui
b8dc64a211 Add warnings about enum type syntax being unstable 2022-03-09 16:26:22 +01:00
Yann Hamdaoui
59179bfc75 Hide enum types
Enum type syntax has been changed temporarily since the unified syntax
change. While we bikeshed on a new syntax, we don't want people to rely
on the temporary syntax. This PR hides enum types from stdlib types, and
document enum tags but not enum types in the manual. That way, they are
still morally used in the stdlib, but a random user should be able to
use it without knowing about the type.
2022-03-09 16:26:22 +01:00
Yann Hamdaoui
e004d94fa3
Merge branch 'master' into task/remove-record-ops 2022-03-03 18:43:48 +01:00
francois-caddet
0ff4f88286 fix butal replacement for http(s):// 2022-03-03 17:12:19 +01:00
Yann Hamdaoui
4f5f5b7d7f
Fix typo in record stdlib doc (return -> returns) 2022-03-03 16:57:01 +01:00
francois-caddet
5fdc352391 replace // by # for comments 2022-03-03 11:28:59 +01:00
Yann Hamdaoui
36c74e7158 Remove -$ and $[ ], use standard primop instead
This commit removes the original idiosyncratic operators -$ and $[ ] for
field remove and field insertion, and replace them with standad
%record_remove% and %record_insert%. Also adds corresponding wrapper in
the record stdlib, as well as an update fonction, that is the
composition of the two (removal then insertion).
2022-03-02 21:57:43 +01:00
Yann Hamdaoui
f5779cd0ec Remove the Array alias for Array Dyn 2022-03-02 18:23:28 +01:00
Yann Hamdaoui
879856c51b renaming list -> array 2022-03-02 16:38:46 +01:00
francois-caddet
f4542ac1cf Merge branch 'master' into feature/hashtag_for_comment 2022-03-02 12:00:42 +01:00
francois-caddet
b66c001240 fix bad merge from master 2022-02-25 14:01:45 +01:00
francois-caddet
8dd7e0f4a8 Merge branch 'master' into feature/hashtag_for_comment 2022-02-25 12:58:57 +01:00
Yann Hamdaoui
9753deb776 Rename stdlib modules: remove trailing s 2022-02-25 12:41:54 +01:00
Yann Hamdaoui
417ad5f287
Merge pull request #618 from tweag/doc/update-doc-to-rfc002
[Doc] Update doc and comments to use the uniterm syntax
2022-02-25 12:39:30 +01:00
francois-caddet
b612f9d6cb Update tests and examples with the new multiline str and interpolation syntax
revert back to original comments syntax `//` will be implemented in a next PR
TODO: tests are passing but check if everything has realy been updated correctly
2022-02-23 22:33:12 +01:00
Yann Hamdaoui
0f6219acb5 Hide builtin contracts impl within the environment
The implementation of builtin contracts is pure Nickel code written as
part of the `contract.ncl` module. However it pollutes the user environment
with identifiers like `list`, `record`, etc. This PR prefixes those
contract implementation with a `$`, which makes them inaccessible from user code
directly, as an identifier can't start with `$`, to avoid unfortunate
clashes.
2022-02-23 13:41:32 +01:00
francois-caddet
4a7190bcb7 replace # by % in multilines strings and interpolations
let use `#` for comments
2022-02-23 13:11:55 +01:00
Yann Hamdaoui
99a0925e76 Update doc and comments to use the uniterm syntax 2022-02-23 10:31:52 +01:00
Yann Hamdaoui
a8596b3cf2 Update stdlib to use the uniterm syntax 2022-02-15 11:17:09 +01:00
Yann Hamdaoui
4625c42fe7 Undo stdlib migration to unisyntax (postponed) 2022-02-14 16:51:04 +01:00
Yann Hamdaoui
ec67fb4f46 Migrate stdlib strings to UniTerm syntax 2022-02-10 18:26:26 +01:00
Yann Hamdaoui
9f049434a3 Introduce a wrapper for the UniTerm AST and merge syntaxes 2022-02-10 18:23:45 +01:00
Yann Hamdaoui
cee4c331e8 Fix tests for new unified record syntax 2022-01-26 15:34:33 +01:00
Yann Hamdaoui
92c682791a Separate contract generation and contract application 2022-01-19 11:26:07 +01:00
Mathieu Boespflug
5541c356b4 Fixup conversion to snake_case
In #518, I had forgotten to change the names of the primitives in
`stdlib/strings.ncl`. I noticed the omission because this was breaking
the example in the nickel-lang.org playground.
2021-12-31 00:50:05 +02:00
Mathieu Boespflug
033ed3314b
Merge pull request #518 from tweag/snake_case
Switch to snake_case by convention for values
2021-12-29 20:30:24 +01:00
Mathieu Boespflug
8ac99dc89b Fix lists.lowercase docstring
It was mentioning `uppercase` in the example instead of `lowercase`,
likely due to a bad copy/paste.
2021-12-28 23:48:07 +02:00
Mathieu Boespflug
b0e0311267 Switch to snake_case by convention for values
This renames all builtins and standard library functions to conform to
a snake case convention, as per decision recorded in #493. This also
adapts examples and tests to this change. All functions have been
renamed the way you'd expect, except the following:

* `fromPred` -> `from_predicate`
* `typeOf` -> `typeof` (like in C)
* `fieldsOf` -> `fields` (the `_of` is redundant for a function)
* `valuesOf` -> `values` (the `_of` is redundant for a function)

Closes #493
2021-12-28 23:40:49 +02:00
Avi Dessauer
fc2bbb15b3 builtins.id should be functions.id 2021-12-03 13:02:47 -05:00
silverraven691
2138f6ac9a Flip the parameter names in records.hasField 2021-11-30 17:08:55 +01:00
silverraven691
fe783627cc Flip strings.substring 2021-11-30 17:08:55 +01:00
silverraven691
49ea21709f Flip strings.split 2021-11-30 17:08:55 +01:00
silverraven691
ade10a8ff4 Flip strings.replaceRegex 2021-11-30 17:08:55 +01:00
silverraven691
a437990ce0 Flip strings.replace 2021-11-30 17:08:55 +01:00
silverraven691
0103e0818b Flip strings.match 2021-11-30 17:08:55 +01:00
silverraven691
eec04735f0 Flip strings.join 2021-11-30 17:08:55 +01:00
silverraven691
42f9df51e1 Flip strings.isMatch 2021-11-30 17:08:55 +01:00
silverraven691
8e2fbc6f38 Flip strings.contains 2021-11-30 17:08:47 +01:00
silverraven691
4d5735edb2 Flip lists.fold 2021-11-30 17:06:45 +01:00
silverraven691
dd261c9d64 Flip lists.elemAt 2021-11-30 16:01:25 +01:00
silverraven691
32d087343b Remove EOL whitespace in stdlib 2021-11-25 20:29:54 +01:00
silverraven691
630a057207 Fix up spacing in stdlib/contracts 2021-11-25 17:22:05 +01:00
Yann Hamdaoui
6546b9d0a1
Update stdlib/contracts.ncl
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com>
2021-11-23 23:28:37 +01:00
Yann Hamdaoui
c16fd3e1bd Add blameWith and fromPred, update examples accordingly 2021-11-23 15:31:35 +01:00
silverraven691
3c837db28d Fix lists.reverse 2021-11-19 12:21:51 +01:00
silverraven691
34981a694f
Demonstrate the difference between seq and deepSeq in their documentation examples 2021-11-10 12:47:43 +01:00
Erin van der Veen
cb4486c66e Change documentation style for some functions 2021-08-30 13:51:05 +02:00