diff options
author | Eduardo Julian | 2019-01-08 20:17:34 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-01-08 20:17:34 -0400 |
commit | b0d4c7349f12c0828c0466c3a98965139f3cb8b4 (patch) | |
tree | 0a790d503c17dd4d1df1d41df535a8970eea6b0f | |
parent | 3673048937dce9366e138b2e273027442bf00957 (diff) |
Small adjustments.
Diffstat (limited to '')
-rw-r--r-- | lux-mode/lux-mode.el | 7 | ||||
-rw-r--r-- | stdlib/source/lux/control/concurrency/promise.lux | 2 | ||||
-rw-r--r-- | stdlib/source/lux/data/format/context.lux | 6 | ||||
-rw-r--r-- | stdlib/source/lux/world/net/http.lux | 11 | ||||
-rw-r--r-- | stdlib/source/lux/world/net/http/response.lux | 14 |
5 files changed, 29 insertions, 11 deletions
diff --git a/lux-mode/lux-mode.el b/lux-mode/lux-mode.el index 970bd89bb..47983ed83 100644 --- a/lux-mode/lux-mode.el +++ b/lux-mode/lux-mode.el @@ -1,11 +1,11 @@ ;;; lux-mode.el --- Major mode for Lux code -*- lexical-binding: t; -*- -;; Copyright © 2014-2018 Eduardo Julian +;; Copyright © 2014-2019 Eduardo Julian ;; ;; Authors: Eduardo Julian <eduardoejp@gmail.com> ;; URL: https://github.com/LuxLang/lux/tree/master/lux-mode ;; Keywords: languages lisp lux -;; Version: 0.1.0 +;; Version: 0.6.0 ;; Package-Requires: ((emacs "24.1")) ;; This file is not part of GNU Emacs. @@ -445,6 +445,9 @@ This function also returns nil meaning don't specify the indentation." (do-to 'defun) (comment 'defun) (^template 'defun) + (remember 'defun) + (to-do 'defun) + (fix-me 'defun) ) ;;;###autoload diff --git a/stdlib/source/lux/control/concurrency/promise.lux b/stdlib/source/lux/control/concurrency/promise.lux index 31d620b64..33a04190b 100644 --- a/stdlib/source/lux/control/concurrency/promise.lux +++ b/stdlib/source/lux/control/concurrency/promise.lux @@ -3,7 +3,7 @@ [control [functor (#+ Functor)] [apply (#+ Apply)] - ["." monad (#+ do Monad)]] + ["." monad (#+ Monad do)]] [data ["." product]] ["." function] diff --git a/stdlib/source/lux/data/format/context.lux b/stdlib/source/lux/data/format/context.lux index 749185f85..715489072 100644 --- a/stdlib/source/lux/data/format/context.lux +++ b/stdlib/source/lux/data/format/context.lux @@ -6,7 +6,7 @@ [monad (#+ do)]] [data ["." error (#+ Error)] - [text + ["." text format] [collection ["." dictionary (#+ Dictionary)]]]]) @@ -20,6 +20,10 @@ (type: #export (Property a) (Parser Context a)) +(def: #export empty + Context + (dictionary.new text.Hash<Text>)) + (def: #export (property name) (-> Text (Property Text)) (function (_ context) diff --git a/stdlib/source/lux/world/net/http.lux b/stdlib/source/lux/world/net/http.lux index 36809c28f..04e7ef829 100644 --- a/stdlib/source/lux/world/net/http.lux +++ b/stdlib/source/lux/world/net/http.lux @@ -1,12 +1,12 @@ (.module: [lux #* + [control + [concurrency + [promise (#+ Promise)] + [frp (#+ Channel)]]] [data - [error (#+ Error)] [format [context (#+ Context)]]] - [concurrency - [promise (#+ Promise)] - [frp (#+ Channel)]] [world [binary (#+ Binary)]]] [// (#+ URL)]) @@ -17,6 +17,7 @@ #Post #Get #Put + #Patch #Delete #Head #Connect @@ -72,4 +73,4 @@ [Status Payload]) (type: #export Server - (-> Request (Promise (Error Response)))) + (-> Request (Promise Response))) diff --git a/stdlib/source/lux/world/net/http/response.lux b/stdlib/source/lux/world/net/http/response.lux index 3bca36449..fc23dfd20 100644 --- a/stdlib/source/lux/world/net/http/response.lux +++ b/stdlib/source/lux/world/net/http/response.lux @@ -1,5 +1,8 @@ (.module: [lux #* + [control + [concurrency + ["." frp ("channel/." Monad<Channel>)]]] [data ["." text format @@ -8,8 +11,6 @@ ["." array] ["." dictionary (#+ Dictionary)]]] ["." io] - [concurrency - ["." frp ("channel/." Monad<Channel>)]] [world ["." binary (#+ Binary)]]] ["." // (#+ Body Response) @@ -43,3 +44,12 @@ (header.content-length (binary.size data)) (header.content-type mime.text)) #//.body (channel/wrap data)}])) + +(def: #export (text content) + (-> Text Response) + (let [data (encoding.to-utf8 content)] + [status.ok + {#//.headers (|> (dictionary.new text.Hash<Text>) + (header.content-length (binary.size data)) + (header.content-type mime.text)) + #//.body (channel/wrap data)}])) |