-2
"Liquidsoap"이라는 오디오 방송 언어 스크립트에서 스위치 기능을 작동하는 달의 특정 요일을 정의하는 방법을 모색했습니다. 그 언어는 C와 oCaml을 사용하여 만들어지고 결국 IceCast로 출력됩니다.스크립트에서 특정 날짜 정의 - 유닉스 날짜
난 그냥
use the date
function from unix to build a function which will choose the good day (and
do almost whatever you want in this way). For instance,
# Function returning true if this is a good day and false otherwise
def good_day() =
# Name of the current day
day_name = get_process_output("date +%A")
# Remove trailing \n
day_name = string.replace(pattern="\n",fun (_) -> "", day_name)
# Number of current week
week = int_of_string(get_process_output("date +%U"))
# Return true on tuesday every four week
(day_name == "Tuesday") and (week mod 1 == 0)
end
out = switch([(good_day, good_day_playlist), ...])
내가 거기에 달의 평일을 정의하기 위해 기본적으로 필요 .. me..i 방법이 내가 필요로 번역하는 더 idead이없는이 코드를 단순화 할 사람이 필요합니다. ..lets은 (0 기반)
이
화 t는 질문입니까? 무엇을 기대합니까? 어떤 의미에서 그렇게하지 않습니까? 너 뭐 해봤 니? 이 "질문"은 전혀 의미가 없습니다. ... –
미안하지만 내 자신을 더 잘 설명하지 못하면 .. 내 필요에 활용하는 방법을 모르기 때문에이 스크립트를 시도하지 않았습니다. 그리고 내가 필요한 것은 근본적으로 거기에있는 달의 평일을 정의하는 것입니다 ... 말하기, 달의 두 번째 화요일 ... – Guy1984